00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ALLPURPOSEUTILITIES_H
00020 #define ALLPURPOSEUTILITIES_H
00021
00022 #include <Qt>
00023 #include <QFile>
00024 #include <QDir>
00025 #include <memory>
00026
00027 class SystemTrayIntegration;
00028 class mama_de_diary;
00029
00030 using namespace std;
00031
00032 class AllPurposeUtilities
00033 {
00034 public:
00035 static void setSystemTrayIcon(SystemTrayIntegration* systemTrayIcon);
00036 static void setAppCore(mama_de_diary* appCore);
00037 static double getFreeDiskSpace(const QString &path);
00038 static double getTotalDiskSpace(const QString &path);
00039 static bool haveEnoughDiskSpace( qint64 required, const QString &path, bool popErrorIfNot = false);
00040 static bool haveEnoughDiskSpace( const QFile &required, const QString &path, bool popErrorIfNot = false);
00041 static void checkLowDiskSpace( const QString &path );
00042 static void popErrorMessage(const QString &message, const QString &errorTypeIdentifier);
00043 static void popSystemTrayInfoMessage(const QString &message, const QString &subject, int timeOut);
00044 static void popSystemTrayWarningMessage(const QString &message, const QString &subject, int timeOut);
00045 static void popSystemTrayCriticalMessage(const QString &message, const QString &subject, int timeOut);
00046 static bool dirsAreOnSamePartition(const QDir &dir1, const QDir &dir2);
00047 private:
00048 static SystemTrayIntegration *iSystemTrayIcon;
00049 static mama_de_diary *iAppCore;
00050 };
00051 #endif