00001
00002
00003
00004
00005
00006
00007
00008 #ifndef LITEMANWINDOW_H
00009 #define LITEMANWINDOW_H
00010
00011 #include <QMainWindow>
00012 #include <QPointer>
00013 #include <QMap>
00014
00015 class QTreeWidgetItem;
00016 class DataViewer;
00017 class QSplitter;
00018 class SchemaBrowser;
00019 class SqlEditor;
00020 class HelpBrowser;
00021
00022 class QAction;
00023 class QMenu;
00024 class QLabel;
00025
00026
00036 class LiteManWindow : public QMainWindow
00037 {
00038 Q_OBJECT
00039 public:
00040 LiteManWindow(const QString & fileToOpen = 0);
00041 ~LiteManWindow();
00042
00044 void setLanguage(QString l) { m_lang = l; };
00045
00046 QString mainDbPath() { return m_mainDbPath; };
00047
00048 signals:
00049 void prefsChanged();
00050
00051 private:
00052 void initUI();
00053 void initActions();
00054 void initMenus();
00055 void initRecentDocs();
00056
00062 void readSettings();
00063
00069 void writeSettings();
00070
00071
00072
00073 void updateRecent(QString fn);
00074 void removeRecent(QString fn);
00075 void rebuildRecentFileMenu();
00076
00080 void openDatabase(const QString & fileName);
00081
00082 protected:
00085 void closeEvent(QCloseEvent * e);
00086
00087 private slots:
00089 void newDB();
00090
00094 void open(const QString & file = QString());
00095 void openRecent();
00096 void about();
00097 void aboutQt();
00098 void help();
00099 void preferences();
00100
00101 void buildQuery();
00102 void execSql(QString query);
00103 void exportSchema();
00104 void dumpDatabase();
00105
00106 void createTable();
00107 void dropTable();
00108 void alterTable();
00109 void renameTable();
00110 void populateTable();
00111 void importTable();
00112
00113 void createView();
00114 void dropView();
00115 void alterView();
00116
00117 void createIndex();
00118 void dropIndex();
00119
00120
00121
00122
00123 void reindex();
00124
00125 void treeItemActivated(QTreeWidgetItem * item, int column);
00126 void treeContextMenuOpened(const QPoint & pos);
00127 void tableTree_currentItemChanged(QTreeWidgetItem* cur, QTreeWidgetItem* prev);
00128
00129 void handleSqlEditor();
00130 void handleObjectBrowser();
00131
00132 void analyzeDialog();
00133 void vacuumDialog();
00134 void attachDatabase();
00135 void detachDatabase();
00136
00137 void createTrigger();
00138 void alterTrigger();
00139
00140 void dropTrigger();
00141
00142 void constraintTriggers();
00143
00144 void describeObject();
00145
00146 private:
00147 QStringList recentDocs;
00148
00149 QString m_mainDbPath;
00150 QString m_appName;
00151 QString m_lang;
00152 QLabel * m_sqliteVersionLabel;
00153
00155 bool m_sqliteBinAvailable;
00156
00160 QMap<QString,QString> attachedDb;
00161
00162 QSplitter * splitter;
00163 SchemaBrowser * schemaBrowser;
00164 DataViewer * dataViewer;
00165 SqlEditor* sqlEditor;
00166 QSplitter* splitterSql;
00167 HelpBrowser * helpBrowser;
00168
00169 QMenu * databaseMenu;
00170 QMenu * adminMenu;
00171 QMenu * recentFilesMenu;
00172 QMenu * contextMenu;
00173
00174 QAction * newAct;
00175 QAction * openAct;
00176 QAction * recentAct;
00177 QAction * exitAct;
00178 QAction * aboutAct;
00179 QAction * aboutQtAct;
00180 QAction * helpAct;
00181 QAction * preferencesAct;
00182
00183 QAction * createTableAct;
00184 QAction * dropTableAct;
00185 QAction * alterTableAct;
00186 QAction * describeTableAct;
00187 QAction * importTableAct;
00188 QAction * renameTableAct;
00189 QAction * populateTableAct;
00190
00191 QAction * createViewAct;
00192 QAction * dropViewAct;
00193 QAction * describeViewAct;
00194 QAction * alterViewAct;
00195
00196 QAction * createIndexAct;
00197 QAction * dropIndexAct;
00198 QAction * describeIndexAct;
00199 QAction * reindexAct;
00200
00201 QAction * createTriggerAct;
00202 QAction * alterTriggerAct;
00203 QAction * dropTriggerAct;
00204 QAction * describeTriggerAct;
00205
00206 QAction * execSqlAct;
00207 QAction * objectBrowserAct;
00208 QAction * buildQueryAct;
00209 QAction * exportSchemaAct;
00210 QAction * dumpDatabaseAct;
00211
00212 QAction * analyzeAct;
00213 QAction * vacuumAct;
00214 QAction * attachAct;
00215 QAction * detachAct;
00216 QAction * refreshTreeAct;
00217
00218 QAction * consTriggAct;
00219 };
00220
00221 #endif