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 ------------------------------------------------------------- */
23 #include <kmainwindow.h>
24 #include "dcopinterface.h"
29 class KToolBarPopupAction
;
31 class DictLabelAction
;
32 class DictComboAction
;
33 class DictButtonAction
;
40 class TopLevel
: public KMainWindow
, virtual public KDictIface
44 friend class QueryView
;
48 TopLevel(QWidget
* parent
= 0, const char* name
= 0);
51 void normalStartup(); // called when started without commandline parameters
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
);
67 bool historyGoForward();
71 void define(const QString
&query
);
72 void defineClipboard();
74 void match(const QString
&query
);
75 void matchClipboard();
83 void setupStatusBar();
87 void addCurrentInputToHistory(); // add text in the query-combobox to the history
90 void clearInput(); // erase text in query-combobox
92 void doDefine(); // define text in the combobox
93 void doMatch(); // match text in the combobox
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();
127 void showOptionsDialog();
128 void hideOptionsDialog();
129 void optionsChanged();
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