1 /*****************************************************************************
2 * mainwindow.h - QStarDict, a StarDict clone written with using Qt *
3 * Copyright (C) 2007 Alexander Rodin *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License along *
16 * with this program; if not, write to the Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18 *****************************************************************************/
23 #include "ui_mainwindow.h"
34 * The main window of QStarDict.
36 class MainWindow: public QMainWindow, private Ui::MainWindow
42 * Create new MainWindow.
44 MainWindow(QWidget *parent = 0);
51 * Return true if instant search is on, otherwise false.
53 bool isInstantSearch() const
54 { return m_instantSearch; }
56 * Set instant search mode. If instantSearch is true
57 * translation will be shown when typing, otherwise only when
58 * "Search" button clicked.
60 void setInstantSearch(bool instantSearch);
65 void setDict(DictCore *dict);
68 * Return the dictionary.
70 DictCore *dict() const
74 * Set default style sheet for translations.
76 void setDefaultStyleSheet(const QString &css)
77 { translationView->setDefaultStyleSheet(css); }
80 * Return default style sheet.
82 QString defaultStyleSheet() const
83 { return translationView->defaultStyleSheet(); }
91 * Show translation of word.
93 void showTranslation(const QString &word);
96 void timerEvent(QTimerEvent *event);
97 void keyPressEvent(QKeyEvent *event);
98 void closeEvent(QCloseEvent *event);
101 void on_actionAbout_triggered();
102 void on_actionSettings_triggered();
103 void on_actionHelp_triggered();
104 void on_queryButton_clicked();
106 void wordsListItemActivated(QListWidgetItem *item);
107 void wordTranslated(const QString &word);
108 void queryEdited(const QString &);
111 void createConnections();
115 bool m_instantSearch;
121 #endif // MAINWINDOW_H
123 // vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab cindent textwidth=120 formatoptions=tc