kexi

kexi.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
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     //some temporary flags
00071 
00073     KEXICORE_EXPORT bool& tempShowForms(); 
00074 
00076     KEXICORE_EXPORT bool& tempShowReports(); 
00077 
00079     KEXICORE_EXPORT bool& tempShowMacros();
00080 
00082     KEXICORE_EXPORT bool& tempShowScripts(); 
00083 
00087     KEXICORE_EXPORT QFont smallFont(QWidget *init = 0);
00088 
00090     class KEXICORE_EXPORT ObjectStatus
00091     {
00092         public:
00093             ObjectStatus();
00094 
00095             ObjectStatus(const QString& message, const QString& description);
00096 
00097             ObjectStatus(KexiDB::Object* dbObject, const QString& message, const QString& description);
00098 
00099             ~ObjectStatus();
00100 
00101             const ObjectStatus& status() const;
00102 
00103             bool error() const;
00104 
00105             void setStatus(const QString& message, const QString& description);
00106 
00109             void setStatus(KexiDB::Object* dbObject, 
00110                 const QString& message = QString::null, const QString& description = QString::null);
00111 
00112             void setStatus(KexiDB::ResultInfo* result, 
00113                 const QString& message = QString::null, const QString& description = QString::null);
00114 
00115             void setStatus(KexiDB::Object* dbObject, KexiDB::ResultInfo* result, 
00116                 const QString& message = QString::null, const QString& description = QString::null);
00117 
00118             void clearStatus();
00119 
00120             QString singleStatusString() const;
00121 
00122             void append( const ObjectStatus& otherStatus );
00123 
00124             KexiDB::Object *dbObject() const { return dynamic_cast<KexiDB::Object*>((QObject*)dbObj); }
00125 
00128             operator KexiDB::MessageHandler*();
00129 
00130             QString message, description;
00131         protected:
00132             QGuardedPtr<QObject> dbObj; 
00133             KexiDB::MessageHandler* msgHandler;
00134     };
00135 
00136     KEXICORE_EXPORT QString msgYouCanImproveData();
00137 
00138 }//namespace Kexi
00139 
00141 KEXICORE_EXPORT void KEXI_UNFINISHED(const QString& feature_name, const QString& extra_text = QString::null);
00142 
00144 #define KEXI_UNFINISHED_SHARED_ACTION(action_name) \
00145     KEXI_UNFINISHED(sharedAction(action_name) ? sharedAction(action_name)->text() : QString::null)
00146 
00147 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys