parley
parley.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 00003 main part of Parley 00004 00005 ----------------------------------------------------------------------- 00006 00007 begin : Thu Mar 11 20:50:53 MET 1999 00008 00009 copyright : (C) 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de> 00010 (C) 2004-2007 Peter Hedlund <peter.hedlund@kdemail.net> 00011 (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net> 00012 00013 ----------------------------------------------------------------------- 00014 00015 ***************************************************************************/ 00016 00017 /*************************************************************************** 00018 * * 00019 * This program is free software; you can redistribute it and/or modify * 00020 * it under the terms of the GNU General Public License as published by * 00021 * the Free Software Foundation; either version 2 of the License, or * 00022 * (at your option) any later version. * 00023 * * 00024 ***************************************************************************/ 00025 00026 #ifndef PARLEY_H 00027 #define PARLEY_H 00028 00029 #include <KXmlGuiWindow> 00030 #include <KUrl> 00031 #include <QItemSelection> 00032 #include <QModelIndex> 00033 00034 #define IDS_DEFAULT I18N_NOOP("Ready.") 00035 00036 class KVTTableModel; 00037 class KVTSortFilterModel; 00038 class KVTTableView; 00039 class KVTLessonModel; 00040 class KVTLessonView; 00041 class PracticeManager; 00042 class EntryDlg; 00043 class KVTNewStuff; 00044 00045 class KEduVocDocument; 00046 class KLineEdit; 00047 class KComboBox; 00048 class KMessageBox; 00049 class KRecentFilesAction; 00050 class KAction; 00051 class QProgressBar; 00052 class QSplitter; 00053 class QLabel; 00054 00061 class ParleyApp : public KXmlGuiWindow 00062 { 00063 Q_OBJECT 00064 00065 public: 00067 ParleyApp(const QString& appName, QWidget *parent = 0); 00069 ~ParleyApp(); 00070 void initActions(); 00071 00073 void initStatusBar(); 00075 void initDoc(); 00077 void initModel(); 00079 QWidget* initLessonList(QWidget *parent); 00081 void initView(); 00083 void saveOptions(); 00084 00086 void updateTableFilter(); 00091 void makeLessonVisibleInTable(int lessonIndex); 00092 00097 virtual void saveProperties(KConfigGroup &); 00102 virtual void readProperties(const KConfigGroup &); 00103 00104 void removeProgressBar(); 00105 void prepareProgressBar(); 00106 00107 signals: 00108 void progressChanged(KEduVocDocument *, int curr_percent); 00109 00110 public slots: 00111 void slotUpdateWindowCaption(); 00112 00114 void slotSaveSelection(); 00115 void slotCancelSelection(); 00116 void slotSelectAll(); 00117 void slotProgress(KEduVocDocument*,int); 00118 00119 void slotCleanVocabulary(); 00120 00122 void slotEditLanguages(); 00123 00124 bool queryClose(); 00126 bool queryExit(); 00128 void slotGeneralOptions(); 00129 void slotApplyPreferences(); 00130 void slotLanguageProperties(); 00131 void slotDocumentProperties(); 00132 void slotShowStatistics(); 00133 00134 void startPractice(); 00135 void configurePractice(); 00136 00137 void slotTimeOutBackup(); 00138 00140 void slotFileNew(); 00142 void slotFileOpen(); 00144 void slotFileOpenRecent(const KUrl& url); 00146 void slotFileOpenExample(); 00148 void slotGHNS(); 00149 void loadFileFromPath(const KUrl &, bool addRecent = true); 00151 void slotFileMerge(); 00153 void slotFileSave(); 00155 void slotFileSaveAs(); 00156 void slotFilePrint(); 00157 void slotFileQuit(); 00158 00159 00161 void slotEditCopy(); 00162 00164 void slotNewEntry(); 00165 00167 void slotCutEntry(); 00168 00170 void slotDeleteEntry(); 00171 00172 00174 void slotEditPaste(); 00175 00177 // void slotStatusMsg(const QString &text); 00179 // void slotStatusHelpMsg(const QString &text); 00180 00181 void slotConfigShowSearch(); 00182 00186 void removeEntryDlg(); 00187 00188 private slots: 00194 void slotCurrentChanged(const QModelIndex &, const QModelIndex &); 00200 void slotSelectionChanged(const QItemSelection &, const QItemSelection &); 00201 00205 void slotCurrentLessonChanged(); 00206 00208 void slotEditEntry(); 00209 00210 private: 00214 void newDocumentWizard(); 00218 void initializeDefaultGrammar(); 00222 void createExampleEntries(); 00223 00225 // KAction pointers to enable/disable actions 00226 KRecentFilesAction* fileOpenRecent; 00227 KAction* editDelete; 00228 KAction* vocabShowSearchBar; 00229 00230 QString lastPixName; 00231 00233 KComboBox *m_lessonSelectionCombo; 00234 00236 KVTTableView *m_tableView; 00237 00239 KVTLessonView *m_lessonView; 00240 00242 QSplitter *m_mainSplitter; 00243 00244 QWidget *m_searchWidget; 00245 00249 KEduVocDocument *m_doc; 00250 00252 KVTTableModel *m_tableModel; 00253 KVTLessonModel *m_lessonModel; 00254 KVTSortFilterModel *m_sortFilterModel; 00255 00256 QString m_textToFind; 00257 00258 KLineEdit *m_searchLine; 00259 00260 EntryDlg *entryDlg; 00261 00262 QProgressBar *pbar; 00263 QLabel *m_pronunciationStatusBarLabel; 00264 QLabel *m_remarkStatusBarLabel; 00265 QLabel *m_typeStatusBarLabel; 00266 KVTNewStuff *m_newStuff; 00267 00268 // the name of the executable 00269 QString m_appName; 00270 }; 00271 00272 #endif // PARLEY_H 00273
KDE 4.0 API Reference