fix some layouts everwhere in kopete
[kdenetwork.git] / kdict / toplevel.h
blob77d1e8297f109644f53fb47ebfb15b68563bde62
1 /* -------------------------------------------------------------
3 toplevel.h (part of The KDE Dictionary Client)
5 Copyright (C) 2000-2001 Christian Gebauer <gebauer@kde.org>
6 (C) by Matthias Hölzer 1998
8 This file is distributed under the Artistic License.
9 See LICENSE for details.
11 -------------------------------------------------------------
13 TopLevel The toplevel widget of Kdict.
15 ------------------------------------------------------------- */
17 #ifndef _TOPLEVEL_H_
18 #define _TOPLEVEL_H_
20 #include <qtimer.h>
21 #include <QAction>
23 #include <kxmlguiwindow.h>
25 class QSplitter;
27 class KToggleAction;
28 class KToolBarPopupAction;
30 class DictLabelAction;
31 class DictComboAction;
32 class DictButtonAction;
33 class MatchView;
34 class QueryView;
35 class OptionsDialog;
36 class DbSetsDialog;
39 class TopLevel : public KXmlGuiWindow
41 Q_OBJECT
43 friend class QueryView;
45 public:
47 TopLevel(QWidget* parent = 0);
48 ~TopLevel();
50 void normalStartup(); // called when started without commandline parameters
52 // DCOP-Interface...
53 void quit();
54 void makeActiveWindow();
55 void definePhrase(QString phrase);
56 void matchPhrase(QString phrase);
57 void defineClipboardContent();
58 void matchClipboardContent();
59 QStringList getDatabases();
60 QString currentDatabase();
61 QStringList getStrategies();
62 QString currentStrategy();
63 bool setDatabase(QString db);
64 bool setStrategy(QString strategy);
65 bool historyGoBack();
66 bool historyGoForward();
68 public slots:
70 void define(const QString &query);
71 void defineClipboard();
73 void match(const QString &query);
74 void matchClipboard();
76 protected:
77 bool queryClose();
79 private:
81 void setupActions();
82 void setupStatusBar();
83 void recreateGUI();
84 void raiseWindow();
86 void addCurrentInputToHistory(); // add text in the query-combobox to the history
88 private slots:
89 void clearInput(); // erase text in query-combobox
91 void doDefine(); // define text in the combobox
92 void doMatch(); // match text in the combobox
94 void stopClients();
96 void buildHistMenu();
97 void queryHistMenu(); // process a query via the history menu
98 void clearQueryHistory();
100 void stratDbChanged();
101 void dbInfoMenuClicked();
102 void databaseSelected(int num);
104 void enableCopy(bool selected);
105 void enablePrintSave();
107 void clientStarted(const QString &message);
108 void clientStopped(const QString &message);
109 void resetStatusbar();
110 void renderingStarted();
111 void renderingStopped();
113 void newCaption(const QString&);
115 void toggleMatchListShow();
116 void saveMatchViewSize();
117 void adjustMatchViewSize();
119 void slotConfToolbar();
120 void slotNewToolbarConfig();
122 void showSetsDialog();
123 void hideSetsDialog();
124 void setsChanged();
126 void showOptionsDialog();
127 void hideOptionsDialog();
128 void optionsChanged();
130 private:
132 QAction *actSave, *actPrint, *actStartQuery, *actStopQuery, *actCopy;
133 KToggleAction *actShowMatchList;
134 DictLabelAction *actQueryLabel, *actDbLabel;
135 DictComboAction *actQueryCombo, *actDbCombo;
136 DictButtonAction *actDefineBtn, *actMatchBtn;
137 QList<QAction*> historyActionList, dbActionList;
138 KToolBarPopupAction *actBack, *actForward;
140 QSplitter *splitter; // widgets....
141 QueryView *queryView;
142 MatchView *matchView;
143 OptionsDialog *optDlg;
144 DbSetsDialog *setsDlg;
146 QTimer resetStatusbarTimer;
147 int stopRef; // remember how many "clients" are running
150 #endif