kexi
KexiStartup.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXI_STARTUPHANDLER_H
00021 #define KEXI_STARTUPHANDLER_H
00022
00023 #include <qstring.h>
00024 #include <qwidget.h>
00025 #include <kpassdlg.h>
00026
00027 #include <core/kexistartupdata.h>
00028 #include <core/kexi.h>
00029 #include <kexiutils/tristate.h>
00030
00031 class KexiProjectData;
00032 class KexiProjectData;
00033 class KCmdLineArgs;
00034 class KexiStartupHandlerPrivate;
00035 namespace KexiDB {
00036 class ConnectionData;
00037 }
00038
00040 class KEXIMAIN_EXPORT KexiDBPasswordDialog : public KPasswordDialog
00041 {
00042 Q_OBJECT
00043 public:
00044 KexiDBPasswordDialog(QWidget *parent, KexiDB::ConnectionData& cdata, bool showDetailsButton = false);
00045 virtual ~KexiDBPasswordDialog();
00046
00047 bool showConnectionDetailsRequested() const { return m_showConnectionDetailsRequested; }
00048
00049 protected slots:
00050 virtual void done(int r);
00051 void slotShowConnectionDetails();
00052
00053 protected:
00054 KexiDB::ConnectionData *m_cdata;
00055 bool m_showConnectionDetailsRequested : 1;
00056 };
00057
00060 class KEXIMAIN_EXPORT KexiStartupHandler
00061 : public QObject, public KexiStartupData, public Kexi::ObjectStatus
00062 {
00063 Q_OBJECT
00064
00065 public:
00066 KexiStartupHandler();
00067 virtual ~KexiStartupHandler();
00068
00069 virtual tristate init(int argc, char **argv);
00070
00071 #if 0
00072
00078 static KexiProjectData* detectProjectData(
00079 KexiDB::ConnectionData& cdata, const QString &dbname, QWidget *parent);
00080 #endif
00081
00083 enum DetectDriverForFileOptions {
00084 DontConvert = 1,
00085 ThisIsAProjectFile = 2,
00086 ThisIsAShortcutToAProjectFile = 4,
00087
00088 ThisIsAShortcutToAConnectionData = 8,
00089
00090 SkipMessages = 16
00091 };
00092
00107 static tristate detectActionForFile(
00108 KexiStartupData::Import& detectedImportAction, QString& detectedDriverName,
00109 const QString& _suggestedDriverName,
00110 const QString &dbFileName, QWidget *parent = 0, int options = 0 );
00111
00117 KexiProjectData* selectProject(KexiDB::ConnectionData *cdata, bool& cancelled, QWidget *parent = 0);
00118
00119 protected slots:
00120 void slotSaveShortcutFileChanges();
00121
00122
00123 protected:
00124 bool getAutoopenObjects(KCmdLineArgs *args, const QCString &action_name);
00125
00126 KexiStartupHandlerPrivate *d;
00127 };
00128
00129 namespace Kexi
00130 {
00132 KEXIMAIN_EXPORT KexiStartupHandler& startupHandler();
00133 }
00134
00135 #endif
00136
|