author | harlekin <harlekin> | 2003-11-30 17:58:02 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-11-30 17:58:02 (UTC) |
commit | a7e786be4f9545a881015de8ba8a124a62f0f891 (patch) (unidiff) | |
tree | 6d4c5d6e0f83cdc9aea5ab4083ec1fe0a261d6ac /core/launcher/startmenu.h | |
parent | f50b547e2660c26b2c84512c2cb3d83f2ddf147c (diff) | |
download | opie-a7e786be4f9545a881015de8ba8a124a62f0f891.zip opie-a7e786be4f9545a881015de8ba8a124a62f0f891.tar.gz opie-a7e786be4f9545a881015de8ba8a124a62f0f891.tar.bz2 |
startmenu was further developed in branch
-rw-r--r-- | core/launcher/startmenu.h | 201 |
1 files changed, 106 insertions, 95 deletions
diff --git a/core/launcher/startmenu.h b/core/launcher/startmenu.h index 99df0f0..7218035 100644 --- a/core/launcher/startmenu.h +++ b/core/launcher/startmenu.h | |||
@@ -1,95 +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 <qlabel.h> | 28 | #include <qmap.h> |
29 | #include <qpopupmenu.h> | 29 | #include <qdir.h> |
30 | 30 | #include <qlabel.h> | |
31 | #include <qtopia/menuappletinterface.h> | 31 | #include <qpopupmenu.h> |
32 | 32 | ||
33 | class StartPopupMenu : public QPopupMenu | 33 | #include <qtopia/menuappletinterface.h> |
34 | { | 34 | |
35 | public: | 35 | class StartPopupMenu : public QPopupMenu |
36 | StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {} | 36 | { |
37 | protected: | 37 | |
38 | void keyPressEvent( QKeyEvent *e ); | 38 | public: |
39 | }; | 39 | StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {} |
40 | 40 | ||
41 | class QLibrary; | 41 | protected: |
42 | 42 | void keyPressEvent( QKeyEvent *e ); | |
43 | 43 | ||
44 | struct MenuApplet { | 44 | }; |
45 | QLibrary *library; | 45 | |
46 | MenuAppletInterface *iface; | 46 | class QLibrary; |
47 | int id; | 47 | |
48 | QPopupMenu *popup; | 48 | |
49 | }; | 49 | struct MenuApplet { |
50 | 50 | QLibrary *library; | |
51 | class StartMenu : public QLabel { | 51 | MenuAppletInterface *iface; |
52 | Q_OBJECT | 52 | int id; |
53 | public: | 53 | QPopupMenu *popup; |
54 | StartMenu( QWidget * ); | 54 | }; |
55 | ~StartMenu(); | 55 | |
56 | 56 | class StartMenu : public QLabel { | |
57 | void refreshMenu(); | 57 | |
58 | 58 | Q_OBJECT | |
59 | public: | 59 | |
60 | StartPopupMenu *launchMenu; | 60 | public: |
61 | 61 | StartMenu( QWidget * ); | |
62 | signals: | 62 | ~StartMenu(); |
63 | void tabSelected(const QString&); | 63 | |
64 | 64 | void refreshMenu(); | |
65 | public slots: | 65 | |
66 | void launch( ); | 66 | public: |
67 | void createMenu( ); | 67 | StartPopupMenu *launchMenu; |
68 | 68 | ||
69 | protected slots: | 69 | signals: |
70 | void itemSelected( int id ); | 70 | void tabSelected(const QString&); |
71 | 71 | ||
72 | protected: | 72 | public slots: |
73 | virtual void mousePressEvent( QMouseEvent * ); | 73 | void launch( ); |
74 | 74 | void createMenu( ); | |
75 | private: | 75 | |
76 | void loadApplets(); | 76 | protected slots: |
77 | void clearApplets(); | 77 | void itemSelected( int id ); |
78 | void addApplets( QPopupMenu* menu ); | 78 | |
79 | bool loadMenu( QPopupMenu *menu ); | 79 | protected: |
80 | 80 | virtual void mousePressEvent( QMouseEvent * ); | |
81 | private: | 81 | |
82 | bool useWidePopupMenu; | 82 | private: |
83 | QString popupMenuSidePixmap; | 83 | void loadApplets(); |
84 | 84 | void clearApplets(); | |
85 | bool startButtonIsFlat; | 85 | void addApplets( QPopupMenu* menu ); |
86 | QString startButtonPixmap; | 86 | bool loadMenu( QPopupMenu *menu ); |
87 | 87 | void createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot ); | |
88 | QStringList tabs; | 88 | void createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool lot ); |
89 | QList<AppLnk> other; | 89 | void createAppEntry( QPopupMenu *menu, QDir dir, QString file ); |
90 | QIntDict<MenuApplet> m_applets; | 90 | |
91 | int ntabs; | 91 | private: |
92 | int nother; | 92 | bool useWidePopupMenu; |
93 | }; | 93 | QString popupMenuSidePixmap; |
94 | 94 | ||
95 | #endif // __START_MENU_H__ | 95 | bool startButtonIsFlat; |
96 | QString startButtonPixmap; | ||
97 | |||
98 | int currentItem; | ||
99 | |||
100 | QIntDict<AppLnk> appLnks; | ||
101 | QIntDict<QString> tabNames; | ||
102 | QIntDict<MenuApplet> menuApplets; | ||
103 | |||
104 | }; | ||
105 | |||
106 | #endif // __START_MENU_H__ | ||