KexiStartup.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KEXI_STARTUPHANDLER_H
21#define KEXI_STARTUPHANDLER_H
22
23#include <tqstring.h>
24#include <tqwidget.h>
25#include <kpassdlg.h>
26
27#include <core/kexistartupdata.h>
28#include <core/kexi.h>
29#include <kexiutils/tristate.h>
30
31class KexiProjectData;
32class KexiProjectData;
33class TDECmdLineArgs;
34class KexiStartupHandlerPrivate;
35namespace KexiDB {
36 class ConnectionData;
37}
38
40class KEXIMAIN_EXPORT KexiDBPasswordDialog : public KPasswordDialog
41{
42 TQ_OBJECT
43
44 public:
45 KexiDBPasswordDialog(TQWidget *parent, KexiDB::ConnectionData& cdata, bool showDetailsButton = false);
46 virtual ~KexiDBPasswordDialog();
47
48 bool showConnectionDetailsRequested() const { return m_showConnectionDetailsRequested; }
49
50 protected slots:
51 virtual void done(int r);
52 void slotShowConnectionDetails();
53
54 protected:
56 bool m_showConnectionDetailsRequested : 1;
57};
58
61class KEXIMAIN_EXPORT KexiStartupHandler
62 : public TQObject, public KexiStartupData, public Kexi::ObjectStatus
63{
64 TQ_OBJECT
65
66
67 public:
69 virtual ~KexiStartupHandler();
70
71 virtual tristate init(int argc, char **argv);
72
73 #if 0
80 static KexiProjectData* detectProjectData(
81 KexiDB::ConnectionData& cdata, const TQString &dbname, TQWidget *parent);
82 #endif
83
86 DontConvert = 1,
87 ThisIsAProjectFile = 2,
88 ThisIsAShortcutToAProjectFile = 4,
90 ThisIsAShortcutToAConnectionData = 8,
92 SkipMessages = 16
93 };
94
109 static tristate detectActionForFile(
110 KexiStartupData::Import& detectedImportAction, TQString& detectedDriverName,
111 const TQString& _suggestedDriverName,
112 const TQString &dbFileName, TQWidget *parent = 0, int options = 0 );
113
119 KexiProjectData* selectProject(KexiDB::ConnectionData *cdata, bool& cancelled, TQWidget *parent = 0);
120
121 protected slots:
122 void slotSaveShortcutFileChanges();
123// void slotShowConnectionDetails();
124
125 protected:
126 bool getAutoopenObjects(TDECmdLineArgs *args, const TQCString &action_name);
127
128 KexiStartupHandlerPrivate *d;
129};
130
131namespace Kexi
132{
134 KEXIMAIN_EXPORT KexiStartupHandler& startupHandler();
135}
136
137#endif
138
Database specific connection data, e.g. host, port.
Kexi project core data member.
Startup data used for storing results of startup operations in Kexi.
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100
High-level database connectivity library with database backend drivers.
Namespace for general Kexi functions.
Definition kexi.h:38
KexiStartupHandler & startupHandler()