summaryrefslogtreecommitdiff
path: root/core
authorzecke <zecke>2004-04-19 07:12:16 (UTC)
committer zecke <zecke>2004-04-19 07:12:16 (UTC)
commit0b59a16b5a5a179c46ddb3f8c585dbca59b2826e (patch) (unidiff)
tree3780a3ae09806e781582aefb23ad3040bc15d816 /core
parent359b681f32d5c3ac2ea3bfd39a3637d211338bf7 (diff)
downloadopie-0b59a16b5a5a179c46ddb3f8c585dbca59b2826e.zip
opie-0b59a16b5a5a179c46ddb3f8c585dbca59b2826e.tar.gz
opie-0b59a16b5a5a179c46ddb3f8c585dbca59b2826e.tar.bz2
Small interface update. If we add doctypes disable the viewport() for
updates
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp8
-rw-r--r--core/launcher/launcher.cpp10
-rw-r--r--core/launcher/launcher.h2
-rw-r--r--core/launcher/serverinterface.h2
4 files changed, 20 insertions, 2 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 59dd721..19ceb0f 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -23,97 +23,97 @@
23 23
24/* OPIE */ 24/* OPIE */
25#include <opie2/oglobal.h> 25#include <opie2/oglobal.h>
26#include <opie2/odebug.h> 26#include <opie2/odebug.h>
27#include <qtopia/config.h> 27#include <qtopia/config.h>
28#include <qtopia/mimetype.h> 28#include <qtopia/mimetype.h>
29#include <qtopia/resource.h> 29#include <qtopia/resource.h>
30#include <qtopia/private/categories.h> 30#include <qtopia/private/categories.h>
31#include <qtopia/qpeapplication.h> 31#include <qtopia/qpeapplication.h>
32#include <qtopia/applnk.h> 32#include <qtopia/applnk.h>
33#include <qtopia/storage.h> 33#include <qtopia/storage.h>
34#ifdef Q_WS_QWS 34#ifdef Q_WS_QWS
35#include <qtopia/qcopenvelope_qws.h> 35#include <qtopia/qcopenvelope_qws.h>
36#endif 36#endif
37using namespace Opie::Core; 37using namespace Opie::Core;
38 38
39/* QT */ 39/* QT */
40#include <qtimer.h> 40#include <qtimer.h>
41#include <qfileinfo.h> 41#include <qfileinfo.h>
42#include <qtextstream.h> 42#include <qtextstream.h>
43#include <qfile.h> 43#include <qfile.h>
44#include <qdir.h> 44#include <qdir.h>
45#include <qpainter.h> 45#include <qpainter.h>
46#include <qimage.h> 46#include <qimage.h>
47#include <qcopchannel_qws.h> 47#include <qcopchannel_qws.h>
48#include <qlistview.h> 48#include <qlistview.h>
49#include <qlist.h> 49#include <qlist.h>
50#include <qpixmap.h> 50#include <qpixmap.h>
51 51
52 52
53AppLnkSet *DocumentList::appLnkSet = 0; 53AppLnkSet *DocumentList::appLnkSet = 0;
54 54
55static const int MAX_SEARCH_DEPTH = 10; 55static const int MAX_SEARCH_DEPTH = 10;
56 56
57 57
58class DocumentListPrivate : public QObject { 58class DocumentListPrivate : public QObject {
59 Q_OBJECT 59 Q_OBJECT
60public: 60public:
61 DocumentListPrivate( ServerInterface *gui ); 61 DocumentListPrivate( ServerInterface *gui );
62 ~DocumentListPrivate(); 62 ~DocumentListPrivate();
63 63
64 void initialize(); 64 void initialize();
65 65
66 const QString nextFile(); 66 const QString nextFile();
67 const DocLnk *iterate(); 67 const DocLnk *iterate();
68 bool store( DocLnk* dl ); 68 bool store( DocLnk* dl );
69 void estimatedPercentScanned(); 69 void estimatedPercentScanned();
70 void appendDocpath(FileSystem*); 70 void appendDocpath(FileSystem*);
71 71
72 72
73 DocLnkSet dls; 73 DocLnkSet dls;
74 QDict<void> reference; 74 QDict<void> reference;
75 QDictIterator<void> *dit; 75 QDictIterator<void> *dit;
76 enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state; 76 enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state;
77 77
78 QStringList docPaths; 78 QStringList docPaths;
79 unsigned int docPathsSearched; 79 unsigned int docPathsSearched;
80 80
81 int searchDepth; 81 int searchDepth;
82 QDir *listDirs[MAX_SEARCH_DEPTH]; 82 QDir *listDirs[MAX_SEARCH_DEPTH];
83 const QFileInfoList *lists[MAX_SEARCH_DEPTH]; 83 const QFileInfoList *lists[MAX_SEARCH_DEPTH];
84 unsigned int listPositions[MAX_SEARCH_DEPTH]; 84 unsigned int listPositions[MAX_SEARCH_DEPTH];
85 85
86 StorageInfo *storage; 86 StorageInfo *storage;
87 87
88 int tid; 88 int tid;
89 89
90 ServerInterface *serverGui; 90 ServerInterface *serverGui;
91 91
92 bool needToSendAllDocLinks; 92 bool needToSendAllDocLinks;
93 bool sendAppLnks; 93 bool sendAppLnks;
94 bool sendDocLnks; 94 bool sendDocLnks;
95 bool scanDocs; 95 bool scanDocs;
96}; 96};
97 97
98 98
99/* 99/*
100 * scandocs will be read from Config 100 * scandocs will be read from Config
101 */ 101 */
102DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/, 102DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/,
103 QObject *parent, const char *name ) 103 QObject *parent, const char *name )
104 : QObject( parent, name ) 104 : QObject( parent, name )
105{ 105{
106 appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); 106 appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
107 d = new DocumentListPrivate( serverGui ); 107 d = new DocumentListPrivate( serverGui );
108 d->needToSendAllDocLinks = false; 108 d->needToSendAllDocLinks = false;
109 109
110 Config cfg( "Launcher" ); 110 Config cfg( "Launcher" );
111 cfg.setGroup( "DocTab" ); 111 cfg.setGroup( "DocTab" );
112 d->scanDocs = cfg.readBoolEntry( "Enable", true ); 112 d->scanDocs = cfg.readBoolEntry( "Enable", true );
113 odebug << "DocumentList::DocumentList() : scanDocs = " << d->scanDocs << "" << oendl; 113 odebug << "DocumentList::DocumentList() : scanDocs = " << d->scanDocs << "" << oendl;
114 114
115 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 115 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
116} 116}
117 117
118void DocumentList::startInitialScan() 118void DocumentList::startInitialScan()
119{ 119{
@@ -145,110 +145,114 @@ void DocumentList::pause()
145{ 145{
146 //odebug << "pause " << d->tid << "" << oendl; 146 //odebug << "pause " << d->tid << "" << oendl;
147 killTimer( d->tid ); 147 killTimer( d->tid );
148 d->tid = 0; 148 d->tid = 0;
149} 149}
150 150
151 151
152void DocumentList::resume() 152void DocumentList::resume()
153{ 153{
154 if ( d->tid == 0 ) { 154 if ( d->tid == 0 ) {
155 d->tid = startTimer( 20 ); 155 d->tid = startTimer( 20 );
156 //odebug << "resumed " << d->tid << "" << oendl; 156 //odebug << "resumed " << d->tid << "" << oendl;
157 } 157 }
158} 158}
159 159
160/* 160/*
161void DocumentList::resend() 161void DocumentList::resend()
162{ 162{
163 // Re-emits all the added items to the list (firstly letting everyone know to 163 // Re-emits all the added items to the list (firstly letting everyone know to
164 // clear what they have as it is being sent again) 164 // clear what they have as it is being sent again)
165 pause(); 165 pause();
166 emit allRemoved(); 166 emit allRemoved();
167 QTimer::singleShot( 5, this, SLOT( resendWorker() ) ); 167 QTimer::singleShot( 5, this, SLOT( resendWorker() ) );
168} 168}
169 169
170 170
171void DocumentList::resendWorker() 171void DocumentList::resendWorker()
172{ 172{
173 const QList<DocLnk> &list = d->dls.children(); 173 const QList<DocLnk> &list = d->dls.children();
174 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) 174 for ( QListIterator<DocLnk> it( list ); it.current(); ++it )
175 add( *(*it) ); 175 add( *(*it) );
176 resume(); 176 resume();
177} 177}
178*/ 178*/
179 179
180void DocumentList::rescan() 180void DocumentList::rescan()
181{ 181{
182 //odebug << "rescan" << oendl; 182 //odebug << "rescan" << oendl;
183 pause(); 183 pause();
184 d->initialize(); 184 d->initialize();
185 resume(); 185 resume();
186} 186}
187 187
188 188
189void DocumentList::timerEvent( QTimerEvent *te ) 189void DocumentList::timerEvent( QTimerEvent *te )
190{ 190{
191 if ( te->timerId() == d->tid ) { 191 if ( te->timerId() == d->tid ) {
192 // Do 3 at a time 192 // Do 3 at a time
193 if ( d->serverGui )
194 d->serverGui->aboutToAddBegin();
193 for (int i = 0; i < 3; i++ ) { 195 for (int i = 0; i < 3; i++ ) {
194 const DocLnk *lnk = d->iterate(); 196 const DocLnk *lnk = d->iterate();
195 if ( lnk ) { 197 if ( lnk ) {
196 add( *lnk ); 198 add( *lnk );
197 } else { 199 } else {
198 // stop when done 200 // stop when done
199 pause(); 201 pause();
200 if ( d->serverGui ) 202 if ( d->serverGui )
201 d->serverGui->documentScanningProgress( 100 ); 203 d->serverGui->documentScanningProgress( 100 );
202 if ( d->needToSendAllDocLinks ) 204 if ( d->needToSendAllDocLinks )
203 sendAllDocLinks(); 205 sendAllDocLinks();
204 break; 206 break;
205 } 207 }
206 } 208 }
209 if ( d->serverGui )
210 d->serverGui->aboutToAddEnd();
207 } 211 }
208} 212}
209 213
210 214
211void DocumentList::reloadAppLnks() 215void DocumentList::reloadAppLnks()
212{ 216{
213 if ( d->sendAppLnks && d->serverGui ) { 217 if ( d->sendAppLnks && d->serverGui ) {
214 d->serverGui->applicationScanningProgress( 0 ); 218 d->serverGui->applicationScanningProgress( 0 );
215 d->serverGui->allApplicationsRemoved(); 219 d->serverGui->allApplicationsRemoved();
216 } 220 }
217 221
218 delete appLnkSet; 222 delete appLnkSet;
219 appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); 223 appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
220 224
221 if ( d->sendAppLnks && d->serverGui ) { 225 if ( d->sendAppLnks && d->serverGui ) {
222 static QStringList prevTypeList; 226 static QStringList prevTypeList;
223 QStringList types = appLnkSet->types(); 227 QStringList types = appLnkSet->types();
224 for ( QStringList::Iterator ittypes=types.begin(); ittypes!=types.end(); ++ittypes) { 228 for ( QStringList::Iterator ittypes=types.begin(); ittypes!=types.end(); ++ittypes) {
225 if ( !(*ittypes).isEmpty() ) { 229 if ( !(*ittypes).isEmpty() ) {
226 if ( !prevTypeList.contains(*ittypes) ) { 230 if ( !prevTypeList.contains(*ittypes) ) {
227 QString name = appLnkSet->typeName(*ittypes); 231 QString name = appLnkSet->typeName(*ittypes);
228 QPixmap pm = appLnkSet->typePixmap(*ittypes); 232 QPixmap pm = appLnkSet->typePixmap(*ittypes);
229 QPixmap bgPm = appLnkSet->typeBigPixmap(*ittypes); 233 QPixmap bgPm = appLnkSet->typeBigPixmap(*ittypes);
230 234
231 if (pm.isNull()) { 235 if (pm.isNull()) {
232 QImage img( Resource::loadImage( "UnknownDocument" ) ); 236 QImage img( Resource::loadImage( "UnknownDocument" ) );
233 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 237 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
234 bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ); 238 bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() );
235 } 239 }
236 240
237 //odebug << "adding type " << (*ittypes) << "" << oendl; 241 //odebug << "adding type " << (*ittypes) << "" << oendl;
238 242
239 // ### our current launcher expects docs tab to be last 243 // ### our current launcher expects docs tab to be last
240 d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm ); 244 d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm );
241 } 245 }
242 prevTypeList.remove(*ittypes); 246 prevTypeList.remove(*ittypes);
243 } 247 }
244 } 248 }
245 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) { 249 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) {
246 //odebug << "removing type " << (*ittypes) << "" << oendl; 250 //odebug << "removing type " << (*ittypes) << "" << oendl;
247 d->serverGui->typeRemoved(*ittypes); 251 d->serverGui->typeRemoved(*ittypes);
248 } 252 }
249 prevTypeList = types; 253 prevTypeList = types;
250 } 254 }
251 255
252 QListIterator<AppLnk> itapp( appLnkSet->children() ); 256 QListIterator<AppLnk> itapp( appLnkSet->children() );
253 AppLnk* l; 257 AppLnk* l;
254 while ( (l=itapp.current()) ) { 258 while ( (l=itapp.current()) ) {
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index bf2287d..6afbcd8 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -651,96 +651,106 @@ void Launcher::typeAdded( const QString& type, const QString& name,
651 tabs->view( type )->setSortEnabled( FALSE ); 651 tabs->view( type )->setSortEnabled( FALSE );
652} 652}
653 653
654void Launcher::typeRemoved( const QString& type ) 654void Launcher::typeRemoved( const QString& type )
655{ 655{
656 tabs->view( type )->removeAllItems(); 656 tabs->view( type )->removeAllItems();
657 tabs->deleteView( type ); 657 tabs->deleteView( type );
658 ids.remove( type ); 658 ids.remove( type );
659 /* this will be called in applicationScanningProgress with value 100! */ 659 /* this will be called in applicationScanningProgress with value 100! */
660// tb->refreshStartMenu(); 660// tb->refreshStartMenu();
661} 661}
662 662
663void Launcher::applicationAdded( const QString& type, const AppLnk& app ) 663void Launcher::applicationAdded( const QString& type, const AppLnk& app )
664{ 664{
665 if ( app.type() == "Separator" ) // No tr 665 if ( app.type() == "Separator" ) // No tr
666 return; 666 return;
667 667
668 LauncherView *view = tabs->view( type ); 668 LauncherView *view = tabs->view( type );
669 if ( view ) 669 if ( view )
670 view->addItem( new AppLnk( app ), FALSE ); 670 view->addItem( new AppLnk( app ), FALSE );
671 else 671 else
672 qWarning("addAppLnk: No view for type %s. Can't add app %s!", 672 qWarning("addAppLnk: No view for type %s. Can't add app %s!",
673 type.latin1(),app.name().latin1() ); 673 type.latin1(),app.name().latin1() );
674 674
675 MimeType::registerApp( app ); 675 MimeType::registerApp( app );
676} 676}
677 677
678void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) 678void Launcher::applicationRemoved( const QString& type, const AppLnk& app )
679{ 679{
680 LauncherView *view = tabs->view( type ); 680 LauncherView *view = tabs->view( type );
681 if ( view ) 681 if ( view )
682 view->removeLink( app.linkFile() ); 682 view->removeLink( app.linkFile() );
683 else 683 else
684 owarn << "removeAppLnk: No view for " << type << "!" << oendl; 684 owarn << "removeAppLnk: No view for " << type << "!" << oendl;
685} 685}
686 686
687void Launcher::allApplicationsRemoved() 687void Launcher::allApplicationsRemoved()
688{ 688{
689 MimeType::clear(); 689 MimeType::clear();
690 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) 690 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it)
691 tabs->view( (*it) )->removeAllItems(); 691 tabs->view( (*it) )->removeAllItems();
692} 692}
693 693
694void Launcher::documentAdded( const DocLnk& doc ) 694void Launcher::documentAdded( const DocLnk& doc )
695{ 695{
696 tabs->docView()->addItem( new DocLnk( doc ), FALSE ); 696 tabs->docView()->addItem( new DocLnk( doc ), FALSE );
697} 697}
698 698
699void Launcher::aboutToAddBegin()
700{
701 tabs->docView()->setUpdatesEnabled( false );
702}
703
704void Launcher::aboutToAddEnd()
705{
706 tabs->docView()->setUpdatesEnabled( true );
707}
708
699void Launcher::showLoadingDocs() 709void Launcher::showLoadingDocs()
700{ 710{
701 tabs->docView()->hide(); 711 tabs->docView()->hide();
702} 712}
703 713
704void Launcher::showDocTab() 714void Launcher::showDocTab()
705{ 715{
706 if ( tabs->categoryBar->currentView() == tabs->docView() ) 716 if ( tabs->categoryBar->currentView() == tabs->docView() )
707 tabs->docView()->show(); 717 tabs->docView()->show();
708} 718}
709 719
710void Launcher::documentRemoved( const DocLnk& doc ) 720void Launcher::documentRemoved( const DocLnk& doc )
711{ 721{
712 tabs->docView()->removeLink( doc.linkFile() ); 722 tabs->docView()->removeLink( doc.linkFile() );
713} 723}
714 724
715void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) 725void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc )
716{ 726{
717 documentRemoved( oldDoc ); 727 documentRemoved( oldDoc );
718 documentAdded( newDoc ); 728 documentAdded( newDoc );
719} 729}
720 730
721void Launcher::allDocumentsRemoved() 731void Launcher::allDocumentsRemoved()
722{ 732{
723 tabs->docView()->removeAllItems(); 733 tabs->docView()->removeAllItems();
724} 734}
725 735
726void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) 736void Launcher::applicationStateChanged( const QString& name, ApplicationState state )
727{ 737{
728 tb->setApplicationState( name, state ); 738 tb->setApplicationState( name, state );
729} 739}
730 740
731void Launcher::applicationScanningProgress( int percent ) 741void Launcher::applicationScanningProgress( int percent )
732{ 742{
733 switch ( percent ) { 743 switch ( percent ) {
734 case 0: { 744 case 0: {
735 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 745 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
736 tabs->view( (*it) )->setUpdatesEnabled( FALSE ); 746 tabs->view( (*it) )->setUpdatesEnabled( FALSE );
737 tabs->view( (*it) )->setSortEnabled( FALSE ); 747 tabs->view( (*it) )->setSortEnabled( FALSE );
738 } 748 }
739 break; 749 break;
740 } 750 }
741 case 100: { 751 case 100: {
742 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 752 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
743 tabs->view( (*it) )->setUpdatesEnabled( TRUE ); 753 tabs->view( (*it) )->setUpdatesEnabled( TRUE );
744 tabs->view( (*it) )->setSortEnabled( TRUE ); 754 tabs->view( (*it) )->setSortEnabled( TRUE );
745 } 755 }
746 tb->refreshStartMenu(); 756 tb->refreshStartMenu();
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index 4f3ff8c..29bd7db 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -65,93 +65,95 @@ public:
65 65
66signals: 66signals:
67 void selected(const QString&); 67 void selected(const QString&);
68 void clicked(const AppLnk*); 68 void clicked(const AppLnk*);
69 void rightPressed(AppLnk*); 69 void rightPressed(AppLnk*);
70 70
71protected slots: 71protected slots:
72 void raiseTabWidget(); 72 void raiseTabWidget();
73 void tabProperties(); 73 void tabProperties();
74 void initLayout(); 74 void initLayout();
75 75
76private slots: 76private slots:
77 void launcherMessage( const QCString &, const QByteArray &); 77 void launcherMessage( const QCString &, const QByteArray &);
78 void appMessage( const QCString &, const QByteArray &); 78 void appMessage( const QCString &, const QByteArray &);
79 void setProgressStyle(); 79 void setProgressStyle();
80 80
81protected: 81protected:
82 void paletteChange( const QPalette &p ); 82 void paletteChange( const QPalette &p );
83 void styleChange( QStyle & ); 83 void styleChange( QStyle & );
84 84
85private: 85private:
86 Launcher *launcher; 86 Launcher *launcher;
87 LauncherView *docview; 87 LauncherView *docview;
88 88
89 QWidgetStack *stack; 89 QWidgetStack *stack;
90 LauncherView *docLoadingWidget; 90 LauncherView *docLoadingWidget;
91 QProgressBar *docLoadingWidgetProgress; 91 QProgressBar *docLoadingWidgetProgress;
92 bool docLoadingWidgetEnabled; 92 bool docLoadingWidgetEnabled;
93}; 93};
94 94
95class Launcher : public QMainWindow, public ServerInterface 95class Launcher : public QMainWindow, public ServerInterface
96{ 96{
97 Q_OBJECT 97 Q_OBJECT
98public: 98public:
99 Launcher(); 99 Launcher();
100 ~Launcher(); 100 ~Launcher();
101 101
102 // implementing ServerInterface 102 // implementing ServerInterface
103 void createGUI(); 103 void createGUI();
104 void destroyGUI(); 104 void destroyGUI();
105 void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ); 105 void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap );
106 void typeRemoved( const QString& type ); 106 void typeRemoved( const QString& type );
107 void applicationAdded( const QString& type, const AppLnk& doc ); 107 void applicationAdded( const QString& type, const AppLnk& doc );
108 void applicationRemoved( const QString& type, const AppLnk& doc ); 108 void applicationRemoved( const QString& type, const AppLnk& doc );
109 void allApplicationsRemoved(); 109 void allApplicationsRemoved();
110 void applicationStateChanged( const QString& name, ApplicationState state ); 110 void applicationStateChanged( const QString& name, ApplicationState state );
111 void documentAdded( const DocLnk& doc ); 111 void documentAdded( const DocLnk& doc );
112 void documentRemoved( const DocLnk& doc ); 112 void documentRemoved( const DocLnk& doc );
113 void aboutToAddBegin();
114 void aboutToAddEnd();
113 void allDocumentsRemoved(); 115 void allDocumentsRemoved();
114 void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ); 116 void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc );
115 void storageChanged( const QList<FileSystem> & ); 117 void storageChanged( const QList<FileSystem> & );
116 void applicationScanningProgress( int percent ); 118 void applicationScanningProgress( int percent );
117 void documentScanningProgress( int percent ); 119 void documentScanningProgress( int percent );
118 bool requiresApplications() const { return TRUE; } 120 bool requiresApplications() const { return TRUE; }
119 bool requiresDocuments() const; 121 bool requiresDocuments() const;
120 void showLoadingDocs(); 122 void showLoadingDocs();
121 void showDocTab(); 123 void showDocTab();
122 124
123 QStringList idList() const { return ids; } 125 QStringList idList() const { return ids; }
124 126
125public slots: 127public slots:
126 void viewSelected(const QString&); 128 void viewSelected(const QString&);
127 void showTab(const QString&); 129 void showTab(const QString&);
128 void select( const AppLnk * ); 130 void select( const AppLnk * );
129 void properties( AppLnk * ); 131 void properties( AppLnk * );
130 void makeVisible(); 132 void makeVisible();
131 133
132signals: 134signals:
133 void executing( const AppLnk * ); 135 void executing( const AppLnk * );
134 136
135private slots: 137private slots:
136 void systemMessage( const QCString &, const QByteArray &); 138 void systemMessage( const QCString &, const QByteArray &);
137 void toggleSymbolInput(); 139 void toggleSymbolInput();
138 void toggleNumLockState(); 140 void toggleNumLockState();
139 void toggleCapsLockState(); 141 void toggleCapsLockState();
140 142
141protected: 143protected:
142 bool eventFilter( QObject *o, QEvent *ev ); 144 bool eventFilter( QObject *o, QEvent *ev );
143 145
144private: 146private:
145 void updateApps(); 147 void updateApps();
146 void loadDocs(); 148 void loadDocs();
147 void updateDocs(); 149 void updateDocs();
148 void updateTabs(); 150 void updateTabs();
149 151
150 LauncherTabWidget *tabs; 152 LauncherTabWidget *tabs;
151 QStringList ids; 153 QStringList ids;
152 TaskBar *tb; 154 TaskBar *tb;
153 155
154 bool docTabEnabled; 156 bool docTabEnabled;
155}; 157};
156 158
157#endif // LAUNCHERVIEW_H 159#endif // LAUNCHERVIEW_H
diff --git a/core/launcher/serverinterface.h b/core/launcher/serverinterface.h
index e57ea51..132766f 100644
--- a/core/launcher/serverinterface.h
+++ b/core/launcher/serverinterface.h
@@ -5,68 +5,70 @@
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#ifndef SERVER_INTERFACE_H 20#ifndef SERVER_INTERFACE_H
21#define SERVER_INTERFACE_H 21#define SERVER_INTERFACE_H
22 22
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qpixmap.h> 25#include <qpixmap.h>
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qtopia/applnk.h> 27#include <qtopia/applnk.h>
28#include <qtopia/storage.h> 28#include <qtopia/storage.h>
29 29
30 30
31class ServerInterface { 31class ServerInterface {
32public: 32public:
33 virtual ~ServerInterface(); 33 virtual ~ServerInterface();
34 34
35 virtual void createGUI() = 0; 35 virtual void createGUI() = 0;
36 virtual void destroyGUI() = 0; 36 virtual void destroyGUI() = 0;
37 37
38 // These notify of the application categories, like what is used in the current launcher tabs, 38 // These notify of the application categories, like what is used in the current launcher tabs,
39 // for example "Applications", "Games" etc. 39 // for example "Applications", "Games" etc.
40 virtual void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ) = 0; 40 virtual void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ) = 0;
41 virtual void typeRemoved( const QString& type ) = 0; 41 virtual void typeRemoved( const QString& type ) = 0;
42 42
43 // These functions notify when an application is added or removed and to which category it belongs 43 // These functions notify when an application is added or removed and to which category it belongs
44 virtual void applicationAdded( const QString& type, const AppLnk& doc ) = 0; 44 virtual void applicationAdded( const QString& type, const AppLnk& doc ) = 0;
45 virtual void applicationRemoved( const QString& type, const AppLnk& doc ) = 0; 45 virtual void applicationRemoved( const QString& type, const AppLnk& doc ) = 0;
46 virtual void allApplicationsRemoved() = 0; 46 virtual void allApplicationsRemoved() = 0;
47 // Useful for wait icons, or running application lists etc 47 // Useful for wait icons, or running application lists etc
48 enum ApplicationState { Launching, Running, Terminated }; 48 enum ApplicationState { Launching, Running, Terminated };
49 virtual void applicationStateChanged( const QString& name, ApplicationState state ) = 0; 49 virtual void applicationStateChanged( const QString& name, ApplicationState state ) = 0;
50 static const AppLnkSet& appLnks(); 50 static const AppLnkSet& appLnks();
51 51
52 // These functions notify of adding, removal and changes of document links used in the documents tab for example 52 // These functions notify of adding, removal and changes of document links used in the documents tab for example
53 virtual void aboutToAddBegin() {}
54 virtual void aboutToAddEnd() {}
53 virtual void documentAdded( const DocLnk& doc ) = 0; 55 virtual void documentAdded( const DocLnk& doc ) = 0;
54 virtual void documentRemoved( const DocLnk& doc ) = 0; 56 virtual void documentRemoved( const DocLnk& doc ) = 0;
55 virtual void allDocumentsRemoved() = 0; 57 virtual void allDocumentsRemoved() = 0;
56 virtual void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) = 0; 58 virtual void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) = 0;
57 59
58 virtual void storageChanged( const QList<FileSystem> & ) = 0; 60 virtual void storageChanged( const QList<FileSystem> & ) = 0;
59 61
60 virtual void applicationScanningProgress( int percent ) = 0; 62 virtual void applicationScanningProgress( int percent ) = 0;
61 virtual void documentScanningProgress( int percent ) = 0; 63 virtual void documentScanningProgress( int percent ) = 0;
62 64
63 // Tells the server if the GUI needs to be updated about documents or applnks 65 // Tells the server if the GUI needs to be updated about documents or applnks
64 virtual bool requiresApplications() const = 0; 66 virtual bool requiresApplications() const = 0;
65 virtual bool requiresDocuments() const = 0; 67 virtual bool requiresDocuments() const = 0;
66 68
67 enum DockArea { Top, Bottom, Left, Right }; 69 enum DockArea { Top, Bottom, Left, Right };
68 static void dockWidget( QWidget *w, DockArea placement ); 70 static void dockWidget( QWidget *w, DockArea placement );
69}; 71};
70 72
71 73
72#endif // SERVER_INTERFACE_H 74#endif // SERVER_INTERFACE_H