-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 | |||
@@ -32,3 +32,7 @@ | |||
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 | ||
@@ -38,5 +42,50 @@ | |||
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 |
@@ -44,3 +93,27 @@ class OGlobal | |||
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; |