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