-rw-r--r-- | libopie2/opiecore/oglobal.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index d09d73e..5b43f01 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h | |||
@@ -1,49 +1,48 @@ | |||
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 | =. | ||
6 | .=l. | 5 | .=l. |
7 | .>+-= | 6 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 13 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 21 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
29 | */ | 28 | */ |
30 | 29 | ||
31 | #ifndef OGLOBAL_H | 30 | #ifndef OGLOBAL_H |
32 | #define OGLOBAL_H | 31 | #define OGLOBAL_H |
33 | 32 | ||
34 | 33 | ||
35 | #include <opie2/oconfig.h> | 34 | #include <opie2/oconfig.h> |
36 | 35 | ||
37 | #ifndef private | 36 | #ifndef private |
38 | #define HACK_DEFINED | 37 | #define HACK_DEFINED |
39 | #define private protected | 38 | #define private protected |
40 | #endif | 39 | #endif |
41 | #include <qpe/global.h> | 40 | #include <qpe/global.h> |
42 | #ifdef HACK_DEFINED | 41 | #ifdef HACK_DEFINED |
43 | #undef private | 42 | #undef private |
44 | #endif | 43 | #endif |
45 | 44 | ||
46 | #include <sys/types.h> | 45 | #include <sys/types.h> |
47 | 46 | ||
48 | //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? |
49 | // once we totally skip libqpe it should ideally swallow Global -zecke | 48 | // once we totally skip libqpe it should ideally swallow Global -zecke |
@@ -87,54 +86,56 @@ public: | |||
87 | static QString tempFileName( const QString& ); | 86 | static QString tempFileName( const QString& ); |
88 | static bool renameFile( const QString& from, const QString& to ); | 87 | static bool renameFile( const QString& from, const QString& to ); |
89 | static bool truncateFile( QFile &f, off_t size ); | 88 | static bool truncateFile( QFile &f, off_t size ); |
90 | //@} | 89 | //@} |
91 | 90 | ||
92 | 91 | ||
93 | static QString generateUuid(); | 92 | static QString generateUuid(); |
94 | 93 | ||
95 | /** @name Convert Content | 94 | /** @name Convert Content |
96 | * Convert Content of a QByteArray | 95 | * Convert Content of a QByteArray |
97 | */ | 96 | */ |
98 | //@{ | 97 | //@{ |
99 | static QByteArray encodeBase64(const QByteArray&, bool insertLF = false ); | 98 | static QByteArray encodeBase64(const QByteArray&, bool insertLF = false ); |
100 | static QByteArray decodeBase64(const QByteArray& ); | 99 | static QByteArray decodeBase64(const QByteArray& ); |
101 | //@} | 100 | //@} |
102 | 101 | ||
103 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke | 102 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke |
104 | // We already have a per-application config in OApplication | 103 | // We already have a per-application config in OApplication |
105 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl | 104 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl |
106 | /** @name Config and Owner related Information | 105 | /** @name Config and Owner related Information |
107 | * | 106 | * |
108 | */ | 107 | */ |
109 | //@{ | 108 | //@{ |
110 | static OConfig* config(); | 109 | static OConfig* config(); |
110 | static OConfig* qpe_config(); | ||
111 | static QString ownerName(); | 111 | static QString ownerName(); |
112 | static bool weekStartsOnMonday(); | 112 | static bool weekStartsOnMonday(); |
113 | static bool useAMPM(); | 113 | static bool useAMPM(); |
114 | #ifdef ODP | 114 | #ifdef ODP |
115 | #error "Fix dateFormat" | 115 | #error "Fix dateFormat" |
116 | /** | 116 | /** |
117 | * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat) | 117 | * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat) |
118 | * See if we need to use the function with String in it | 118 | * See if we need to use the function with String in it |
119 | * Anyway this is the future | 119 | * Anyway this is the future |
120 | * for now still use TimeString! | 120 | * for now still use TimeString! |
121 | */ | 121 | */ |
122 | #endif | 122 | #endif |
123 | static DateFormat dateFormat(); | 123 | static DateFormat dateFormat(); |
124 | static void setDateFormat( const DateFormat& ); | 124 | static void setDateFormat( const DateFormat& ); |
125 | 125 | ||
126 | 126 | ||
127 | static void setWeekStartsOnMonday( bool ); | 127 | static void setWeekStartsOnMonday( bool ); |
128 | static void setUseAMPM( bool ); | 128 | static void setUseAMPM( bool ); |
129 | //@} | 129 | //@} |
130 | 130 | ||
131 | //@{ | 131 | //@{ |
132 | static Global::Command* builtinCommands(); | 132 | static Global::Command* builtinCommands(); |
133 | static QGuardedPtr<QWidget>* builtinRunning(); | 133 | static QGuardedPtr<QWidget>* builtinRunning(); |
134 | //@} | 134 | //@} |
135 | 135 | ||
136 | private: | 136 | private: |
137 | static OConfig* _config; | 137 | static OConfig* _config; |
138 | static OConfig* _qpe_config; | ||
138 | }; | 139 | }; |
139 | 140 | ||
140 | #endif // OGLOBAL_H | 141 | #endif // OGLOBAL_H |