less Q3 (remove a lot of unused Q3 headers, port small things)
[kdenetwork.git] / kdict / toplevel.h
blob95981a9b0d882a823db05036aec6f5e1ec489df6
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 //Added by qt3to4:
22 #include <Q3PtrList>
23 #include <kmainwindow.h>
24 #include "dcopinterface.h"
26 class QSplitter;
28 class KToggleAction;
29 class KToolBarPopupAction;
31 class DictLabelAction;
32 class DictComboAction;
33 class DictButtonAction;
34 class MatchView;
35 class QueryView;
36 class OptionsDialog;
37 class DbSetsDialog;
40 class TopLevel : public KMainWindow, virtual public KDictIface
42 Q_OBJECT
44 friend class QueryView;
46 public:
48 TopLevel(QWidget* parent = 0, const char* name = 0);
49 ~TopLevel();
51 void normalStartup(); // called when started without commandline parameters
53 // DCOP-Interface...
54 void quit();
55 void makeActiveWindow();
56 void definePhrase(QString phrase);
57 void matchPhrase(QString phrase);
58 void defineClipboardContent();
59 void matchClipboardContent();
60 QStringList getDatabases();
61 QString currentDatabase();
62 QStringList getStrategies();
63 QString currentStrategy();
64 bool setDatabase(QString db);
65 bool setStrategy(QString strategy);
66 bool historyGoBack();
67 bool historyGoForward();
69 public slots:
71 void define(const QString &query);
72 void defineClipboard();
74 void match(const QString &query);
75 void matchClipboard();
77 protected:
78 bool queryClose();
80 private:
82 void setupActions();
83 void setupStatusBar();
84 void recreateGUI();
85 void raiseWindow();
87 void addCurrentInputToHistory(); // add text in the query-combobox to the history
89 private slots:
90 void clearInput(); // erase text in query-combobox
92 void doDefine(); // define text in the combobox
93 void doMatch(); // match text in the combobox
95 void stopClients();
97 void buildHistMenu();
98 void queryHistMenu(); // process a query via the history menu
99 void clearQueryHistory();
101 void stratDbChanged();
102 void dbInfoMenuClicked();
103 void databaseSelected(int num);
105 void enableCopy(bool selected);
106 void enablePrintSave();
108 void clientStarted(const QString &message);
109 void clientStopped(const QString &message);
110 void resetStatusbar();
111 void renderingStarted();
112 void renderingStopped();
114 void newCaption(const QString&);
116 void toggleMatchListShow();
117 void saveMatchViewSize();
118 void adjustMatchViewSize();
120 void slotConfToolbar();
121 void slotNewToolbarConfig();
123 void showSetsDialog();
124 void hideSetsDialog();
125 void setsChanged();
127 void showOptionsDialog();
128 void hideOptionsDialog();
129 void optionsChanged();
131 private:
133 KAction *actSave, *actPrint, *actStartQuery, *actStopQuery, *actCopy;
134 KToggleAction *actShowMatchList;
135 DictLabelAction *actQueryLabel, *actDbLabel;
136 DictComboAction *actQueryCombo, *actDbCombo;
137 DictButtonAction *actDefineBtn, *actMatchBtn;
138 Q3PtrList<KAction> historyActionList, dbActionList;
139 KToolBarPopupAction *actBack, *actForward;
141 QSplitter *splitter; // widgets....
142 QueryView *queryView;
143 MatchView *matchView;
144 OptionsDialog *optDlg;
145 DbSetsDialog *setsDlg;
147 QTimer resetStatusbarTimer;
148 int stopRef; // remember how many "clients" are running
151 #endif