fixed indentation (tabs to spaces)
[simple-launcher] / simple-launcher.h
1 // This file is a part of Simple Launcher
2 //
3 // Copyright (C) 2006, 2007, 2008 Mikhail Sobolev <mss@mawhrin.net>
4 //
5 // Simple Launcher is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU General Public License version 2 as published by
7 // the Free Software Foundation.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT
10 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12 // more details.
13 //
14 // You should have received a copy of the GNU General Public License along with
15 // this program; if not, write to the Free Software Foundation, Inc., 51
16 // Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 #ifndef _SIMPLE_LAUNCHER_H_
19 #define _SIMPLE_LAUNCHER_H_
20
21 #include <libosso.h>
22
23 #include "launcher-item.h"
24 #include "launchable-item.h"
25 #include "settings-dialog.h"
26 #include "gconf-wrapper.h"
27
28 #define SL_APPLET_GCONF_PATH  "/apps/simple-launcher"
29
30 class SimpleLauncherApplet {
31 public:
32   SimpleLauncherApplet(const std::string&);
33  ~SimpleLauncherApplet();
34
35   bool doInit(void *state_data, int *state_size);
36
37   int saveState(void **state_data, int *state_size);
38   GtkWidget *settings(GtkWindow *parent);
39
40   GtkWidget *getWidget() { return myWidget; }
41
42   int getWidth() const;
43   int getHeight() const;
44
45   void getBackgroundColour(double& red, double& green, double& blue, double alpha) const;
46
47 private:
48   static void addItem(LauncherItems&, const std::string&, bool);
49
50   void loadConfig();
51   void saveConfig();
52
53   static void updateItems(LauncherItems&);
54   static void processDirectory(LauncherItems&, const std::string&);
55
56   bool initWidget();
57   void updateWidget();
58
59   void buttonPressed(GtkWidget *button, GdkEventButton *event);
60   void runDialog();
61
62   static void _button_pressed(GtkWidget *button, GdkEventButton *event, void *self);
63   static void _run_dialog(GtkMenuItem *, void *);
64
65 private:
66   // GConfClientWrapper myClient;
67   // GConfKey myMainSettings;
68
69   osso_context_t *myContext;
70
71   GtkWidget *myWidget;
72   GtkWindow *myParent;
73
74   LauncherItems myItems;
75   int myValidItems;
76
77   GConfBooleanOption myTransparent;
78   // bool myShowInfobanner; // FIXME: to implement
79   GConfIntegerOption myIconSize;
80
81   static char *ourDirs[];
82 };
83
84 #endif