1 /***************************************************************************
3 entry dialog for table cell contents
5 -----------------------------------------------------------------------
7 begin : Thu Mar 11 20:50:53 MET 1999
9 copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de>
10 (C) 2001 The KDE-EDU team
11 (C) 2005 Peter Hedlund <peter@peterandlinda.com>
13 -----------------------------------------------------------------------
15 ***************************************************************************
17 ***************************************************************************
19 * This program is free software; you can redistribute it and/or modify *
20 * it under the terms of the GNU General Public License as published by *
21 * the Free Software Foundation; either version 2 of the License, or *
22 * (at your option) any later version. *
24 ***************************************************************************/
26 #ifndef EntryDlg_included
27 #define EntryDlg_included
31 #include <kdialogbase.h>
33 #include "FromToEntryPage.h"
34 #include "CommonEntryPage.h"
35 #include "AuxInfoEntryPage.h"
36 #include "TenseEntryPage.h"
37 #include "AdjEntryPage.h"
38 #include "MCEntryPage.h"
45 class EntryDlg
: public KDialogBase
51 enum EditResult
{EditCancel
, EditApply
, EditUndo
, EditPageUp
, EditPageDown
, EditUp
, EditDown
, EditLeft
, EditRight
};
53 enum EnableType
{EnableAll
, EnableOnlyCommon
, EnableNone
, EnableOnlyOriginal
};
72 QComboBox
*_lessonBox
,
83 const Conjugation
&con_prefix
,
84 const Conjugation
&conjugations
,
85 const Article
&article
,
86 const Comparison
&comp
,
87 const MultipleChoice
&mc
,
88 QueryManager
&querymanager
,
115 QComboBox
*_lessonBox
,
126 const Conjugation
&con_prefix
,
127 const Conjugation
&conjugations
,
128 const Article
&article
,
129 const Comparison
&comp
,
130 const MultipleChoice
&mc
,
131 QueryManager
&querymanager
,
132 const QString
&title
,
135 bool fromDateDirty () const { return from_page
? from_page
->dateDirty() : false; }
136 bool fromGradeDirty () const { return from_page
? from_page
->gradeDirty() : false; }
137 bool fromBCountDirty () const { return from_page
? from_page
->bCountDirty() : false; }
138 bool fromQCountDirty () const { return from_page
? from_page
->qCountDirty() : false; }
139 QString
getFromFauxAmi () const { return from_page
? from_page
->getFauxAmi() : QString(""); }
141 time_t getFromDate () const { return from_page
? from_page
->getDate() : 0; }
142 grade_t
getFromGrade () const { return from_page
? from_page
->getGrade() : KV_NORM_GRADE
; }
143 count_t
getFromBCount () const { return from_page
? from_page
->getBCount() : 0; }
144 count_t
getFromQCount () const { return from_page
? from_page
->getQCount() : 0; }
146 bool toDateDirty () const { return to_page
? to_page
->dateDirty() : false; }
147 bool toGradeDirty () const { return to_page
? to_page
->gradeDirty() : false; }
148 bool toBCountDirty () const { return to_page
? to_page
->bCountDirty() : false; }
149 bool toQCountDirty () const { return to_page
? to_page
->qCountDirty() : false; }
150 QString
getToFauxAmi () const { return to_page
? to_page
->getFauxAmi() : QString(""); }
152 time_t getToDate () const { return to_page
? to_page
->getDate() : 0; }
153 grade_t
getToGrade () const { return to_page
? to_page
->getGrade() : KV_NORM_GRADE
; }
154 count_t
getToBCount () const { return to_page
? to_page
->getBCount() : 0; }
155 count_t
getToQCount () const { return to_page
? to_page
->getQCount() : 0; }
157 bool lessonDirty () const { return comm_page
->lessonDirty(); }
158 bool usageDirty () const { return comm_page
->usageDirty(); }
159 bool typeDirty () const { return comm_page
->typeDirty (); }
160 bool activeDirty () const { return comm_page
->activeDirty (); }
162 int getLesson () const { return comm_page
->getLesson(); }
163 QString
getType () const { return comm_page
->getType(); }
164 QString
getExpr () const { return comm_page
->getExpr(); }
165 QString
getPronunce () const { return comm_page
->getPronunce(); }
166 QString
getUsageLabel() const { return comm_page
->getUsageLabel(); }
167 bool getActive() const { return comm_page
->getActive(); }
169 QString
getSynonym () const { return aux_page
->getSynonym(); }
170 QString
getAntonym () const { return aux_page
->getAntonym(); }
171 QString
getRemark () const { return aux_page
->getRemark(); }
172 QString
getExample () const { return aux_page
->getExample(); }
173 QString
getParaphrase () const { return aux_page
->getParaphrase(); }
175 Conjugation
getConjugation() const { return tense_page
->getConjugation(); }
177 Comparison
getComparison() const { return adj_page
->getComparison(); }
179 MultipleChoice
getMultipleChoice() const { return mc_page
->getMultipleChoice(); }
182 void setModified(bool mod
);
183 void setEnabled(int);
185 void setCell(int row
, int col
, const vector
<QTableSelection
>& sel
);
186 void getCell(int &row
, int &col
, vector
<QTableSelection
>& sel
) const;
189 void sigEditChoice(int);
192 void slotDisplayModified();
195 void slotDockHorizontal();
196 void slotDockVertical();
199 void updatePages(const QString
&type
);
200 virtual void reject ();
203 virtual void closeEvent (QCloseEvent
*e
);
205 FromToEntryPage
*from_page
,
207 CommonEntryPage
*comm_page
;
208 AuxInfoEntryPage
*aux_page
;
209 TenseEntryPage
*tense_page
;
210 AdjEntryPage
*adj_page
;
211 MCEntryPage
*mc_page
;
212 int edit_row
, edit_col
;
215 vector
<QTableSelection
> selections
;
216 KMainWindow
*mainwin
;
222 #endif // EntryDlg_included