diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h')
-rw-r--r-- | kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h | 222 |
1 files changed, 222 insertions, 0 deletions
diff --git a/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h b/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h new file mode 100644 index 00000000..f349ccfc --- /dev/null +++ b/kvoctrain/kvoctrain/entry-dialogs/EntryDlg.h @@ -0,0 +1,222 @@ +/*************************************************************************** + + entry dialog for table cell contents + + ----------------------------------------------------------------------- + + begin : Thu Mar 11 20:50:53 MET 1999 + + copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de> + (C) 2001 The KDE-EDU team + (C) 2005 Peter Hedlund <peter.hedlund@kdemail.net> + + ----------------------------------------------------------------------- + + *************************************************************************** + + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef EntryDlg_included +#define EntryDlg_included + +#include <qtable.h> + +#include <kdialogbase.h> + +#include "FromToEntryPage.h" +#include "CommonEntryPage.h" +#include "AuxInfoEntryPage.h" +#include "TenseEntryPage.h" +#include "AdjEntryPage.h" +#include "MCEntryPage.h" + +class LangSet; +class QTabWidget; +class KMainWindow; +class kvoctrainDoc; + +class EntryDlg : public KDialogBase +{ + Q_OBJECT + +public: + + enum EditResult {EditCancel, EditApply, EditUndo, EditPageUp, EditPageDown, EditUp, EditDown, EditLeft, EditRight}; + + enum EnableType {EnableAll, EnableOnlyCommon, EnableNone, EnableOnlyOriginal }; + + EntryDlg + ( KMainWindow *main, + kvoctrainDoc *doc, + bool multi_sel, + bool origin, + grade_t f_grd, + grade_t t_grd, + count_t f_qcount, + count_t t_qcount, + count_t f_bcount, + count_t t_bcount, + time_t f_qdate, + time_t t_qdate, + QString f_faux_ami, + QString t_faux_ami, + QString _expr, + int _lesson, + QComboBox *_lessonBox, + QString lang, + LangSet &langset, + QString remark, + QString _type, + QString pronunce, + QString synonym, + QString antonym, + QString example, + QString usagelabel, + QString paraphrase, + const Conjugation &con_prefix, + const Conjugation &conjugations, + const Article &article, + const Comparison &comp, + const MultipleChoice &mc, + QueryManager &querymanager, + const QString &title, + bool active, + const QFont& ipafont, + QWidget *parent = 0, + const char *name = 0, + bool modal = false + ); + + ~EntryDlg (); + + void setData + (kvoctrainDoc *doc, + bool multi_sel, + bool origin, + grade_t f_grd, + grade_t t_grd, + count_t f_qcount, + count_t t_qcount, + count_t f_bcount, + count_t t_bcount, + time_t f_qdate, + time_t t_qdate, + QString f_faux_ami, + QString t_faux_ami, + QString _expr, + int _lesson, + QComboBox *_lessonBox, + QString lang, + LangSet &langset, + QString remark, + QString _type, + QString pronunce, + QString synonym, + QString antonym, + QString example, + QString usagelabel, + QString paraphrase, + const Conjugation &con_prefix, + const Conjugation &conjugations, + const Article &article, + const Comparison &comp, + const MultipleChoice &mc, + QueryManager &querymanager, + const QString &title, + bool active); + + bool fromDateDirty () const { return from_page ? from_page->dateDirty() : false; } + bool fromGradeDirty () const { return from_page ? from_page->gradeDirty() : false; } + bool fromBCountDirty () const { return from_page ? from_page->bCountDirty() : false; } + bool fromQCountDirty () const { return from_page ? from_page->qCountDirty() : false; } + QString getFromFauxAmi () const { return from_page ? from_page->getFauxAmi() : QString(""); } + + time_t getFromDate () const { return from_page ? from_page->getDate() : 0; } + grade_t getFromGrade () const { return from_page ? from_page->getGrade() : KV_NORM_GRADE; } + count_t getFromBCount () const { return from_page ? from_page->getBCount() : 0; } + count_t getFromQCount () const { return from_page ? from_page->getQCount() : 0; } + + bool toDateDirty () const { return to_page ? to_page->dateDirty() : false; } + bool toGradeDirty () const { return to_page ? to_page->gradeDirty() : false; } + bool toBCountDirty () const { return to_page ? to_page->bCountDirty() : false; } + bool toQCountDirty () const { return to_page ? to_page->qCountDirty() : false; } + QString getToFauxAmi () const { return to_page ? to_page->getFauxAmi() : QString(""); } + + time_t getToDate () const { return to_page ? to_page->getDate() : 0; } + grade_t getToGrade () const { return to_page ? to_page->getGrade() : KV_NORM_GRADE; } + count_t getToBCount () const { return to_page ? to_page->getBCount() : 0; } + count_t getToQCount () const { return to_page ? to_page->getQCount() : 0; } + + bool lessonDirty () const { return comm_page->lessonDirty(); } + bool usageDirty () const { return comm_page->usageDirty(); } + bool typeDirty () const { return comm_page->typeDirty (); } + bool activeDirty () const { return comm_page->activeDirty (); } + + int getLesson () const { return comm_page->getLesson(); } + QString getType () const { return comm_page->getType(); } + QString getExpr () const { return comm_page->getExpr(); } + QString getPronunce () const { return comm_page->getPronunce(); } + QString getUsageLabel() const { return comm_page->getUsageLabel(); } + bool getActive() const { return comm_page->getActive(); } + + QString getSynonym () const { return aux_page->getSynonym(); } + QString getAntonym () const { return aux_page->getAntonym(); } + QString getRemark () const { return aux_page->getRemark(); } + QString getExample () const { return aux_page->getExample(); } + QString getParaphrase () const { return aux_page->getParaphrase(); } + + Conjugation getConjugation() const { return tense_page->getConjugation(); } + + Comparison getComparison() const { return adj_page->getComparison(); } + + MultipleChoice getMultipleChoice() const { return mc_page->getMultipleChoice(); } + + bool isModified(); + void setModified(bool mod); + void setEnabled(int); + + void setCell(int row, int col, const vector<QTableSelection>& sel); + void getCell(int &row, int &col, vector<QTableSelection>& sel) const; + +signals: + void sigEditChoice(int); + +public slots: + void slotDisplayModified(); + void slotApply(); + void slotUndo(); + void slotDockHorizontal(); + void slotDockVertical(); + +protected slots: + void updatePages(const QString &type); + virtual void reject (); + +protected: + virtual void closeEvent (QCloseEvent*e); + + FromToEntryPage *from_page, + *to_page; + CommonEntryPage *comm_page; + AuxInfoEntryPage *aux_page; + TenseEntryPage *tense_page; + AdjEntryPage *adj_page; + MCEntryPage *mc_page; + int edit_row, edit_col; + QTabWidget *tabber; + + vector<QTableSelection> selections; + KMainWindow *mainwin; + QSize oldMainSize; + QPoint oldMainPos; + bool docked; +}; + +#endif // EntryDlg_included |