kexi
kexi.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXI_H
00021 #define KEXI_H
00022
00023 #include <qguardedptr.h>
00024 #include <qfont.h>
00025
00026 #include <kexi_version.h>
00027 #include "kexiprojectdata.h"
00028 #include "kexipartmanager.h"
00029 #include "kexidbconnectionset.h"
00030 #include "kexiprojectset.h"
00031 #include <kexidb/drivermanager.h>
00032 #include <kexidb/driver.h>
00033
00034 #include <klocale.h>
00035 #include <kmessagebox.h>
00036
00037 namespace Kexi
00038 {
00039 KEXICORE_EXPORT void initCmdLineArgs(int argc, char *argv[], KAboutData* aboutData = 0);
00040
00042 enum ViewMode {
00043 AllViewModes = 0,
00044 NoViewMode = 0,
00045
00046 DataViewMode = 1,
00047 DesignViewMode = 2,
00048 TextViewMode = 4
00049 };
00051 KEXICORE_EXPORT QString nameForViewMode(int m);
00052
00054 KEXICORE_EXPORT KexiDBConnectionSet& connset();
00055
00057 KEXICORE_EXPORT KexiProjectSet& recentProjects();
00058
00060 KEXICORE_EXPORT KexiDB::DriverManager& driverManager();
00061
00063 KEXICORE_EXPORT KexiPart::Manager& partManager();
00064
00068 KEXICORE_EXPORT void deleteGlobalObjects();
00069
00070
00071
00073 KEXICORE_EXPORT bool& tempShowForms();
00074
00076 KEXICORE_EXPORT bool& tempShowReports();
00077
00079 KEXICORE_EXPORT bool& tempShowScripts();
00080
00084 KEXICORE_EXPORT QFont smallFont(QWidget *init = 0);
00085
00087 class KEXICORE_EXPORT ObjectStatus
00088 {
00089 public:
00090 ObjectStatus();
00091
00092 ObjectStatus(const QString& message, const QString& description);
00093
00094 ObjectStatus(KexiDB::Object* dbObject, const QString& message, const QString& description);
00095
00096 ~ObjectStatus();
00097
00098 const ObjectStatus& status() const;
00099
00100 bool error() const;
00101
00102 void setStatus(const QString& message, const QString& description);
00103
00106 void setStatus(KexiDB::Object* dbObject, const QString& message = QString::null, const QString& description = QString::null);
00107
00108 void clearStatus();
00109
00110 QString singleStatusString() const;
00111
00112 void append( const ObjectStatus& otherStatus );
00113
00114 KexiDB::Object *dbObject() const { return dynamic_cast<KexiDB::Object*>((QObject*)dbObj); }
00115
00118 operator KexiDB::MessageHandler*();
00119
00120 QString message, description;
00121 protected:
00122 QGuardedPtr<QObject> dbObj;
00123 KexiDB::MessageHandler* msgHandler;
00124 };
00125
00126 KEXICORE_EXPORT QString msgYouCanImproveData();
00127
00128 }
00129
00131 inline void KEXI_UNFINISHED(QString feature_name, QString extra_text = QString::null)
00132 {
00133 QString msg;
00134 if (feature_name.isEmpty())
00135 msg = i18n("This function is not available for version %1 of %2 application.")
00136 .arg(KEXI_VERSION_STRING)
00137 .arg(KEXI_APP_NAME);
00138 else
00139 msg = i18n("\"%1\" function is not available for version %2 of %3 application.")
00140 .arg(feature_name.replace("&",""))
00141 .arg(KEXI_VERSION_STRING)
00142 .arg(KEXI_APP_NAME);
00143
00144 if (!extra_text.isEmpty())
00145 extra_text.prepend("\n");
00146
00147 KMessageBox::sorry(0, msg + extra_text);
00148 }
00149
00151 #define KEXI_UNFINISHED_SHARED_ACTION(action_name) \
00152 KEXI_UNFINISHED(sharedAction(action_name) ? sharedAction(action_name)->text() : QString::null)
00153
00154 #endif
|