-rw-r--r-- | core/launcher/startmenu.h | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/core/launcher/startmenu.h b/core/launcher/startmenu.h index 7218035..3e12b36 100644 --- a/core/launcher/startmenu.h +++ b/core/launcher/startmenu.h | |||
@@ -1,106 +1,106 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #ifndef __START_MENU_H__ | 21 | #ifndef __START_MENU_H__ |
22 | #define __START_MENU_H__ | 22 | #define __START_MENU_H__ |
23 | 23 | ||
24 | #include <qtopia/applnk.h> | 24 | #include <qtopia/applnk.h> |
25 | #include <qintdict.h> | 25 | #include <qintdict.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qlist.h> | 27 | #include <qlist.h> |
28 | #include <qmap.h> | 28 | #include <qmap.h> |
29 | #include <qdir.h> | 29 | #include <qdir.h> |
30 | #include <qlabel.h> | 30 | #include <qlabel.h> |
31 | #include <qpopupmenu.h> | 31 | #include <qpopupmenu.h> |
32 | 32 | ||
33 | #include <qtopia/menuappletinterface.h> | 33 | #include <qtopia/menuappletinterface.h> |
34 | 34 | ||
35 | class StartPopupMenu : public QPopupMenu | 35 | class StartPopupMenu : public QPopupMenu |
36 | { | 36 | { |
37 | 37 | ||
38 | public: | 38 | public: |
39 | StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {} | 39 | StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {} |
40 | 40 | ||
41 | protected: | 41 | protected: |
42 | void keyPressEvent( QKeyEvent *e ); | 42 | void keyPressEvent( QKeyEvent *e ); |
43 | 43 | ||
44 | }; | 44 | }; |
45 | 45 | ||
46 | class QLibrary; | 46 | class QLibrary; |
47 | 47 | ||
48 | 48 | ||
49 | struct MenuApplet { | 49 | struct MenuApplet { |
50 | QLibrary *library; | 50 | QLibrary *library; |
51 | MenuAppletInterface *iface; | 51 | MenuAppletInterface *iface; |
52 | int id; | 52 | int id; |
53 | QPopupMenu *popup; | 53 | QPopupMenu *popup; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | class StartMenu : public QLabel { | 56 | class StartMenu : public QLabel { |
57 | 57 | ||
58 | Q_OBJECT | 58 | Q_OBJECT |
59 | 59 | ||
60 | public: | 60 | public: |
61 | StartMenu( QWidget * ); | 61 | StartMenu( QWidget * ); |
62 | ~StartMenu(); | 62 | ~StartMenu(); |
63 | 63 | ||
64 | void refreshMenu(); | 64 | void refreshMenu(); |
65 | 65 | ||
66 | public: | 66 | public: |
67 | StartPopupMenu *launchMenu; | 67 | StartPopupMenu *launchMenu; |
68 | 68 | ||
69 | signals: | 69 | signals: |
70 | void tabSelected(const QString&); | 70 | void tabSelected(const QString&); |
71 | 71 | ||
72 | public slots: | 72 | public slots: |
73 | void launch( ); | 73 | void launch( ); |
74 | void createMenu( ); | 74 | void createMenu( ); |
75 | 75 | ||
76 | protected slots: | 76 | protected slots: |
77 | void itemSelected( int id ); | 77 | void itemSelected( int id ); |
78 | 78 | ||
79 | protected: | 79 | protected: |
80 | virtual void mousePressEvent( QMouseEvent * ); | 80 | virtual void mousePressEvent( QMouseEvent * ); |
81 | 81 | ||
82 | private: | 82 | private: |
83 | void loadApplets(); | 83 | void loadApplets(); |
84 | void clearApplets(); | 84 | void clearApplets(); |
85 | void addApplets( QPopupMenu* menu ); | 85 | void addApplets( QPopupMenu* menu ); |
86 | bool loadMenu( QPopupMenu *menu ); | 86 | bool loadMenu( QPopupMenu *menu ); |
87 | void createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot ); | 87 | void createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot ); |
88 | void createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool lot ); | 88 | void createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool lot ); |
89 | void createAppEntry( QPopupMenu *menu, QDir dir, QString file ); | 89 | void createAppEntry( QPopupMenu *menu, QDir dir, QString file ); |
90 | 90 | ||
91 | private: | 91 | private: |
92 | bool useWidePopupMenu; | 92 | bool useWidePopupMenu; |
93 | QString popupMenuSidePixmap; | 93 | QString popupMenuSidePixmap; |
94 | 94 | ||
95 | bool startButtonIsFlat; | 95 | bool startButtonIsFlat; |
96 | QString startButtonPixmap; | 96 | QString startButtonPixmap; |
97 | 97 | ||
98 | int currentItem; | 98 | int currentItem; |
99 | 99 | ||
100 | QIntDict<AppLnk> appLnks; | 100 | QIntDict<AppLnk> appLnks; |
101 | QIntDict<QString> tabNames; | 101 | QIntDict<QString> tabNames; |
102 | QIntDict<MenuApplet> menuApplets; | 102 | QIntDict<MenuApplet> menuApplets; |
103 | 103 | ||
104 | }; | 104 | }; |
105 | 105 | ||
106 | #endif // __START_MENU_H__ | 106 | #endif // __START_MENU_H__ |