changed description to reflect the real names
[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();
36
37   GtkWidget *settings(GtkWindow *parent);
38
39   GtkWidget *getWidget() const { return myWidget; }
40
41   int getWidth() const;
42   int getHeight() const;
43
44   void getBackgroundColour(double& red, double& green, double& blue, double alpha) const;
45
46 private:
47   static void addItem(LauncherItems&, const std::string&, bool);
48
49   void loadConfig();
50   void saveConfig();
51
52   static void updateItems(LauncherItems&);
53   static void processDirectory(LauncherItems&, const std::string&);
54
55   bool initWidget();
56   void updateWidget();
57
58   void buttonPressed(GtkWidget *button, GdkEventButton *event);
59   void runDialog();
60
61   static void _button_pressed(GtkWidget *button, GdkEventButton *event, void *self);
62   static void _run_dialog(GtkMenuItem *, void *);
63
64 private:
65   // GConfClientWrapper myClient;
66   // GConfKey myMainSettings;
67
68   osso_context_t *myContext;
69
70   GtkWidget *myWidget;
71   GtkWindow *myParent;
72
73   LauncherItems myItems;
74   int myValidItems;
75
76   GConfBooleanOption myTransparent;
77   // bool myShowInfobanner; // FIXME: to implement
78   GConfIntegerOption myIconSize;
79
80   static char *ourDirs[];
81 };
82
83 #endif
84
85 // vim:ts=2:sw=2:et