00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LAUNCHER_H
00021 #define LAUNCHER_H
00022
00023 #include <qtopia/config.h>
00024 #include <qtopia/storage.h>
00025 #include <qtopia/applnk.h>
00026 #include <qmainwindow.h>
00027 #include <qstringlist.h>
00028 #include <qprogressbar.h>
00029 #include <qvbox.h>
00030 #include <qlist.h>
00031 #include <qdict.h>
00032 #include "launcherview.h"
00033 #include "launchertab.h"
00034 #include "serverinterface.h"
00035
00036 class QWidgetStack;
00037 class TaskBar;
00038 class Launcher;
00039
00040 class LauncherTabWidget : public QVBox {
00041
00042 Q_OBJECT
00043 public:
00044 LauncherTabWidget( Launcher* parent );
00045
00046 void updateDocs(AppLnkSet* docFolder);
00047 void setBusy(bool on);
00048 LauncherView *currentView(void);
00049
00050 LauncherView* newView( const QString&, const QPixmap& pm, const QString& label );
00051 void deleteView( const QString& );
00052 void setTabViewAppearance( LauncherView *v, Config &cfg );
00053 void setTabAppearance( LauncherTab *, Config &cfg );
00054
00055 LauncherView *view( const QString & );
00056 LauncherView *docView();
00057
00058 void createDocLoadingWidget();
00059 void setLoadingWidgetEnabled( bool v );
00060 void setLoadingProgress( int percent );
00061
00062 LauncherTabBar* categoryBar;
00063
00064 void setBusyIndicatorType( const QString& type );
00065
00066 signals:
00067 void selected(const QString&);
00068 void clicked(const AppLnk*);
00069 void rightPressed(AppLnk*);
00070
00071 protected slots:
00072 void raiseTabWidget();
00073 void tabProperties();
00074 void initLayout();
00075
00076 private slots:
00077 void launcherMessage( const QCString &, const QByteArray &);
00078 void appMessage( const QCString &, const QByteArray &);
00079 void setProgressStyle();
00080
00081 protected:
00082 void paletteChange( const QPalette &p );
00083 void styleChange( QStyle & );
00084 void reCheckDoctab(int how);
00085
00086 private:
00087 Launcher *launcher;
00088 LauncherView *docview;
00089
00090 QWidgetStack *stack;
00091 LauncherView *docLoadingWidget;
00092 QProgressBar *docLoadingWidgetProgress;
00093 bool docLoadingWidgetEnabled;
00094 bool docTabEnabled;
00095 int m_DocumentTabId;
00096 };
00097
00098 class Launcher : public QMainWindow, public ServerInterface
00099 {
00100 Q_OBJECT
00101 public:
00102 Launcher();
00103 ~Launcher();
00104
00105
00106 void createGUI();
00107 void destroyGUI();
00108 void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap );
00109 void typeRemoved( const QString& type );
00110 void applicationAdded( const QString& type, const AppLnk& doc );
00111 void applicationRemoved( const QString& type, const AppLnk& doc );
00112 void allApplicationsRemoved();
00113 void applicationStateChanged( const QString& name, ApplicationState state );
00114 void documentAdded( const DocLnk& doc );
00115 void documentRemoved( const DocLnk& doc );
00116 void aboutToAddBegin();
00117 void aboutToAddEnd();
00118 void allDocumentsRemoved();
00119 void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc );
00120 void storageChanged( const QList<FileSystem> & );
00121 void applicationScanningProgress( int percent );
00122 void documentScanningProgress( int percent );
00123 bool requiresApplications() const { return TRUE; }
00124 bool requiresDocuments() const;
00125 void showLoadingDocs();
00126 void showDocTab();
00127
00128 QStringList idList() const { return ids; }
00129
00130 public slots:
00131 void viewSelected(const QString&);
00132 void showTab(const QString&);
00133 void select( const AppLnk * );
00134 void properties( AppLnk * );
00135 void makeVisible();
00136
00137 signals:
00138 void executing( const AppLnk * );
00139
00140 private slots:
00141 void systemMessage( const QCString &, const QByteArray &);
00142
00143 protected:
00144 bool eventFilter( QObject *o, QEvent *ev );
00145
00146 private:
00147 void updateApps();
00148 void loadDocs();
00149 void updateDocs();
00150 void updateTabs();
00151
00152 LauncherTabWidget *tabs;
00153 QStringList ids;
00154 TaskBar *tb;
00155
00156 bool docTabEnabled;
00157 };
00158
00159 #endif // LAUNCHERVIEW_H