author | zecke <zecke> | 2004-02-20 14:01:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-20 14:01:52 (UTC) |
commit | 7d53a7812716011023e3d1242d0503f4fcaadc26 (patch) (unidiff) | |
tree | d0d905332a766ab11d78e58ed8c27ed28cc126f4 /libopie2 | |
parent | 132f53a7c9cdc3e14a040558f80bb45ceb3ca9b5 (diff) | |
download | opie-7d53a7812716011023e3d1242d0503f4fcaadc26.zip opie-7d53a7812716011023e3d1242d0503f4fcaadc26.tar.gz opie-7d53a7812716011023e3d1242d0503f4fcaadc26.tar.bz2 |
some more global functions for ODP
Alwin will do a clean room implementation on most of the content
-rw-r--r-- | libopie2/opiecore/oglobal.h | 77 |
1 files changed, 75 insertions, 2 deletions
diff --git a/libopie2/opiecore/oglobal.h b/libopie2/opiecore/oglobal.h index 2dc4f9e..012f240 100644 --- a/libopie2/opiecore/oglobal.h +++ b/libopie2/opiecore/oglobal.h | |||
@@ -21,29 +21,102 @@ | |||
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 | #include <qpe/global.h> | ||
34 | #include <qpe/timestring.h> | ||
35 | |||
33 | #include <opie2/oconfig.h> | 36 | #include <opie2/oconfig.h> |
37 | #include <static.h> | ||
34 | 38 | ||
35 | //FIXME Is it wise or even necessary to inherit OGlobal from Global? | 39 | //FIXME Is it wise or even necessary to inherit OGlobal from Global? |
36 | // once we totally skip libqpe it should ideally swallow Global -zecke | 40 | // once we totally skip libqpe it should ideally swallow Global -zecke |
37 | // You're right. I deleted global as the base class. -mickeyl | 41 | // You're right. I deleted global as the base class. -mickeyl |
38 | 42 | ||
39 | class OGlobal | 43 | |
44 | class QFile; | ||
45 | class QString; | ||
46 | /** | ||
47 | *\brief OGlobal contains a list of generic functions | ||
48 | * | ||
49 | * The class OGlobal contains small utility functions | ||
50 | * which might be useful for other applications to use. It features access | ||
51 | * to the global device config and specialized functions to get information | ||
52 | * out of this config like Weekstart or Owner name. | ||
53 | * | ||
54 | * @todo ODP implement the things from Global which are good | ||
55 | */ | ||
56 | class OGlobal : public Global | ||
40 | { | 57 | { |
41 | public: | 58 | public: |
59 | |||
60 | // how do they relate to our Document Idea | ||
61 | /** @name Document System related functions | ||
62 | * | ||
63 | */ | ||
64 | //@{ | ||
65 | static bool isAppLnkFileName( const QString& str ); | ||
66 | static bool isDocumentFileName( const QString& file ); | ||
67 | //@} | ||
68 | |||
69 | /** @name File Operations | ||
70 | * File operations provided by OGlobal | ||
71 | */ | ||
72 | //@{ | ||
73 | static QString tempDirPath(); | ||
74 | static QString homeDirPath(); | ||
75 | static QString tempFileName( const QString& ); | ||
76 | static bool renameFile( const QString& from, const QString& to ); | ||
77 | static bool truncateFile( QFile &f, off_t size ); | ||
78 | //@} | ||
79 | |||
80 | |||
81 | static QString generateUuid(); | ||
82 | |||
83 | /** @name Convert Content | ||
84 | * Convert Content of a QByteArray | ||
85 | */ | ||
86 | //@{ | ||
87 | static QByteArray encodeBase64(const QByteArray& ); | ||
88 | static QByteArray decodeBase64(const QByteArray& ); | ||
89 | //@} | ||
90 | |||
42 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke | 91 | //FIXME Do we want to put that into OApplication as in KApplication? -zecke |
43 | // We already have a per-application config in OApplication | 92 | // We already have a per-application config in OApplication |
44 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl | 93 | // ( accessed through oApp->config() ), but this one is the global one! -mickeyl |
94 | /** @name Config and Owner related Information | ||
95 | * | ||
96 | */ | ||
97 | //@{ | ||
45 | static OConfig* config(); | 98 | static OConfig* config(); |
99 | static QString ownerName(); | ||
100 | static bool weekStartsOnMonday(); | ||
101 | static bool useAMPM(); | ||
102 | #ifdef ODP | ||
103 | #error "Fix dateFormat" | ||
104 | /** | ||
105 | * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat) | ||
106 | * See if we need to use the function with String in it | ||
107 | * Anyway this is the future | ||
108 | * for now still use TimeString! | ||
109 | */ | ||
110 | static DateFormat dateFormat(); | ||
111 | #endif | ||
112 | |||
113 | static void setWeekStartsOnMonday( bool ); | ||
114 | static void setUseAMPM( bool ); | ||
115 | static void setDateFormat( const DateFormat& ); | ||
116 | //@} | ||
117 | |||
118 | private: | ||
46 | static OConfig* _config; | 119 | static OConfig* _config; |
47 | }; | 120 | }; |
48 | 121 | ||
49 | #endif // OGLOBAL_H | 122 | #endif // OGLOBAL_H |