summaryrefslogtreecommitdiff
path: root/core/launcher/launcher.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/launcher/launcher.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'core/launcher/launcher.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.h136
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
30class AppLnk;
31class AppLnkSet;
32class DocLnkSet;
33class QWidgetStack;
34class StorageInfo;
35class SyncDialog;
36
37class CategoryTabBar : public QTabBar
38{
39 Q_OBJECT
40public:
41 CategoryTabBar( QWidget *parent=0, const char *name=0 );
42 ~CategoryTabBar();
43
44protected slots:
45 virtual void layoutTabs();
46
47protected:
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
52class CategoryTabWidget : public QVBox {
53 // can't use a QTabWidget, since it won't let us set the frame style.
54 Q_OBJECT
55public:
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
63signals:
64 void selected(const QString&);
65 void clicked(const AppLnk*);
66 void rightPressed(AppLnk*);
67
68public slots:
69 void nextTab();
70 void prevTab();
71
72protected:
73 void paletteChange( const QPalette &p );
74
75private:
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
85class Launcher : public QMainWindow
86{
87 Q_OBJECT
88 friend class LauncherPrivate;
89public:
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
98public slots:
99 void viewSelected(const QString&);
100 void select( const AppLnk * );
101 void externalSelected( const AppLnk *);
102 void properties( AppLnk * );
103 void nextView();
104
105signals:
106 void executing( const AppLnk * );
107 void busy();
108 void notBusy(const QString&);
109
110private slots:
111 void doMaximize();
112 void systemMessage( const QCString &, const QByteArray &);
113 void storageChanged();
114 void cancelSync();
115
116private:
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