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">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <title>mDictionary: MainWindow Class Reference</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"/>
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');
17 <div class="navigation" id="top">
20 <li><a href="index.html"><span>Main Page</span></a></li>
21 <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
22 <li><a href="files.html"><span>Files</span></a></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()"
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>
40 <li><a href="annotated.html"><span>Class List</span></a></li>
41 <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
42 <li><a href="functions.html"><span>Class Members</span></a></li>
46 <div class="contents">
47 <h1>MainWindow Class Reference</h1><!-- doxytag: class="MainWindow" --><!-- doxytag: inherits="GUIInterface" -->
48 <p>Implements interface for GUI.
49 <a href="#_details">More...</a></p>
51 <p><code>#include <<a class="el" href="MainWindow_8h_source.html">MainWindow.h</a>></code></p>
52 <div class="dynheader">
53 Inheritance diagram for MainWindow:</div>
54 <div class="dynsection">
56 <img src="classMainWindow.png" usemap="#MainWindow_map" alt=""/>
57 <map id="MainWindow_map" name="MainWindow_map">
58 <area href="classGUIInterface.html" alt="GUIInterface" shape="rect" coords="0,0,84,24"/>
63 <p><a href="classMainWindow-members.html">List of all members.</a></p>
64 <table border="0" cellpadding="0" cellspacing="0">
65 <tr><td colspan="2"><h2>Public Slots</h2></td></tr>
66 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a16d0c7d46fc49bfa1cada597e349549a">searchExact</a> (QString)</td></tr>
67 <tr><td class="mdescLeft"> </td><td class="mdescRight">Search in exact mode for given word. <a href="#a16d0c7d46fc49bfa1cada597e349549a"></a><br/></td></tr>
68 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a9a56d2e699da84f9647984852cb6041b">wordListReady</a> ()</td></tr>
69 <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets word list from backbone and prepares received list to display. <a href="#a9a56d2e699da84f9647984852cb6041b"></a><br/></td></tr>
70 <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afea3664ab8d180bc705b552b7f745136"></a><!-- doxytag: member="MainWindow::translationsReady" ref="afea3664ab8d180bc705b552b7f745136" args="()" -->
71 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#afea3664ab8d180bc705b552b7f745136">translationsReady</a> ()</td></tr>
72 <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets translation strings from backbone and emit signal to display them. <br/></td></tr>
73 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#ab88154764298f46e81f942262170f4b9">addToHistory</a> (QList< <a class="el" href="classTranslation.html">Translation</a> * >)</td></tr>
74 <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds to history key words from given translations. <a href="#ab88154764298f46e81f942262170f4b9"></a><br/></td></tr>
75 <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a655d251389256b1e062513f6ff762543"></a><!-- doxytag: member="MainWindow::showHistory" ref="a655d251389256b1e062513f6ff762543" args="()" -->
76 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a655d251389256b1e062513f6ff762543">showHistory</a> ()</td></tr>
77 <tr><td class="mdescLeft"> </td><td class="mdescRight">Shows history dialog. <br/></td></tr>
78 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#aaac2ae9385150bf83eb6c1d73e745e3c">historyNext</a> ()</td></tr>
79 <tr><td class="mdescLeft"> </td><td class="mdescRight">Shows translation of next word in history. <a href="#aaac2ae9385150bf83eb6c1d73e745e3c"></a><br/></td></tr>
80 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#ab3d88584e7391cedb791248dc7b13b78">historyPrev</a> ()</td></tr>
81 <tr><td class="mdescLeft"> </td><td class="mdescRight">Shows translation of previous word in history. <a href="#ab3d88584e7391cedb791248dc7b13b78"></a><br/></td></tr>
82 <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
83 <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a4acc6192d273eb38e9082b4934202b81">MainWindow</a> (<a class="el" href="classBackbone.html">Backbone</a> *backbone, QWidget *parent=0)</td></tr>
84 <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a4acc6192d273eb38e9082b4934202b81"></a><br/></td></tr>
85 <tr><td class="memItemLeft" align="right" valign="top">QHash< <a class="el" href="classCommonDictInterface.html">CommonDictInterface</a> <br class="typebreak"/>
86 *, bool > </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a0fd2d755ce951f3dfb535d555b957de7">getDictionaries</a> ()</td></tr>
87 <tr><td class="memItemLeft" align="right" valign="top">QList< <a class="el" href="classCommonDictInterface.html">CommonDictInterface</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a021ff10f30db21337b54b3dfaae0e9a0">getPlugins</a> ()</td></tr>
88 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns all loaded plugins. <a href="#a021ff10f30db21337b54b3dfaae0e9a0"></a><br/></td></tr>
89 <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a88a06565de22a608629bfa4a15ad5839">exactSearch</a> ()</td></tr>
90 <tr><td class="mdescLeft"> </td><td class="mdescRight">Indicates if GUI is in exact search mode. <a href="#a88a06565de22a608629bfa4a15ad5839"></a><br/></td></tr>
91 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a78e044c5bd7446b0d2105f98573b9489">setExactSearch</a> (bool)</td></tr>
92 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets GUI exact search mode. <a href="#a78e044c5bd7446b0d2105f98573b9489"></a><br/></td></tr>
93 <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add0b7276d39c6793611230fa90700d90"></a><!-- doxytag: member="MainWindow::settings" ref="add0b7276d39c6793611230fa90700d90" args="()" -->
94 <a class="el" href="classSettings.html">Settings</a> * </td><td class="memItemRight" valign="bottom"><b>settings</b> ()</td></tr>
95 <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14a1729a6506dc773b071dfbae596e66"></a><!-- doxytag: member="MainWindow::setSettings" ref="a14a1729a6506dc773b071dfbae596e66" args="(Settings *)" -->
96 void </td><td class="memItemRight" valign="bottom"><b>setSettings</b> (<a class="el" href="classSettings.html">Settings</a> *)</td></tr>
97 <tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
98 <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a38edb88d43e844aca9d2e762c8706565"></a><!-- doxytag: member="MainWindow::closeEvent" ref="a38edb88d43e844aca9d2e762c8706565" args="(QCloseEvent *)" -->
99 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classMainWindow.html#a38edb88d43e844aca9d2e762c8706565">closeEvent</a> (QCloseEvent *)</td></tr>
100 <tr><td class="mdescLeft"> </td><td class="mdescRight">When user wants to close application, we first sends signal to stop all ongoing searches. <br/></td></tr>
102 <hr/><a name="_details"></a><h2>Detailed Description</h2>
103 <p>Implements interface for GUI. </p>
104 <p>Create all of GUI subcomponents, and connects all GUI interface signals with suitable backbone signals and slots. Only this class has direct access to backbone object. It manages all request of subcomponents e. g. searching of given word, displaying history, removing dictionary. It also provide data from backbone to subcomponents e. g. result of search. </p>
105 <hr/><h2>Constructor & Destructor Documentation</h2>
106 <a class="anchor" id="a4acc6192d273eb38e9082b4934202b81"></a><!-- doxytag: member="MainWindow::MainWindow" ref="a4acc6192d273eb38e9082b4934202b81" args="(Backbone *backbone, QWidget *parent=0)" -->
107 <div class="memitem">
108 <div class="memproto">
109 <table class="memname">
111 <td class="memname">MainWindow::MainWindow </td>
113 <td class="paramtype"><a class="el" href="classBackbone.html">Backbone</a> * </td>
114 <td class="paramname"> <em>backbone</em>, </td>
117 <td class="paramkey"></td>
119 <td class="paramtype">QWidget * </td>
120 <td class="paramname"> <em>parent</em> = <code>0</code></td><td> </td>
125 <td></td><td></td><td><code> [explicit]</code></td>
132 <dl><dt><b>Parameters:</b></dt><dd>
133 <table border="0" cellspacing="2" cellpadding="0">
134 <tr><td valign="top"></td><td valign="top"><em>backbone</em> </td><td>object which will doing all searches and returns data </td></tr>
135 <tr><td valign="top"></td><td valign="top"><em>parent</em> </td><td>parent widget of this window </td></tr>
142 <hr/><h2>Member Function Documentation</h2>
143 <a class="anchor" id="ab88154764298f46e81f942262170f4b9"></a><!-- doxytag: member="MainWindow::addToHistory" ref="ab88154764298f46e81f942262170f4b9" args="(QList< Translation * >)" -->
144 <div class="memitem">
145 <div class="memproto">
146 <table class="memname">
148 <td class="memname">void MainWindow::addToHistory </td>
150 <td class="paramtype">QList< <a class="el" href="classTranslation.html">Translation</a> * > </td>
151 <td class="paramname"> <em>trans</em></td>
152 <td> ) </td>
153 <td><code> [virtual, slot]</code></td>
159 <p>Adds to history key words from given translations. </p>
160 <p>By default this slot is connected to signal searchTranslations, and passed translation list contains only translation with the same key, so only one word is added to history. </p>
161 <dl><dt><b>Parameters:</b></dt><dd>
162 <table border="0" cellspacing="2" cellpadding="0">
163 <tr><td valign="top"></td><td valign="top"><em>list</em> </td><td>of translations with key words </td></tr>
167 <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classGUIInterface.html#a9855cd24df15d961ec062f0c6b80a263" title="Emited when user wants to see translation of words.">searchTranslations()</a> </dd></dl>
169 <p>Implements <a class="el" href="classGUIInterface.html#a4081962fcbd7e8063bb87fcc444b6124">GUIInterface</a>.</p>
173 <a class="anchor" id="a88a06565de22a608629bfa4a15ad5839"></a><!-- doxytag: member="MainWindow::exactSearch" ref="a88a06565de22a608629bfa4a15ad5839" args="()" -->
174 <div class="memitem">
175 <div class="memproto">
176 <table class="memname">
178 <td class="memname">bool MainWindow::exactSearch </td>
180 <td class="paramname"></td>
181 <td> ) </td>
188 <p>Indicates if GUI is in exact search mode. </p>
189 <p>When GUI is in exact search mode it search for word, and if find exacly matching translation it directly displays it, whithout displaying matching word list. This mode is used for browsing search history and search words from application arguments. </p>
190 <dl class="return"><dt><b>Returns:</b></dt><dd>flag indicating if GUI is in exact search mode </dd></dl>
192 <p>Reimplemented from <a class="el" href="classGUIInterface.html#a83f7716f43447730aeda078cc202d48b">GUIInterface</a>.</p>
196 <a class="anchor" id="a0fd2d755ce951f3dfb535d555b957de7"></a><!-- doxytag: member="MainWindow::getDictionaries" ref="a0fd2d755ce951f3dfb535d555b957de7" args="()" -->
197 <div class="memitem">
198 <div class="memproto">
199 <table class="memname">
201 <td class="memname">QHash< <a class="el" href="classCommonDictInterface.html">CommonDictInterface</a> *, bool > MainWindow::getDictionaries </td>
203 <td class="paramname"></td>
204 <td> ) </td>
205 <td><code> [virtual]</code></td>
210 <p>Returns all loaded dictionaries with infromation about that they are active/inactive</p>
211 <dl class="return"><dt><b>Returns:</b></dt><dd>Hash of pointers to dictionary and boolean flag indicating if dictionary is active </dd></dl>
213 <p>Implements <a class="el" href="classGUIInterface.html#a65f5532b1d404c41f22e6408138bd87a">GUIInterface</a>.</p>
217 <a class="anchor" id="a021ff10f30db21337b54b3dfaae0e9a0"></a><!-- doxytag: member="MainWindow::getPlugins" ref="a021ff10f30db21337b54b3dfaae0e9a0" args="()" -->
218 <div class="memitem">
219 <div class="memproto">
220 <table class="memname">
222 <td class="memname">QList< <a class="el" href="classCommonDictInterface.html">CommonDictInterface</a> * > MainWindow::getPlugins </td>
224 <td class="paramname"></td>
225 <td> ) </td>
226 <td><code> [virtual]</code></td>
232 <p>Returns all loaded plugins. </p>
233 <dl class="return"><dt><b>Returns:</b></dt><dd>List of pointers to plugins </dd></dl>
235 <p>Implements <a class="el" href="classGUIInterface.html#a232872064056fdcfa752b314d9e34bfa">GUIInterface</a>.</p>
239 <a class="anchor" id="aaac2ae9385150bf83eb6c1d73e745e3c"></a><!-- doxytag: member="MainWindow::historyNext" ref="aaac2ae9385150bf83eb6c1d73e745e3c" args="()" -->
240 <div class="memitem">
241 <div class="memproto">
242 <table class="memname">
244 <td class="memname">void MainWindow::historyNext </td>
246 <td class="paramname"></td>
247 <td> ) </td>
248 <td><code> [virtual, slot]</code></td>
254 <p>Shows translation of next word in history. </p>
255 <p>It will work only if there is available next word in history. <a class="el" href="classTranslation.html" title="/file translation.h">Translation</a> of word is searched with <a class="el" href="classMainWindow.html#a16d0c7d46fc49bfa1cada597e349549a" title="Search in exact mode for given word.">searchExact()</a> function </p>
256 <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMainWindow.html#a16d0c7d46fc49bfa1cada597e349549a" title="Search in exact mode for given word.">searchExact()</a> </dd></dl>
258 <p>Implements <a class="el" href="classGUIInterface.html#a9b9d53a56b052cf4c7d5e5bc158b8036">GUIInterface</a>.</p>
262 <a class="anchor" id="ab3d88584e7391cedb791248dc7b13b78"></a><!-- doxytag: member="MainWindow::historyPrev" ref="ab3d88584e7391cedb791248dc7b13b78" args="()" -->
263 <div class="memitem">
264 <div class="memproto">
265 <table class="memname">
267 <td class="memname">void MainWindow::historyPrev </td>
269 <td class="paramname"></td>
270 <td> ) </td>
271 <td><code> [virtual, slot]</code></td>
277 <p>Shows translation of previous word in history. </p>
278 <p>It will work only if there is available previous word in history. <a class="el" href="classTranslation.html" title="/file translation.h">Translation</a> of word is searched with <a class="el" href="classMainWindow.html#a16d0c7d46fc49bfa1cada597e349549a" title="Search in exact mode for given word.">searchExact()</a> function </p>
279 <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMainWindow.html#a16d0c7d46fc49bfa1cada597e349549a" title="Search in exact mode for given word.">searchExact()</a> </dd></dl>
281 <p>Implements <a class="el" href="classGUIInterface.html#a47243e01c2d2e3887ee3fef656f84475">GUIInterface</a>.</p>
285 <a class="anchor" id="a16d0c7d46fc49bfa1cada597e349549a"></a><!-- doxytag: member="MainWindow::searchExact" ref="a16d0c7d46fc49bfa1cada597e349549a" args="(QString)" -->
286 <div class="memitem">
287 <div class="memproto">
288 <table class="memname">
290 <td class="memname">void MainWindow::searchExact </td>
292 <td class="paramtype">QString </td>
293 <td class="paramname"> <em>word</em></td>
294 <td> ) </td>
295 <td><code> [virtual, slot]</code></td>
301 <p>Search in exact mode for given word. </p>
302 <p>GUI will be automaticaly set into exact search mode, and after search or break will be unset from exact search mode. </p>
303 <dl><dt><b>Parameters:</b></dt><dd>
304 <table border="0" cellspacing="2" cellpadding="0">
305 <tr><td valign="top"></td><td valign="top"><em>word</em> </td><td>which will be searched in dictionaries </td></tr>
310 <p>Implements <a class="el" href="classGUIInterface.html#a39d3969fbadaea6da410a93dc3bebdd7">GUIInterface</a>.</p>
314 <a class="anchor" id="a78e044c5bd7446b0d2105f98573b9489"></a><!-- doxytag: member="MainWindow::setExactSearch" ref="a78e044c5bd7446b0d2105f98573b9489" args="(bool)" -->
315 <div class="memitem">
316 <div class="memproto">
317 <table class="memname">
319 <td class="memname">void MainWindow::setExactSearch </td>
321 <td class="paramtype">bool </td>
322 <td class="paramname"> <em>exact</em></td>
323 <td> ) </td>
330 <p>Sets GUI exact search mode. </p>
331 <p>When GUI is in exact search mode it search for word, and if find exacly matching translation it directly displays it, whithout displaying matching word list. This mode is used for browsing search history and search words from application arguments. </p>
332 <dl><dt><b>Parameters:</b></dt><dd>
333 <table border="0" cellspacing="2" cellpadding="0">
334 <tr><td valign="top"></td><td valign="top"><em>exactSearch</em> </td><td>flag indicating if GUI will be in exact search mode </td></tr>
338 <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMainWindow.html#a88a06565de22a608629bfa4a15ad5839" title="Indicates if GUI is in exact search mode.">exactSearch()</a> </dd></dl>
340 <p>Reimplemented from <a class="el" href="classGUIInterface.html#a4d9a8b5392fdbcec9a0b8663eba3c571">GUIInterface</a>.</p>
344 <a class="anchor" id="a9a56d2e699da84f9647984852cb6041b"></a><!-- doxytag: member="MainWindow::wordListReady" ref="a9a56d2e699da84f9647984852cb6041b" args="()" -->
345 <div class="memitem">
346 <div class="memproto">
347 <table class="memname">
349 <td class="memname">void MainWindow::wordListReady </td>
351 <td class="paramname"></td>
352 <td> ) </td>
353 <td><code> [virtual, slot]</code></td>
359 <p>Gets word list from backbone and prepares received list to display. </p>
360 <p>Checks if received list is empty, in that case displays suitable information. If GUI is in exact search mode it will search for exact word in received list, and if word is found it will emit signal to display it's translation. Otherwise it will display list of matching words and show suitable information. </p>
361 <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classMainWindow.html#a88a06565de22a608629bfa4a15ad5839" title="Indicates if GUI is in exact search mode.">exactSearch()</a> </dd>
363 <a class="el" href="classGUIInterface.html#a10454da99d774b68a38f1f0c374c4c51">showTranslation()</a> </dd></dl>
365 <p>Implements <a class="el" href="classGUIInterface.html#a0387f70e18b390cf1e229cbeb27a61c8">GUIInterface</a>.</p>
369 <hr/>The documentation for this class was generated from the following files:<ul>
370 <li><a class="el" href="MainWindow_8h_source.html">MainWindow.h</a></li>
371 <li>MainWindow.cpp</li>
374 <!--- window showing the filter options -->
375 <div id="MSearchSelectWindow"
376 onmouseover="return searchBox.OnSearchSelectShow()"
377 onmouseout="return searchBox.OnSearchSelectHide()"
378 onkeydown="return searchBox.OnSearchSelectKey(event)">
379 <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a></div>
381 <!-- iframe showing the search results (closed by default) -->
382 <div id="MSearchResultsWindow">
383 <iframe src="" frameborder="0"
384 name="MSearchResults" id="MSearchResults">
388 <hr class="footer"/><address style="text-align: right;"><small>Generated on Wed Aug 18 16:45:34 2010 for mDictionary by
389 <a href="http://www.doxygen.org/index.html">
390 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>