summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oglobal.h75
1 files changed, 74 insertions, 1 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 @@
+#include <qpe/global.h>
+#include <qpe/timestring.h>
+
#include <opie2/oconfig.h>
+#include <static.h>
@@ -38,5 +42,50 @@
-class OGlobal
+
+class QFile;
+class QString;
+/**
+ *\brief OGlobal contains a list of generic functions
+ *
+ * The class OGlobal contains small utility functions
+ * which might be useful for other applications to use. It features access
+ * to the global device config and specialized functions to get information
+ * out of this config like Weekstart or Owner name.
+ *
+ * @todo ODP implement the things from Global which are good
+ */
+class OGlobal : public Global
{
public:
+
+ // how do they relate to our Document Idea
+ /** @name Document System related functions
+ *
+ */
+ //@{
+ static bool isAppLnkFileName( const QString& str );
+ static bool isDocumentFileName( const QString& file );
+ //@}
+
+ /** @name File Operations
+ * File operations provided by OGlobal
+ */
+ //@{
+ static QString tempDirPath();
+ static QString homeDirPath();
+ static QString tempFileName( const QString& );
+ static bool renameFile( const QString& from, const QString& to );
+ static bool truncateFile( QFile &f, off_t size );
+ //@}
+
+
+ static QString generateUuid();
+
+ /** @name Convert Content
+ * Convert Content of a QByteArray
+ */
+ //@{
+ static QByteArray encodeBase64(const QByteArray& );
+ static QByteArray decodeBase64(const QByteArray& );
+ //@}
+
//FIXME Do we want to put that into OApplication as in KApplication? -zecke
@@ -44,3 +93,27 @@ class OGlobal
// ( accessed through oApp->config() ), but this one is the global one! -mickeyl
+ /** @name Config and Owner related Information
+ *
+ */
+ //@{
static OConfig* config();
+ static QString ownerName();
+ static bool weekStartsOnMonday();
+ static bool useAMPM();
+#ifdef ODP
+#error "Fix dateFormat"
+ /**
+ * For Qt3/Qt4 we can use QDate::toString(OGlobal::dateFormat)
+ * See if we need to use the function with String in it
+ * Anyway this is the future
+ * for now still use TimeString!
+ */
+ static DateFormat dateFormat();
+#endif
+
+ static void setWeekStartsOnMonday( bool );
+ static void setUseAMPM( bool );
+ static void setDateFormat( const DateFormat& );
+ //@}
+
+private:
static OConfig* _config;