0fbfc3a3f8ff4cc8a3521419319c5acadb5a72e9
[simple-launcher] / sla-list.h
1 // This file is a part of Simple Launcher
2 //
3 // Copyright (C) 2006, Mikhail Sobolev
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 __SLA_LIST_H__
19 #define __SLA_LIST_H__
20
21 #include <vector>
22 #include <string>
23
24 #include <gtk/gtkliststore.h>
25 #include <gtk/gtktreeview.h>
26 #include <gtk/gtkbutton.h>
27 #include <gtk/gtkcellrenderertoggle.h>
28
29 class SLAList {
30 public:
31   SLAList(int);
32  ~SLAList();
33
34   void addItem(const char *filename, GdkPixbuf *pixbuf, const char *name, bool active);
35
36   GtkWidget *getWidget() { return myWidget; }
37
38   void collectItems(std::vector<std::pair<std::string, bool> >&);
39
40 private:
41   static void _moveUp(GtkButton *, void *);
42   static void _moveDown(GtkButton *, void *);
43   static void _toggleBool(GtkCellRendererToggle *, const gchar *, void *);
44
45   void moveUp(GtkButton *);
46   void moveDown(GtkButton *);
47   void toggleBool(GtkCellRendererToggle *, const gchar *);
48
49 private:
50   GtkWidget *myWidget;
51   GtkListStore *myStore;
52   GtkTreeView *myView;
53   GtkTreeSelection *mySelection;
54 };
55
56 #endif
57
58 // vim:ts=2:sw=2:et