Deleting notifies after user close it
[mdictionary] / doc / latex / classMainWindow.tex
1 \hypertarget{classMainWindow}{
2 \section{MainWindow Class Reference}
3 \label{classMainWindow}\index{MainWindow@{MainWindow}}
4 }
5
6
7 Implements interface for GUI.  
8
9
10
11
12 {\ttfamily \#include $<$MainWindow.h$>$}
13
14 Inheritance diagram for MainWindow:\begin{figure}[H]
15 \begin{center}
16 \leavevmode
17 \includegraphics[height=2cm]{classMainWindow}
18 \end{center}
19 \end{figure}
20 \subsection*{Public Slots}
21 \begin{DoxyCompactItemize}
22 \item 
23 void \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact} (QString)
24 \begin{DoxyCompactList}\small\item\em Search in exact mode for given word. \item\end{DoxyCompactList}\item 
25 void \hyperlink{classMainWindow_a9a56d2e699da84f9647984852cb6041b}{wordListReady} ()
26 \begin{DoxyCompactList}\small\item\em Gets word list from backbone and prepares received list to display. \item\end{DoxyCompactList}\item 
27 \hypertarget{classMainWindow_afea3664ab8d180bc705b552b7f745136}{
28 void \hyperlink{classMainWindow_afea3664ab8d180bc705b552b7f745136}{translationsReady} ()}
29 \label{classMainWindow_afea3664ab8d180bc705b552b7f745136}
30
31 \begin{DoxyCompactList}\small\item\em Gets translation strings from backbone and emit signal to display them. \item\end{DoxyCompactList}\item 
32 void \hyperlink{classMainWindow_ab88154764298f46e81f942262170f4b9}{addToHistory} (QList$<$ \hyperlink{classTranslation}{Translation} $\ast$ $>$)
33 \begin{DoxyCompactList}\small\item\em Adds to history key words from given translations. \item\end{DoxyCompactList}\item 
34 \hypertarget{classMainWindow_a655d251389256b1e062513f6ff762543}{
35 void \hyperlink{classMainWindow_a655d251389256b1e062513f6ff762543}{showHistory} ()}
36 \label{classMainWindow_a655d251389256b1e062513f6ff762543}
37
38 \begin{DoxyCompactList}\small\item\em Shows history dialog. \item\end{DoxyCompactList}\item 
39 void \hyperlink{classMainWindow_aaac2ae9385150bf83eb6c1d73e745e3c}{historyNext} ()
40 \begin{DoxyCompactList}\small\item\em Shows translation of next word in history. \item\end{DoxyCompactList}\item 
41 void \hyperlink{classMainWindow_ab3d88584e7391cedb791248dc7b13b78}{historyPrev} ()
42 \begin{DoxyCompactList}\small\item\em Shows translation of previous word in history. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
43 \subsection*{Public Member Functions}
44 \begin{DoxyCompactItemize}
45 \item 
46 \hyperlink{classMainWindow_a4acc6192d273eb38e9082b4934202b81}{MainWindow} (\hyperlink{classBackbone}{Backbone} $\ast$backbone, QWidget $\ast$parent=0)
47 \begin{DoxyCompactList}\small\item\em Constructor. \item\end{DoxyCompactList}\item 
48 QHash$<$ \hyperlink{classCommonDictInterface}{CommonDictInterface} $\ast$, bool $>$ \hyperlink{classMainWindow_a0fd2d755ce951f3dfb535d555b957de7}{getDictionaries} ()
49 \item 
50 QList$<$ \hyperlink{classCommonDictInterface}{CommonDictInterface} $\ast$ $>$ \hyperlink{classMainWindow_a021ff10f30db21337b54b3dfaae0e9a0}{getPlugins} ()
51 \begin{DoxyCompactList}\small\item\em Returns all loaded plugins. \item\end{DoxyCompactList}\item 
52 bool \hyperlink{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{exactSearch} ()
53 \begin{DoxyCompactList}\small\item\em Indicates if GUI is in exact search mode. \item\end{DoxyCompactList}\item 
54 void \hyperlink{classMainWindow_a78e044c5bd7446b0d2105f98573b9489}{setExactSearch} (bool)
55 \begin{DoxyCompactList}\small\item\em Sets GUI exact search mode. \item\end{DoxyCompactList}\item 
56 \hypertarget{classMainWindow_add0b7276d39c6793611230fa90700d90}{
57 \hyperlink{classSettings}{Settings} $\ast$ {\bfseries settings} ()}
58 \label{classMainWindow_add0b7276d39c6793611230fa90700d90}
59
60 \item 
61 \hypertarget{classMainWindow_a14a1729a6506dc773b071dfbae596e66}{
62 void {\bfseries setSettings} (\hyperlink{classSettings}{Settings} $\ast$)}
63 \label{classMainWindow_a14a1729a6506dc773b071dfbae596e66}
64
65 \end{DoxyCompactItemize}
66 \subsection*{Protected Member Functions}
67 \begin{DoxyCompactItemize}
68 \item 
69 \hypertarget{classMainWindow_a38edb88d43e844aca9d2e762c8706565}{
70 void \hyperlink{classMainWindow_a38edb88d43e844aca9d2e762c8706565}{closeEvent} (QCloseEvent $\ast$)}
71 \label{classMainWindow_a38edb88d43e844aca9d2e762c8706565}
72
73 \begin{DoxyCompactList}\small\item\em When user wants to close application, we first sends signal to stop all ongoing searches. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
74
75
76 \subsection{Detailed Description}
77 Implements interface for GUI. 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. 
78
79 \subsection{Constructor \& Destructor Documentation}
80 \hypertarget{classMainWindow_a4acc6192d273eb38e9082b4934202b81}{
81 \index{MainWindow@{MainWindow}!MainWindow@{MainWindow}}
82 \index{MainWindow@{MainWindow}!MainWindow@{MainWindow}}
83 \subsubsection[{MainWindow}]{\setlength{\rightskip}{0pt plus 5cm}MainWindow::MainWindow ({\bf Backbone} $\ast$ {\em backbone}, \/  QWidget $\ast$ {\em parent} = {\ttfamily 0})\hspace{0.3cm}{\ttfamily  \mbox{[}explicit\mbox{]}}}}
84 \label{classMainWindow_a4acc6192d273eb38e9082b4934202b81}
85
86
87 Constructor. 
88
89
90 \begin{DoxyParams}{Parameters}
91 \item[{\em backbone}]object which will doing all searches and returns data \item[{\em parent}]parent widget of this window \end{DoxyParams}
92
93
94 \subsection{Member Function Documentation}
95 \hypertarget{classMainWindow_ab88154764298f46e81f942262170f4b9}{
96 \index{MainWindow@{MainWindow}!addToHistory@{addToHistory}}
97 \index{addToHistory@{addToHistory}!MainWindow@{MainWindow}}
98 \subsubsection[{addToHistory}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::addToHistory (QList$<$ {\bf Translation} $\ast$ $>$ {\em trans})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
99 \label{classMainWindow_ab88154764298f46e81f942262170f4b9}
100
101
102 Adds to history key words from given translations. 
103
104 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. 
105 \begin{DoxyParams}{Parameters}
106 \item[{\em list}]of translations with key words \end{DoxyParams}
107 \begin{DoxySeeAlso}{See also}
108 \hyperlink{classGUIInterface_a9855cd24df15d961ec062f0c6b80a263}{searchTranslations()} 
109 \end{DoxySeeAlso}
110
111
112 Implements \hyperlink{classGUIInterface_a4081962fcbd7e8063bb87fcc444b6124}{GUIInterface}.
113
114 \hypertarget{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{
115 \index{MainWindow@{MainWindow}!exactSearch@{exactSearch}}
116 \index{exactSearch@{exactSearch}!MainWindow@{MainWindow}}
117 \subsubsection[{exactSearch}]{\setlength{\rightskip}{0pt plus 5cm}bool MainWindow::exactSearch ()}}
118 \label{classMainWindow_a88a06565de22a608629bfa4a15ad5839}
119
120
121 Indicates if GUI is in exact search mode. 
122
123 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. \begin{DoxyReturn}{Returns}
124 flag indicating if GUI is in exact search mode 
125 \end{DoxyReturn}
126
127
128 Reimplemented from \hyperlink{classGUIInterface_a83f7716f43447730aeda078cc202d48b}{GUIInterface}.
129
130 \hypertarget{classMainWindow_a0fd2d755ce951f3dfb535d555b957de7}{
131 \index{MainWindow@{MainWindow}!getDictionaries@{getDictionaries}}
132 \index{getDictionaries@{getDictionaries}!MainWindow@{MainWindow}}
133 \subsubsection[{getDictionaries}]{\setlength{\rightskip}{0pt plus 5cm}QHash$<$ {\bf CommonDictInterface} $\ast$, bool $>$ MainWindow::getDictionaries ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
134 \label{classMainWindow_a0fd2d755ce951f3dfb535d555b957de7}
135 Returns all loaded dictionaries with infromation about that they are active/inactive
136
137 \begin{DoxyReturn}{Returns}
138 Hash of pointers to dictionary and boolean flag indicating if dictionary is active 
139 \end{DoxyReturn}
140
141
142 Implements \hyperlink{classGUIInterface_a65f5532b1d404c41f22e6408138bd87a}{GUIInterface}.
143
144 \hypertarget{classMainWindow_a021ff10f30db21337b54b3dfaae0e9a0}{
145 \index{MainWindow@{MainWindow}!getPlugins@{getPlugins}}
146 \index{getPlugins@{getPlugins}!MainWindow@{MainWindow}}
147 \subsubsection[{getPlugins}]{\setlength{\rightskip}{0pt plus 5cm}QList$<$ {\bf CommonDictInterface} $\ast$ $>$ MainWindow::getPlugins ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
148 \label{classMainWindow_a021ff10f30db21337b54b3dfaae0e9a0}
149
150
151 Returns all loaded plugins. 
152
153 \begin{DoxyReturn}{Returns}
154 List of pointers to plugins 
155 \end{DoxyReturn}
156
157
158 Implements \hyperlink{classGUIInterface_a232872064056fdcfa752b314d9e34bfa}{GUIInterface}.
159
160 \hypertarget{classMainWindow_aaac2ae9385150bf83eb6c1d73e745e3c}{
161 \index{MainWindow@{MainWindow}!historyNext@{historyNext}}
162 \index{historyNext@{historyNext}!MainWindow@{MainWindow}}
163 \subsubsection[{historyNext}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::historyNext ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
164 \label{classMainWindow_aaac2ae9385150bf83eb6c1d73e745e3c}
165
166
167 Shows translation of next word in history. 
168
169 It will work only if there is available next word in history. \hyperlink{classTranslation}{Translation} of word is searched with \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact()} function \begin{DoxySeeAlso}{See also}
170 \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact()} 
171 \end{DoxySeeAlso}
172
173
174 Implements \hyperlink{classGUIInterface_a9b9d53a56b052cf4c7d5e5bc158b8036}{GUIInterface}.
175
176 \hypertarget{classMainWindow_ab3d88584e7391cedb791248dc7b13b78}{
177 \index{MainWindow@{MainWindow}!historyPrev@{historyPrev}}
178 \index{historyPrev@{historyPrev}!MainWindow@{MainWindow}}
179 \subsubsection[{historyPrev}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::historyPrev ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
180 \label{classMainWindow_ab3d88584e7391cedb791248dc7b13b78}
181
182
183 Shows translation of previous word in history. 
184
185 It will work only if there is available previous word in history. \hyperlink{classTranslation}{Translation} of word is searched with \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact()} function \begin{DoxySeeAlso}{See also}
186 \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact()} 
187 \end{DoxySeeAlso}
188
189
190 Implements \hyperlink{classGUIInterface_a47243e01c2d2e3887ee3fef656f84475}{GUIInterface}.
191
192 \hypertarget{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{
193 \index{MainWindow@{MainWindow}!searchExact@{searchExact}}
194 \index{searchExact@{searchExact}!MainWindow@{MainWindow}}
195 \subsubsection[{searchExact}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::searchExact (QString {\em word})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
196 \label{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}
197
198
199 Search in exact mode for given word. 
200
201 GUI will be automaticaly set into exact search mode, and after search or break will be unset from exact search mode. 
202 \begin{DoxyParams}{Parameters}
203 \item[{\em word}]which will be searched in dictionaries \end{DoxyParams}
204
205
206 Implements \hyperlink{classGUIInterface_a39d3969fbadaea6da410a93dc3bebdd7}{GUIInterface}.
207
208 \hypertarget{classMainWindow_a78e044c5bd7446b0d2105f98573b9489}{
209 \index{MainWindow@{MainWindow}!setExactSearch@{setExactSearch}}
210 \index{setExactSearch@{setExactSearch}!MainWindow@{MainWindow}}
211 \subsubsection[{setExactSearch}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::setExactSearch (bool {\em exact})}}
212 \label{classMainWindow_a78e044c5bd7446b0d2105f98573b9489}
213
214
215 Sets GUI exact search mode. 
216
217 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. 
218 \begin{DoxyParams}{Parameters}
219 \item[{\em exactSearch}]flag indicating if GUI will be in exact search mode \end{DoxyParams}
220 \begin{DoxySeeAlso}{See also}
221 \hyperlink{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{exactSearch()} 
222 \end{DoxySeeAlso}
223
224
225 Reimplemented from \hyperlink{classGUIInterface_a4d9a8b5392fdbcec9a0b8663eba3c571}{GUIInterface}.
226
227 \hypertarget{classMainWindow_a9a56d2e699da84f9647984852cb6041b}{
228 \index{MainWindow@{MainWindow}!wordListReady@{wordListReady}}
229 \index{wordListReady@{wordListReady}!MainWindow@{MainWindow}}
230 \subsubsection[{wordListReady}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::wordListReady ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
231 \label{classMainWindow_a9a56d2e699da84f9647984852cb6041b}
232
233
234 Gets word list from backbone and prepares received list to display. 
235
236 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. \begin{DoxySeeAlso}{See also}
237 \hyperlink{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{exactSearch()} 
238
239 \hyperlink{classGUIInterface_a10454da99d774b68a38f1f0c374c4c51}{showTranslation()} 
240 \end{DoxySeeAlso}
241
242
243 Implements \hyperlink{classGUIInterface_a0387f70e18b390cf1e229cbeb27a61c8}{GUIInterface}.
244
245
246
247 The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
248 \item 
249 \hyperlink{MainWindow_8h}{MainWindow.h}\item 
250 MainWindow.cpp\end{DoxyCompactItemize}