author | zecke <zecke> | 2004-04-04 23:14:28 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-04 23:14:28 (UTC) |
commit | 76a3fc46db5f097262d3cda9df49d757e96e660c (patch) (unidiff) | |
tree | e9f255a0561809e40626a9576bb77a6f86622b09 /libopie2/opiecore/oglobal.h | |
parent | 4068b42526afa8da95f1299c7f8f5f10081ae4b0 (diff) | |
download | opie-76a3fc46db5f097262d3cda9df49d757e96e660c.zip opie-76a3fc46db5f097262d3cda9df49d757e96e660c.tar.gz opie-76a3fc46db5f097262d3cda9df49d757e96e660c.tar.bz2 |
Add Postroutines which seem to not work...
Create a Debug Backend on first invocation. Sad thing is we still need
to get reconfiguration of the settings.. OpieConfigXT is needed
-rw-r--r-- | libopie2/opiecore/oglobal.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index e6a6c46..d79a218 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h | |||
@@ -1,159 +1,160 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> | 3 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> |
4 | =. Copyright (C) 2004 Holger 'zecke' Freyther <zecke@handhelds.org> | 4 | =. Copyright (C) 2004 Holger 'zecke' Freyther <zecke@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef OGLOBAL_H | 30 | #ifndef OGLOBAL_H |
31 | #define OGLOBAL_H | 31 | #define OGLOBAL_H |
32 | 32 | ||
33 | 33 | ||
34 | #include <opie2/oconfig.h> | 34 | #include <opie2/oconfig.h> |
35 | 35 | ||
36 | #ifndef private | 36 | #ifndef private |
37 | #define HACK_DEFINED | 37 | #define HACK_DEFINED |
38 | #define private protected | 38 | #define private protected |
39 | #endif | 39 | #endif |
40 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
41 | #ifdef HACK_DEFINED | 41 | #ifdef HACK_DEFINED |
42 | #undef private | 42 | #undef private |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | #include <sys/types.h> | 45 | #include <sys/types.h> |
46 | 46 | ||
47 | //FIXME Is it wise or even necessary to inherit OGlobal from Global? | 47 | //FIXME Is it wise or even necessary to inherit OGlobal from Global? |
48 | // once we totally skip libqpe it should ideally swallow Global -zecke | 48 | // once we totally skip libqpe it should ideally swallow Global -zecke |
49 | // You're right. I deleted global as the base class. -mickeyl | 49 | // You're right. I deleted global as the base class. -mickeyl |
50 | 50 | ||
51 | 51 | ||
52 | class QFile; | 52 | class QFile; |
53 | class QString; | 53 | class QString; |
54 | class DateFormat; | 54 | class DateFormat; |
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | namespace Opie { | 58 | namespace Opie { |
59 | namespace Core { | 59 | namespace Core { |
60 | /** | 60 | /** |
61 | *\brief OGlobal contains a list of generic functions | 61 | *\brief OGlobal contains a list of generic functions |
62 | * | 62 | * |
63 | * The class OGlobal contains small utility functions | 63 | * The class OGlobal contains small utility functions |
64 | * which might be useful for other applications to use. It features access | 64 | * which might be useful for other applications to use. It features access |
65 | * to the global device config and specialized functions to get information | 65 | * to the global device config and specialized functions to get information |
66 | * out of this config like Weekstart or Owner name. | 66 | * out of this config like Weekstart or Owner name. |
67 | * | 67 | * |
68 | * @todo ODP implement the things from Global which are good | 68 | * @todo ODP implement the things from Global which are good |
69 | * @author mickey,alwin,zecke | 69 | * @author mickey,alwin,zecke |
70 | * @version 0.1 | 70 | * @version 0.1 |
71 | */ | 71 | */ |
72 | class OGlobal : public Global | 72 | class OGlobal : public Global |
73 | { | 73 | { |
74 | public: | 74 | public: |
75 | 75 | ||
76 | // how do they relate to our Document Idea | 76 | // how do they relate to our Document Idea |
77 | /** @name Document System related functions | 77 | /** @name Document System related functions |
78 | * | 78 | * |
79 | */ | 79 | */ |
80 | //@{ | 80 | //@{ |
81 | static bool isAppLnkFileName( const QString& str ); | 81 | static bool isAppLnkFileName( const QString& str ); |
82 | static bool isDocumentFileName( const QString& file ); | 82 | static bool isDocumentFileName( const QString& file ); |
83 | //@} | 83 | //@} |
84 | 84 | ||
85 | /** @name File Operations | 85 | /** @name File Operations |
86 | * File operations provided by OGlobal | 86 | * File operations provided by OGlobal |
87 | */ | 87 | */ |
88 | //@{ | 88 | //@{ |
89 | /** the content of TEMP | 89 | /** the content of TEMP |
90 | * reads the environment variable TEMP and returns the content. | 90 | * reads the environment variable TEMP and returns the content. |
91 | * if not set returns "/tmp" | 91 | * if not set returns "/tmp" |
92 | * @return a string containing a dir without trailing slash! | 92 | * @return a string containing a dir without trailing slash! |
93 | */ | 93 | */ |
94 | static QString tempDirPath(); | 94 | static QString tempDirPath(); |
95 | /** the content of HOME | 95 | /** the content of HOME |
96 | * reads the environment variable HOME and returns the content. | 96 | * reads the environment variable HOME and returns the content. |
97 | * if not set returns "/" | 97 | * if not set returns "/" |
98 | * @return a string containing a dir without trailing slash! | 98 | * @return a string containing a dir without trailing slash! |
99 | */ | 99 | */ |
100 | static QString homeDirPath(); | 100 | static QString homeDirPath(); |
101 | static QString tempFileName( const QString& ); | 101 | static QString tempFileName( const QString& ); |
102 | static bool renameFile( const QString& from, const QString& to ); | 102 | static bool renameFile( const QString& from, const QString& to ); |
103 | static bool truncateFile( QFile &f, off_t size ); | 103 | static bool truncateFile( QFile &f, off_t size ); |
104 | //@} | 104 | //@} |
105 | 105 | ||
106 | 106 | ||
107 | static QString generateUuid(); | 107 | static QString generateUuid(); |
108 | 108 | ||
109 | /** @name Convert Content | 109 | /** @name Convert Content |
110 | * Convert Content of a QByteArray | 110 | * Convert Content of a QByteArray |
111 | */ | 111 | */ |
112 | //@{ | 112 | //@{ |
113 | static QByteArray encodeBase64(const QByteArray&, bool insertLF = false ); | 113 | static QByteArray encodeBase64(const QByteArray&, bool insertLF = false ); |
114 | static QByteArray decodeBase64(const QByteArray& ); | 114 | static QByteArray decodeBase64(const QByteArray& ); |
115 | //@} | 115 | //@} |
116 | 116 | ||
117 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke | 117 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke |
118 | // We already have a per-application config in OApplication | 118 | // We already have a per-application config in OApplication |
119 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl | 119 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl |
120 | /** @name Config and Owner related Information | 120 | /** @name Config and Owner related Information |
121 | * | 121 | * |
122 | */ | 122 | */ |
123 | //@{ | 123 | //@{ |
124 | static OConfig* config(); | 124 | static OConfig* config(); |
125 | static OConfig* qpe_config(); | 125 | static OConfig* qpe_config(); |
126 | static QString ownerName(); | 126 | static QString ownerName(); |
127 | static bool weekStartsOnMonday(); | 127 | static bool weekStartsOnMonday(); |
128 | static bool useAMPM(); | 128 | static bool useAMPM(); |
129 | #ifdef ODP | 129 | #ifdef ODP |
130 | #error "Fix dateFormat" | 130 | #error "Fix dateFormat" |
131 | /** | 131 | /** |
132 | * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat) | 132 | * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat) |
133 | * See if we need to use the function with String in it | 133 | * See if we need to use the function with String in it |
134 | * Anyway this is the future | 134 | * Anyway this is the future |
135 | * for now still use TimeString! | 135 | * for now still use TimeString! |
136 | */ | 136 | */ |
137 | #endif | 137 | #endif |
138 | static DateFormat dateFormat(); | 138 | static DateFormat dateFormat(); |
139 | static void setDateFormat( const DateFormat& ); | 139 | static void setDateFormat( const DateFormat& ); |
140 | 140 | ||
141 | 141 | ||
142 | static void setWeekStartsOnMonday( bool ); | 142 | static void setWeekStartsOnMonday( bool ); |
143 | static void setUseAMPM( bool ); | 143 | static void setUseAMPM( bool ); |
144 | //@} | 144 | //@} |
145 | 145 | ||
146 | //@{ | 146 | //@{ |
147 | static Global::Command* builtinCommands(); | 147 | static Global::Command* builtinCommands(); |
148 | static QGuardedPtr<QWidget>* builtinRunning(); | 148 | static QGuardedPtr<QWidget>* builtinRunning(); |
149 | //@} | 149 | //@} |
150 | 150 | ||
151 | private: | 151 | private: |
152 | static void clean_up(); | ||
152 | static OConfig* _config; | 153 | static OConfig* _config; |
153 | static OConfig* _qpe_config; | 154 | static OConfig* _qpe_config; |
154 | class Private; | 155 | class Private; |
155 | Private *d; | 156 | Private *d; |
156 | }; | 157 | }; |
157 | } | 158 | } |
158 | } | 159 | } |
159 | #endif // OGLOBAL_H | 160 | #endif // OGLOBAL_H |