summaryrefslogtreecommitdiff
path: root/core/launcher/startmenu.h
Unidiff
Diffstat (limited to 'core/launcher/startmenu.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/startmenu.h201
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
33class StartPopupMenu : public QPopupMenu 33#include <qtopia/menuappletinterface.h>
34{ 34
35public: 35class StartPopupMenu : public QPopupMenu
36 StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {} 36{
37protected: 37
38 void keyPressEvent( QKeyEvent *e ); 38public:
39}; 39 StartPopupMenu( QWidget *parent ) : QPopupMenu( parent ) {}
40 40
41class QLibrary; 41protected:
42 42 void keyPressEvent( QKeyEvent *e );
43 43
44struct MenuApplet { 44};
45 QLibrary *library; 45
46 MenuAppletInterface *iface; 46class QLibrary;
47 int id; 47
48 QPopupMenu *popup; 48
49}; 49struct MenuApplet {
50 50 QLibrary *library;
51class StartMenu : public QLabel { 51 MenuAppletInterface *iface;
52 Q_OBJECT 52 int id;
53public: 53 QPopupMenu *popup;
54 StartMenu( QWidget * ); 54};
55 ~StartMenu(); 55
56 56class StartMenu : public QLabel {
57 void refreshMenu(); 57
58 58 Q_OBJECT
59public: 59
60 StartPopupMenu *launchMenu; 60public:
61 61 StartMenu( QWidget * );
62signals: 62 ~StartMenu();
63 void tabSelected(const QString&); 63
64 64 void refreshMenu();
65public slots: 65
66 void launch( ); 66public:
67 void createMenu( ); 67 StartPopupMenu *launchMenu;
68 68
69protected slots: 69signals:
70 void itemSelected( int id ); 70 void tabSelected(const QString&);
71 71
72protected: 72public slots:
73 virtual void mousePressEvent( QMouseEvent * ); 73 void launch( );
74 74 void createMenu( );
75private: 75
76 void loadApplets(); 76protected slots:
77 void clearApplets(); 77 void itemSelected( int id );
78 void addApplets( QPopupMenu* menu ); 78
79 bool loadMenu( QPopupMenu *menu ); 79protected:
80 80 virtual void mousePressEvent( QMouseEvent * );
81private: 81
82 bool useWidePopupMenu; 82private:
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; 91private:
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__