korganizer
koeditorgeneral.h
00001 /* 00002 This file is part of KOrganizer. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 00019 As a special exception, permission is given to link this program 00020 with any edition of Qt, and distribute the resulting executable, 00021 without including the source code for Qt in the source distribution. 00022 */ 00023 #ifndef KOEDITORGENERAL_H 00024 #define KOEDITORGENERAL_H 00025 00026 #include <libkcal/alarm.h> 00027 #include <qlineedit.h> 00028 00029 class QWidget; 00030 class QBoxLayout; 00031 class QLineEdit; 00032 class QLabel; 00033 class QCheckBox; 00034 class QWidgetStack; 00035 class QSpinBox; 00036 class QPushButton; 00037 class QComboBox; 00038 class KTextEdit; 00039 class KSqueezedTextLabel; 00040 00041 namespace KCal { 00042 class Incidence; 00043 } 00044 using namespace KCal; 00045 00046 class FocusLineEdit : public QLineEdit 00047 { 00048 Q_OBJECT 00049 public: 00050 FocusLineEdit( QWidget *parent ); 00051 00052 signals: 00053 void focusReceivedSignal(); 00054 00055 protected: 00056 void focusInEvent ( QFocusEvent *e ); 00057 00058 private: 00059 bool mSkipFirst; 00060 }; 00061 00062 class KOEditorGeneral : public QObject 00063 { 00064 Q_OBJECT 00065 public: 00066 KOEditorGeneral (QObject* parent=0,const char* name=0); 00067 virtual ~KOEditorGeneral(); 00068 00069 void initHeader(QWidget *,QBoxLayout *); 00070 void initDescription(QWidget *,QBoxLayout *); 00071 void initSecrecy(QWidget *,QBoxLayout *); 00072 void initCategories(QWidget *,QBoxLayout *); 00073 void initAlarm(QWidget *,QBoxLayout *); 00074 00076 void setDefaults(bool allDay); 00078 void readIncidence(Incidence *); 00080 void writeIncidence(Incidence *); 00081 00083 bool validateInput() { return true; } 00084 00085 void enableAlarm( bool enable ); 00086 00087 void setSummary( const QString & ); 00088 void setDescription( const QString & ); 00089 00090 QObject *typeAheadReceiver() const; 00091 00092 public slots: 00093 void setCategories(const QStringList &categories); 00094 void selectCategories(); 00095 00096 protected slots: 00097 void editAlarms(); 00098 void updateAlarmWidgets(); 00099 void updateDefaultAlarmTime(); 00100 00101 signals: 00102 void openCategoryDialog(); 00103 void focusReceivedSignal(); 00104 00105 protected: 00106 Alarm *alarmFromSimplePage() const; 00107 00108 QLineEdit *mSummaryEdit; 00109 QLineEdit *mLocationEdit; 00110 QLabel *mAlarmBell; 00111 QWidgetStack *mAlarmStack; 00112 QLabel *mAlarmInfoLabel; 00113 QCheckBox *mAlarmButton; 00114 QSpinBox *mAlarmTimeEdit; 00115 QComboBox *mAlarmIncrCombo; 00116 QPushButton *mAlarmEditButton; 00117 KTextEdit *mDescriptionEdit; 00118 QLabel *mOwnerLabel; 00119 QComboBox *mSecrecyCombo; 00120 QPushButton *mCategoriesButton; 00121 KSqueezedTextLabel *mCategoriesLabel; 00122 00123 enum AlarmStackPages { SimpleAlarmPage, AdvancedAlarmLabel }; 00124 00125 private: 00126 QStringList mCategories; 00127 KCal::Alarm::List mAlarmList; 00128 }; 00129 00130 #endif