Added documentation
[mdictionary] / doc / html / MainWindow_8h_source.html
1 <!-- This comment will put IE 6, 7 and 8 in quirks mode -->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <title>mDictionary: MainWindow.h Source File</title>
7 <link href="tabs.css" rel="stylesheet" type="text/css"/>
8 <link href="search/search.css" rel="stylesheet" type="text/css"/>
9 <script type="text/javaScript" src="search/search.js"></script>
10 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
11 </head>
12 <body onload='searchBox.OnSelectItem(0);'>
13 <!-- Generated by Doxygen 1.6.3 -->
14 <script type="text/javascript"><!--
15 var searchBox = new SearchBox("searchBox", "search",false,'Search');
16 --></script>
17 <div class="navigation" id="top">
18   <div class="tabs">
19     <ul>
20       <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
21       <li><a href="annotated.html"><span>Classes</span></a></li>
22       <li class="current"><a href="files.html"><span>Files</span></a></li>
23       <li>
24         <div id="MSearchBox" class="MSearchBoxInactive">
25         <img id="MSearchSelect" src="search/search.png"
26              onmouseover="return searchBox.OnSearchSelectShow()"
27              onmouseout="return searchBox.OnSearchSelectHide()"
28              alt=""/>
29         <input type="text" id="MSearchField" value="Search" accesskey="S"
30              onfocus="searchBox.OnSearchFieldFocus(true)" 
31              onblur="searchBox.OnSearchFieldFocus(false)" 
32              onkeyup="searchBox.OnSearchFieldChange(event)"/>
33         <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
34         </div>
35       </li>
36     </ul>
37   </div>
38   <div class="tabs">
39     <ul>
40       <li><a href="files.html"><span>File&nbsp;List</span></a></li>
41     </ul>
42   </div>
43 <h1>MainWindow.h</h1><a href="MainWindow_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*******************************************************************************</span>
44 <a name="l00002"></a>00002 <span class="comment"></span>
45 <a name="l00003"></a>00003 <span class="comment">    This file is part of mDictionary.</span>
46 <a name="l00004"></a>00004 <span class="comment"></span>
47 <a name="l00005"></a>00005 <span class="comment">    mDictionary is free software: you can redistribute it and/or modify</span>
48 <a name="l00006"></a>00006 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
49 <a name="l00007"></a>00007 <span class="comment">    the Free Software Foundation, either version 3 of the License, or</span>
50 <a name="l00008"></a>00008 <span class="comment">    (at your option) any later version.</span>
51 <a name="l00009"></a>00009 <span class="comment"></span>
52 <a name="l00010"></a>00010 <span class="comment">    mDictionary is distributed in the hope that it will be useful,</span>
53 <a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
54 <a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
55 <a name="l00013"></a>00013 <span class="comment">    GNU General Public License for more details.</span>
56 <a name="l00014"></a>00014 <span class="comment"></span>
57 <a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU General Public License</span>
58 <a name="l00016"></a>00016 <span class="comment">    along with mDictionary.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
59 <a name="l00017"></a>00017 <span class="comment"></span>
60 <a name="l00018"></a>00018 <span class="comment">    Copyright 2010 Comarch S.A.</span>
61 <a name="l00019"></a>00019 <span class="comment"></span>
62 <a name="l00020"></a>00020 <span class="comment">*******************************************************************************/</span>
63 <a name="l00024"></a>00024 
64 <a name="l00025"></a>00025 <span class="preprocessor">#ifndef MAINWINDOW_H</span>
65 <a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define MAINWINDOW_H</span>
66 <a name="l00027"></a>00027 <span class="preprocessor"></span>
67 <a name="l00028"></a>00028 <span class="preprocessor">#include &lt;QMainWindow&gt;</span>
68 <a name="l00029"></a>00029 <span class="preprocessor">#include &quot;../../includes/GUIInterface.h&quot;</span>
69 <a name="l00030"></a>00030 <span class="preprocessor">#include &quot;../../includes/settings.h&quot;</span>
70 <a name="l00031"></a>00031 <span class="preprocessor">#include &quot;../backbone/backbone.h&quot;</span>
71 <a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="TranslationWidget_8h.html" title="Implements translation widget.">TranslationWidget.h</a>&quot;</span>
72 <a name="l00033"></a>00033 <span class="preprocessor">#include &quot;WordListWidget.h&quot;</span>
73 <a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="SearchBarWidget_8h.html" title="Implements search bar.">SearchBarWidget.h</a>&quot;</span>
74 <a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="MenuWidget_8h.html" title="Implements custom menu.">MenuWidget.h</a>&quot;</span>
75 <a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="DictManagerWidget_8h.html" title="Dictionary management widget.">DictManagerWidget.h</a>&quot;</span>
76 <a name="l00037"></a>00037 <span class="preprocessor">#include &quot;SettingsWidget.h&quot;</span>
77 <a name="l00038"></a>00038 <span class="preprocessor">#include &quot;<a class="code" href="HistoryListDialog_8h.html" title="Implements history list dialog.">HistoryListDialog.h</a>&quot;</span>
78 <a name="l00039"></a>00039 <span class="preprocessor">#include &quot;BookmarksWidget.h&quot;</span>
79 <a name="l00040"></a>00040 <span class="preprocessor">#include &quot;WelcomeScreenWidget.h&quot;</span>
80 <a name="l00041"></a>00041 <span class="preprocessor">#include &quot;AboutWidget.h&quot;</span>
81 <a name="l00042"></a>00042 
82 <a name="l00043"></a>00043 <span class="keyword">namespace </span>Ui {
83 <a name="l00044"></a>00044     <span class="keyword">class </span><a class="code" href="classMainWindow.html" title="Implements interface for GUI.">MainWindow</a>;
84 <a name="l00045"></a>00045 }
85 <a name="l00046"></a>00046 
86 <a name="l00048"></a>00048 
87 <a name="l00055"></a><a class="code" href="classMainWindow.html">00055</a> <span class="keyword">class </span><a class="code" href="classMainWindow.html" title="Implements interface for GUI.">MainWindow</a> : <span class="keyword">public</span> <a class="code" href="classGUIInterface.html" title="Interface for different GUIs.">GUIInterface</a>
88 <a name="l00056"></a>00056 {
89 <a name="l00057"></a>00057     Q_OBJECT
90 <a name="l00058"></a>00058 
91 <a name="l00059"></a>00059 <span class="keyword">public</span>:
92 <a name="l00061"></a>00061 
93 <a name="l00066"></a>00066     <span class="keyword">explicit</span> <a class="code" href="classMainWindow.html#a4acc6192d273eb38e9082b4934202b81" title="Constructor.">MainWindow</a>(<a class="code" href="classBackbone.html" title="/file backbone.cpp">Backbone</a>* backbone, QWidget *parent = 0);
94 <a name="l00067"></a>00067     ~<a class="code" href="classMainWindow.html" title="Implements interface for GUI.">MainWindow</a>();
95 <a name="l00068"></a>00068 
96 <a name="l00071"></a>00071 
97 <a name="l00075"></a>00075     QHash&lt;CommonDictInterface*, bool&gt; <a class="code" href="classMainWindow.html#a0fd2d755ce951f3dfb535d555b957de7">getDictionaries</a>();
98 <a name="l00076"></a>00076 
99 <a name="l00078"></a>00078 
100 <a name="l00081"></a>00081     QList&lt;CommonDictInterface*&gt; <a class="code" href="classMainWindow.html#a021ff10f30db21337b54b3dfaae0e9a0" title="Returns all loaded plugins.">getPlugins</a>();
101 <a name="l00082"></a>00082 
102 <a name="l00084"></a>00084 
103 <a name="l00090"></a>00090     <span class="keywordtype">bool</span> <a class="code" href="classMainWindow.html#a88a06565de22a608629bfa4a15ad5839" title="Indicates if GUI is in exact search mode.">exactSearch</a>();
104 <a name="l00091"></a>00091 
105 <a name="l00093"></a>00093 
106 <a name="l00100"></a>00100     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#a78e044c5bd7446b0d2105f98573b9489" title="Sets GUI exact search mode.">setExactSearch</a>(<span class="keywordtype">bool</span>);
107 <a name="l00101"></a>00101 
108 <a name="l00102"></a>00102     <a class="code" href="classSettings.html" title="Plugins or dictionaries may need to keep some of configuration between sessions,...">Settings</a>* settings();
109 <a name="l00103"></a>00103 
110 <a name="l00104"></a>00104     <span class="keywordtype">void</span> setSettings(<a class="code" href="classSettings.html" title="Plugins or dictionaries may need to keep some of configuration between sessions,...">Settings</a>*);
111 <a name="l00105"></a>00105 
112 <a name="l00106"></a>00106 
113 <a name="l00107"></a>00107  <span class="keyword">public</span> Q_SLOTS:
114 <a name="l00109"></a>00109 
115 <a name="l00114"></a>00114     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#a16d0c7d46fc49bfa1cada597e349549a" title="Search in exact mode for given word.">searchExact</a>(QString);
116 <a name="l00115"></a>00115 
117 <a name="l00116"></a>00116 
118 <a name="l00118"></a>00118 
119 <a name="l00127"></a>00127     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#a9a56d2e699da84f9647984852cb6041b" title="Gets word list from backbone and prepares received list to display.">wordListReady</a>();
120 <a name="l00128"></a>00128 
121 <a name="l00130"></a>00130     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#afea3664ab8d180bc705b552b7f745136" title="Gets translation strings from backbone and emit signal to display them.">translationsReady</a>();
122 <a name="l00131"></a>00131 
123 <a name="l00133"></a>00133 
124 <a name="l00140"></a>00140     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#ab88154764298f46e81f942262170f4b9" title="Adds to history key words from given translations.">addToHistory</a>(QList&lt;Translation*&gt;);
125 <a name="l00141"></a>00141 
126 <a name="l00143"></a>00143     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#a655d251389256b1e062513f6ff762543" title="Shows history dialog.">showHistory</a>();
127 <a name="l00144"></a>00144 
128 <a name="l00146"></a>00146 
129 <a name="l00151"></a>00151     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#aaac2ae9385150bf83eb6c1d73e745e3c" title="Shows translation of next word in history.">historyNext</a>();
130 <a name="l00152"></a>00152 
131 <a name="l00154"></a>00154 
132 <a name="l00159"></a>00159     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#ab3d88584e7391cedb791248dc7b13b78" title="Shows translation of previous word in history.">historyPrev</a>();
133 <a name="l00160"></a>00160 
134 <a name="l00161"></a>00161 <span class="keyword">private</span> Q_SLOTS:
135 <a name="l00164"></a>00164     <span class="keywordtype">void</span> setSearchString(QString);
136 <a name="l00165"></a>00165 
137 <a name="l00167"></a>00167     <span class="keywordtype">void</span> disableMenu();
138 <a name="l00168"></a>00168 
139 <a name="l00170"></a>00170     <span class="keywordtype">void</span> enableMenu();
140 <a name="l00171"></a>00171 
141 <a name="l00174"></a>00174     <span class="keywordtype">void</span> breakSearching();
142 <a name="l00175"></a>00175 
143 <a name="l00176"></a>00176 
144 <a name="l00177"></a>00177     <span class="keywordtype">void</span> showAllBookmarks();
145 <a name="l00178"></a>00178 
146 <a name="l00179"></a>00179 
147 <a name="l00180"></a>00180 <span class="keyword">protected</span>:
148 <a name="l00184"></a>00184     <span class="keywordtype">void</span> <a class="code" href="classMainWindow.html#a38edb88d43e844aca9d2e762c8706565" title="When user wants to close application, we first sends signal to stop all ongoing searches...">closeEvent</a>(QCloseEvent *);
149 <a name="l00185"></a>00185 
150 <a name="l00186"></a>00186 
151 <a name="l00187"></a>00187 <span class="keyword">private</span>:
152 <a name="l00188"></a>00188     <a class="code" href="classBackbone.html" title="/file backbone.cpp">Backbone</a>* backbone;
153 <a name="l00189"></a>00189     <a class="code" href="classUi_1_1MainWindow.html">Ui::MainWindow</a> *ui;
154 <a name="l00190"></a>00190 
155 <a name="l00191"></a>00191     <span class="keywordtype">void</span> initializeUI();
156 <a name="l00192"></a>00192 
157 <a name="l00193"></a>00193 
158 <a name="l00194"></a>00194     <a class="code" href="classSearchBarWidget.html" title="Displays search bar.">SearchBarWidget</a>* searchBarWidget;
159 <a name="l00195"></a>00195     QWidget* translationWidget;
160 <a name="l00196"></a>00196     QWidget* wordListWidget;
161 <a name="l00197"></a>00197     <a class="code" href="classMenuWidget.html" title="Displays custom menu with tab widget containing all submenus.">MenuWidget</a>* menuWidget;
162 <a name="l00198"></a>00198     <a class="code" href="classDictManagerWidget.html" title="Implements dictionaries management widget.">DictManagerWidget</a>* dictManagerWidget;
163 <a name="l00199"></a>00199     <a class="code" href="classSettingsWidget.html">SettingsWidget</a>* settingsWidget;
164 <a name="l00200"></a>00200     <a class="code" href="classBookmarksWidget.html">BookmarksWidget</a>* bookmarksWidget;
165 <a name="l00201"></a>00201     QWidget* welcomeScreenWidget;
166 <a name="l00202"></a>00202     <a class="code" href="classAboutWidget.html">AboutWidget</a>* aboutWidget;
167 <a name="l00203"></a>00203 
168 <a name="l00204"></a>00204 <span class="preprocessor">    #ifndef Q_WS_MAEMO_5</span>
169 <a name="l00205"></a>00205 <span class="preprocessor"></span>        QSplitter* splitter;
170 <a name="l00206"></a>00206         QAction* dictionariesAction;
171 <a name="l00207"></a>00207         QAction* bookmarksShowAllAction;
172 <a name="l00208"></a>00208         QAction* bookmarksRemoveAllAction;
173 <a name="l00209"></a>00209         QAction* settingsAction;
174 <a name="l00210"></a>00210         QAction* aboutAction;
175 <a name="l00211"></a>00211 <span class="preprocessor">    #endif</span>
176 <a name="l00212"></a>00212 <span class="preprocessor"></span>
177 <a name="l00213"></a>00213     <span class="keywordtype">bool</span> _exactSearch;
178 <a name="l00214"></a>00214     QString searchString;
179 <a name="l00215"></a>00215 
180 <a name="l00216"></a>00216 
181 <a name="l00217"></a>00217     <span class="keywordtype">void</span> connectBackbone();
182 <a name="l00218"></a>00218     <span class="keywordtype">void</span> connectSearchBar();
183 <a name="l00219"></a>00219     <span class="keywordtype">void</span> connectWordList();
184 <a name="l00220"></a>00220     <span class="keywordtype">void</span> connectTranslationWidget();
185 <a name="l00221"></a>00221     <span class="keywordtype">void</span> connectDictManager();
186 <a name="l00222"></a>00222     <span class="keywordtype">void</span> connectMenu();
187 <a name="l00223"></a>00223     <span class="keywordtype">void</span> connectBookmarksWidget();
188 <a name="l00224"></a>00224 };
189 <a name="l00225"></a>00225 
190 <a name="l00226"></a>00226 <span class="preprocessor">#endif // MAINWINDOW_H</span>
191 </pre></div></div>
192 <!--- window showing the filter options -->
193 <div id="MSearchSelectWindow"
194      onmouseover="return searchBox.OnSearchSelectShow()"
195      onmouseout="return searchBox.OnSearchSelectHide()"
196      onkeydown="return searchBox.OnSearchSelectKey(event)">
197 <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a></div>
198
199 <!-- iframe showing the search results (closed by default) -->
200 <div id="MSearchResultsWindow">
201 <iframe src="" frameborder="0" 
202         name="MSearchResults" id="MSearchResults">
203 </iframe>
204 </div>
205
206 <hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Aug 18 16:45:34 2010 for mDictionary by&nbsp;
207 <a href="http://www.doxygen.org/index.html">
208 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
209 </body>
210 </html>