5b399fb3f2bce952b3b4d55fde34b2db583aec9b
[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}\end{DoxyCompactItemize}
56 \subsection*{Protected Member Functions}
57 \begin{DoxyCompactItemize}
58 \item 
59 \hypertarget{classMainWindow_a38edb88d43e844aca9d2e762c8706565}{
60 void \hyperlink{classMainWindow_a38edb88d43e844aca9d2e762c8706565}{closeEvent} (QCloseEvent $\ast$)}
61 \label{classMainWindow_a38edb88d43e844aca9d2e762c8706565}
62
63 \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}
64
65
66 \subsection{Detailed Description}
67 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. 
68
69 \subsection{Constructor \& Destructor Documentation}
70 \hypertarget{classMainWindow_a4acc6192d273eb38e9082b4934202b81}{
71 \index{MainWindow@{MainWindow}!MainWindow@{MainWindow}}
72 \index{MainWindow@{MainWindow}!MainWindow@{MainWindow}}
73 \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{]}}}}
74 \label{classMainWindow_a4acc6192d273eb38e9082b4934202b81}
75
76
77 Constructor. 
78
79
80 \begin{DoxyParams}{Parameters}
81 \item[{\em backbone}]object which will doing all searches and returns data \item[{\em parent}]parent widget of this window \end{DoxyParams}
82
83
84 \subsection{Member Function Documentation}
85 \hypertarget{classMainWindow_ab88154764298f46e81f942262170f4b9}{
86 \index{MainWindow@{MainWindow}!addToHistory@{addToHistory}}
87 \index{addToHistory@{addToHistory}!MainWindow@{MainWindow}}
88 \subsubsection[{addToHistory}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::addToHistory (QList$<$ {\bf Translation} $\ast$ $>$ {\em trans})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
89 \label{classMainWindow_ab88154764298f46e81f942262170f4b9}
90
91
92 Adds to history key words from given translations. 
93
94 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. 
95 \begin{DoxyParams}{Parameters}
96 \item[{\em list}]of translations with key words \end{DoxyParams}
97 \begin{DoxySeeAlso}{See also}
98 \hyperlink{classGUIInterface_a9855cd24df15d961ec062f0c6b80a263}{searchTranslations()} 
99 \end{DoxySeeAlso}
100
101
102 Implements \hyperlink{classGUIInterface_a4081962fcbd7e8063bb87fcc444b6124}{GUIInterface}.
103
104 \hypertarget{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{
105 \index{MainWindow@{MainWindow}!exactSearch@{exactSearch}}
106 \index{exactSearch@{exactSearch}!MainWindow@{MainWindow}}
107 \subsubsection[{exactSearch}]{\setlength{\rightskip}{0pt plus 5cm}bool MainWindow::exactSearch ()}}
108 \label{classMainWindow_a88a06565de22a608629bfa4a15ad5839}
109
110
111 Indicates if GUI is in exact search mode. 
112
113 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}
114 flag indicating if GUI is in exact search mode 
115 \end{DoxyReturn}
116
117
118 Reimplemented from \hyperlink{classGUIInterface_a83f7716f43447730aeda078cc202d48b}{GUIInterface}.
119
120 \hypertarget{classMainWindow_a0fd2d755ce951f3dfb535d555b957de7}{
121 \index{MainWindow@{MainWindow}!getDictionaries@{getDictionaries}}
122 \index{getDictionaries@{getDictionaries}!MainWindow@{MainWindow}}
123 \subsubsection[{getDictionaries}]{\setlength{\rightskip}{0pt plus 5cm}QHash$<$ {\bf CommonDictInterface} $\ast$, bool $>$ MainWindow::getDictionaries ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
124 \label{classMainWindow_a0fd2d755ce951f3dfb535d555b957de7}
125 Returns all loaded dictionaries with infromation about that they are active/inactive
126
127 \begin{DoxyReturn}{Returns}
128 Hash of pointers to dictionary and boolean flag indicating if dictionary is active 
129 \end{DoxyReturn}
130
131
132 Implements \hyperlink{classGUIInterface_a65f5532b1d404c41f22e6408138bd87a}{GUIInterface}.
133
134 \hypertarget{classMainWindow_a021ff10f30db21337b54b3dfaae0e9a0}{
135 \index{MainWindow@{MainWindow}!getPlugins@{getPlugins}}
136 \index{getPlugins@{getPlugins}!MainWindow@{MainWindow}}
137 \subsubsection[{getPlugins}]{\setlength{\rightskip}{0pt plus 5cm}QList$<$ {\bf CommonDictInterface} $\ast$ $>$ MainWindow::getPlugins ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
138 \label{classMainWindow_a021ff10f30db21337b54b3dfaae0e9a0}
139
140
141 Returns all loaded plugins. 
142
143 \begin{DoxyReturn}{Returns}
144 List of pointers to plugins 
145 \end{DoxyReturn}
146
147
148 Implements \hyperlink{classGUIInterface_a232872064056fdcfa752b314d9e34bfa}{GUIInterface}.
149
150 \hypertarget{classMainWindow_aaac2ae9385150bf83eb6c1d73e745e3c}{
151 \index{MainWindow@{MainWindow}!historyNext@{historyNext}}
152 \index{historyNext@{historyNext}!MainWindow@{MainWindow}}
153 \subsubsection[{historyNext}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::historyNext ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
154 \label{classMainWindow_aaac2ae9385150bf83eb6c1d73e745e3c}
155
156
157 Shows translation of next word in history. 
158
159 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}
160 \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact()} 
161 \end{DoxySeeAlso}
162
163
164 Implements \hyperlink{classGUIInterface_a9b9d53a56b052cf4c7d5e5bc158b8036}{GUIInterface}.
165
166 \hypertarget{classMainWindow_ab3d88584e7391cedb791248dc7b13b78}{
167 \index{MainWindow@{MainWindow}!historyPrev@{historyPrev}}
168 \index{historyPrev@{historyPrev}!MainWindow@{MainWindow}}
169 \subsubsection[{historyPrev}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::historyPrev ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
170 \label{classMainWindow_ab3d88584e7391cedb791248dc7b13b78}
171
172
173 Shows translation of previous word in history. 
174
175 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}
176 \hyperlink{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{searchExact()} 
177 \end{DoxySeeAlso}
178
179
180 Implements \hyperlink{classGUIInterface_a47243e01c2d2e3887ee3fef656f84475}{GUIInterface}.
181
182 \hypertarget{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}{
183 \index{MainWindow@{MainWindow}!searchExact@{searchExact}}
184 \index{searchExact@{searchExact}!MainWindow@{MainWindow}}
185 \subsubsection[{searchExact}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::searchExact (QString {\em word})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
186 \label{classMainWindow_a16d0c7d46fc49bfa1cada597e349549a}
187
188
189 Search in exact mode for given word. 
190
191 GUI will be automaticaly set into exact search mode, and after search or break will be unset from exact search mode. 
192 \begin{DoxyParams}{Parameters}
193 \item[{\em word}]which will be searched in dictionaries \end{DoxyParams}
194
195
196 Implements \hyperlink{classGUIInterface_a39d3969fbadaea6da410a93dc3bebdd7}{GUIInterface}.
197
198 \hypertarget{classMainWindow_a78e044c5bd7446b0d2105f98573b9489}{
199 \index{MainWindow@{MainWindow}!setExactSearch@{setExactSearch}}
200 \index{setExactSearch@{setExactSearch}!MainWindow@{MainWindow}}
201 \subsubsection[{setExactSearch}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::setExactSearch (bool {\em exact})}}
202 \label{classMainWindow_a78e044c5bd7446b0d2105f98573b9489}
203
204
205 Sets GUI exact search mode. 
206
207 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. 
208 \begin{DoxyParams}{Parameters}
209 \item[{\em exactSearch}]flag indicating if GUI will be in exact search mode \end{DoxyParams}
210 \begin{DoxySeeAlso}{See also}
211 \hyperlink{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{exactSearch()} 
212 \end{DoxySeeAlso}
213
214
215 Reimplemented from \hyperlink{classGUIInterface_a4d9a8b5392fdbcec9a0b8663eba3c571}{GUIInterface}.
216
217 \hypertarget{classMainWindow_a9a56d2e699da84f9647984852cb6041b}{
218 \index{MainWindow@{MainWindow}!wordListReady@{wordListReady}}
219 \index{wordListReady@{wordListReady}!MainWindow@{MainWindow}}
220 \subsubsection[{wordListReady}]{\setlength{\rightskip}{0pt plus 5cm}void MainWindow::wordListReady ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual, slot\mbox{]}}}}
221 \label{classMainWindow_a9a56d2e699da84f9647984852cb6041b}
222
223
224 Gets word list from backbone and prepares received list to display. 
225
226 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}
227 \hyperlink{classMainWindow_a88a06565de22a608629bfa4a15ad5839}{exactSearch()} 
228
229 \hyperlink{classGUIInterface_a10454da99d774b68a38f1f0c374c4c51}{showTranslation()} 
230 \end{DoxySeeAlso}
231
232
233 Implements \hyperlink{classGUIInterface_a0387f70e18b390cf1e229cbeb27a61c8}{GUIInterface}.
234
235
236
237 The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
238 \item 
239 \hyperlink{MainWindow_8h}{MainWindow.h}\item 
240 MainWindow.cpp\end{DoxyCompactItemize}