global.h
00001 /********************************************************************** 00002 ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of the Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 #ifndef GLOBAL_H 00021 #define GLOBAL_H 00022 00023 #include <qstringlist.h> 00024 #include <qguardedptr.h> 00025 class QDawg; 00026 class QLabel; 00027 class QWidget; 00028 class AppLnk; 00029 class DocLnkSet; 00030 00031 class Global 00032 { 00033 public: 00034 Global(); 00035 00036 // Dictionaries 00037 static const QDawg& fixedDawg(); 00038 static const QDawg& addedDawg(); 00039 static const QDawg& dawg(const QString& name); 00040 00041 static void addWords(const QStringList& word); 00042 static void addWords(const QString& dictname, const QStringList& word); 00043 // static void removeWords(const QStringList& word); -- if someone wants it 00044 00045 static void createDocDir(); 00046 00047 static void findDocuments(DocLnkSet* folder, const QString &mimefilter=QString::null); 00048 00049 static QString applicationFileName(const QString& appname, const QString& filename); 00050 00051 struct Command { 00052 const char *file; 00053 QWidget *(*func)( bool ); 00054 bool maximized; 00055 bool documentary; 00056 }; 00057 static void setBuiltinCommands( Command* ); 00058 00059 static void execute( const QString &exec, const QString &document=QString::null ); 00060 static void setDocument( QWidget* receiver, const QString& document ); 00061 static bool terminateBuiltin( const QString& ); 00062 static void terminate( const AppLnk* ); 00063 00064 static bool isBuiltinCommand( const QString &name ); 00065 00066 // system messaging 00067 static void applyStyle(); 00068 static void statusMessage(const QString&); 00069 static QWidget *shutdown( bool = FALSE ); 00070 static QWidget *restart( bool = FALSE ); 00071 static void hideInputMethod(); 00072 static void showInputMethod(); 00073 00074 static void writeHWClock(); 00075 00076 static QString shellQuote(const QString& s); 00077 static QString stringQuote(const QString& s); 00078 00079 #ifdef QTOPIA_INTERNAL_LANGLIST 00080 static QStringList languageList(); 00081 static QStringList helpPath(); 00082 #endif 00083 00084 private: 00085 static void invoke( const QString &exec); 00086 static Command* builtin; 00087 static QGuardedPtr<QWidget> *running; 00088 }; 00089 00090 #endif
