summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oglobal.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/oglobal.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oglobal.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h
index aeee75e..e6a6c46 100644
--- a/libopie2/opiecore/oglobal.h
+++ b/libopie2/opiecore/oglobal.h
@@ -7,145 +7,153 @@
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
52class QFile; 52class QFile;
53class QString; 53class QString;
54class DateFormat; 54class DateFormat;
55
56
57
58namespace Opie {
59namespace Core {
55/** 60/**
56 *\brief OGlobal contains a list of generic functions 61 *\brief OGlobal contains a list of generic functions
57 * 62 *
58 * The class OGlobal contains small utility functions 63 * The class OGlobal contains small utility functions
59 * 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
60 * to the global device config and specialized functions to get information 65 * to the global device config and specialized functions to get information
61 * out of this config like Weekstart or Owner name. 66 * out of this config like Weekstart or Owner name.
62 * 67 *
63 * @todo ODP implement the things from Global which are good 68 * @todo ODP implement the things from Global which are good
64 * @author mickey,alwin,zecke 69 * @author mickey,alwin,zecke
65 * @version 0.1 70 * @version 0.1
66 */ 71 */
67class OGlobal : public Global 72class OGlobal : public Global
68{ 73{
69public: 74public:
70 75
71 // how do they relate to our Document Idea 76 // how do they relate to our Document Idea
72 /** @name Document System related functions 77 /** @name Document System related functions
73 * 78 *
74 */ 79 */
75 //@{ 80 //@{
76 static bool isAppLnkFileName( const QString& str ); 81 static bool isAppLnkFileName( const QString& str );
77 static bool isDocumentFileName( const QString& file ); 82 static bool isDocumentFileName( const QString& file );
78 //@} 83 //@}
79 84
80 /** @name File Operations 85 /** @name File Operations
81 * File operations provided by OGlobal 86 * File operations provided by OGlobal
82 */ 87 */
83 //@{ 88 //@{
84 /** the content of TEMP 89 /** the content of TEMP
85 * reads the environment variable TEMP and returns the content. 90 * reads the environment variable TEMP and returns the content.
86 * if not set returns "/tmp" 91 * if not set returns "/tmp"
87 * @return a string containing a dir without trailing slash! 92 * @return a string containing a dir without trailing slash!
88 */ 93 */
89 static QString tempDirPath(); 94 static QString tempDirPath();
90 /** the content of HOME 95 /** the content of HOME
91 * reads the environment variable HOME and returns the content. 96 * reads the environment variable HOME and returns the content.
92 * if not set returns "/" 97 * if not set returns "/"
93 * @return a string containing a dir without trailing slash! 98 * @return a string containing a dir without trailing slash!
94 */ 99 */
95 static QString homeDirPath(); 100 static QString homeDirPath();
96 static QString tempFileName( const QString& ); 101 static QString tempFileName( const QString& );
97 static bool renameFile( const QString& from, const QString& to ); 102 static bool renameFile( const QString& from, const QString& to );
98 static bool truncateFile( QFile &f, off_t size ); 103 static bool truncateFile( QFile &f, off_t size );
99 //@} 104 //@}
100 105
101 106
102 static QString generateUuid(); 107 static QString generateUuid();
103 108
104 /** @name Convert Content 109 /** @name Convert Content
105 * Convert Content of a QByteArray 110 * Convert Content of a QByteArray
106 */ 111 */
107 //@{ 112 //@{
108 static QByteArray encodeBase64(const QByteArray&, bool insertLF = false ); 113 static QByteArray encodeBase64(const QByteArray&, bool insertLF = false );
109 static QByteArray decodeBase64(const QByteArray& ); 114 static QByteArray decodeBase64(const QByteArray& );
110 //@} 115 //@}
111 116
112 //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
113 // We already have a per-application config in OApplication 118 // We already have a per-application config in OApplication
114 // ( 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
115 /** @name Config and Owner related Information 120 /** @name Config and Owner related Information
116 * 121 *
117 */ 122 */
118 //@{ 123 //@{
119 static OConfig* config(); 124 static OConfig* config();
120 static OConfig* qpe_config(); 125 static OConfig* qpe_config();
121 static QString ownerName(); 126 static QString ownerName();
122 static bool weekStartsOnMonday(); 127 static bool weekStartsOnMonday();
123 static bool useAMPM(); 128 static bool useAMPM();
124#ifdef ODP 129#ifdef ODP
125#error "Fix dateFormat" 130#error "Fix dateFormat"
126 /** 131 /**
127 * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat) 132 * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat)
128 * 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
129 * Anyway this is the future 134 * Anyway this is the future
130 * for now still use TimeString! 135 * for now still use TimeString!
131 */ 136 */
132#endif 137#endif
133 static DateFormat dateFormat(); 138 static DateFormat dateFormat();
134 static void setDateFormat( const DateFormat& ); 139 static void setDateFormat( const DateFormat& );
135 140
136 141
137 static void setWeekStartsOnMonday( bool ); 142 static void setWeekStartsOnMonday( bool );
138 static void setUseAMPM( bool ); 143 static void setUseAMPM( bool );
139 //@} 144 //@}
140 145
141 //@{ 146 //@{
142 static Global::Command* builtinCommands(); 147 static Global::Command* builtinCommands();
143 static QGuardedPtr<QWidget>* builtinRunning(); 148 static QGuardedPtr<QWidget>* builtinRunning();
144 //@} 149 //@}
145 150
146private: 151private:
147 static OConfig* _config; 152 static OConfig* _config;
148 static OConfig* _qpe_config; 153 static OConfig* _qpe_config;
154 class Private;
155 Private *d;
149}; 156};
150 157}
158}
151#endif // OGLOBAL_H 159#endif // OGLOBAL_H