kexi

KexiStartup.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This library 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 library 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 library; see the file COPYING.LIB.  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_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 //      void slotShowConnectionDetails();
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 
KDE Home | KDE Accessibility Home | Description of Access Keys