-rw-r--r-- | core/launcher/launcher.h | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h new file mode 100644 index 0000000..00ae980 --- a/dev/null +++ b/core/launcher/launcher.h | |||
@@ -0,0 +1,136 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef LAUNCHER_H | ||
21 | #define LAUNCHER_H | ||
22 | |||
23 | #include <qmainwindow.h> | ||
24 | #include <qtabbar.h> | ||
25 | #include <qstringlist.h> | ||
26 | #include <qvbox.h> | ||
27 | #include <qlist.h> | ||
28 | #include "launcherview.h" | ||
29 | |||
30 | class AppLnk; | ||
31 | class AppLnkSet; | ||
32 | class DocLnkSet; | ||
33 | class QWidgetStack; | ||
34 | class StorageInfo; | ||
35 | class SyncDialog; | ||
36 | |||
37 | class CategoryTabBar : public QTabBar | ||
38 | { | ||
39 | Q_OBJECT | ||
40 | public: | ||
41 | CategoryTabBar( QWidget *parent=0, const char *name=0 ); | ||
42 | ~CategoryTabBar(); | ||
43 | |||
44 | protected slots: | ||
45 | virtual void layoutTabs(); | ||
46 | |||
47 | protected: | ||
48 | void paint ( QPainter *p, QTab *t, bool f ) const; | ||
49 | void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const; | ||
50 | }; | ||
51 | |||
52 | class CategoryTabWidget : public QVBox { | ||
53 | // can't use a QTabWidget, since it won't let us set the frame style. | ||
54 | Q_OBJECT | ||
55 | public: | ||
56 | CategoryTabWidget( QWidget* parent ); | ||
57 | void initializeCategories(AppLnkSet* rootFolder, AppLnkSet* docFolder, | ||
58 | const QList<FileSystem> &); | ||
59 | void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); | ||
60 | void updateLink(const QString& linkfile); | ||
61 | void setBusy(bool on); | ||
62 | |||
63 | signals: | ||
64 | void selected(const QString&); | ||
65 | void clicked(const AppLnk*); | ||
66 | void rightPressed(AppLnk*); | ||
67 | |||
68 | public slots: | ||
69 | void nextTab(); | ||
70 | void prevTab(); | ||
71 | |||
72 | protected: | ||
73 | void paletteChange( const QPalette &p ); | ||
74 | |||
75 | private: | ||
76 | CategoryTabBar* categoryBar; | ||
77 | QWidgetStack* stack; | ||
78 | LauncherView* docview; | ||
79 | QStringList ids; | ||
80 | int tabs; | ||
81 | LauncherView* newView( const QString&, const QPixmap& pm, const QString& label ); | ||
82 | void addItem( const QString& ); | ||
83 | }; | ||
84 | |||
85 | class Launcher : public QMainWindow | ||
86 | { | ||
87 | Q_OBJECT | ||
88 | friend class LauncherPrivate; | ||
89 | public: | ||
90 | Launcher( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
91 | ~Launcher(); | ||
92 | |||
93 | static QString appsFolderName(); | ||
94 | |||
95 | virtual void showMaximized(); | ||
96 | static bool mkdir(const QString &path); | ||
97 | |||
98 | public slots: | ||
99 | void viewSelected(const QString&); | ||
100 | void select( const AppLnk * ); | ||
101 | void externalSelected( const AppLnk *); | ||
102 | void properties( AppLnk * ); | ||
103 | void nextView(); | ||
104 | |||
105 | signals: | ||
106 | void executing( const AppLnk * ); | ||
107 | void busy(); | ||
108 | void notBusy(const QString&); | ||
109 | |||
110 | private slots: | ||
111 | void doMaximize(); | ||
112 | void systemMessage( const QCString &, const QByteArray &); | ||
113 | void storageChanged(); | ||
114 | void cancelSync(); | ||
115 | |||
116 | private: | ||
117 | void updateApps(); | ||
118 | void loadDocs(); | ||
119 | void updateDocs(); | ||
120 | void updateTabs(); | ||
121 | void updateMimeTypes(); | ||
122 | void updateMimeTypes(AppLnkSet*); | ||
123 | void preloadApps(); | ||
124 | AppLnkSet *rootFolder; | ||
125 | DocLnkSet *docsFolder; | ||
126 | CategoryTabWidget *tabs; | ||
127 | StorageInfo *storage; | ||
128 | SyncDialog *syncDialog; | ||
129 | |||
130 | void updateLink(const QString& link); | ||
131 | bool in_lnk_props; | ||
132 | bool got_lnk_change; | ||
133 | QString lnk_change; | ||
134 | }; | ||
135 | |||
136 | #endif // LAUNCHERVIEW_H | ||