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 <kxmlguiwindow.h>
28 class KToolBarPopupAction
;
30 class DictLabelAction
;
31 class DictComboAction
;
32 class DictButtonAction
;
39 class TopLevel
: public KXmlGuiWindow
43 friend class QueryView
;
47 TopLevel(QWidget
* parent
= 0);
50 void normalStartup(); // called when started without commandline parameters
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
);
66 bool historyGoForward();
70 void define(const QString
&query
);
71 void defineClipboard();
73 void match(const QString
&query
);
74 void matchClipboard();
82 void setupStatusBar();
86 void addCurrentInputToHistory(); // add text in the query-combobox to the history
89 void clearInput(); // erase text in query-combobox
91 void doDefine(); // define text in the combobox
92 void doMatch(); // match text in the combobox
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();
126 void showOptionsDialog();
127 void hideOptionsDialog();
128 void optionsChanged();
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