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 QString &); 00094 00095 protected slots: 00096 void editAlarms(); 00097 void updateAlarmWidgets(); 00098 void updateDefaultAlarmTime(); 00099 00100 signals: 00101 void openCategoryDialog(); 00102 void focusReceivedSignal(); 00103 00104 protected: 00105 Alarm *alarmFromSimplePage() const; 00106 00107 QLineEdit *mSummaryEdit; 00108 QLineEdit *mLocationEdit; 00109 QLabel *mAlarmBell; 00110 QWidgetStack *mAlarmStack; 00111 QLabel *mAlarmInfoLabel; 00112 QCheckBox *mAlarmButton; 00113 QSpinBox *mAlarmTimeEdit; 00114 QComboBox *mAlarmIncrCombo; 00115 QPushButton *mAlarmEditButton; 00116 KTextEdit *mDescriptionEdit; 00117 QLabel *mOwnerLabel; 00118 QComboBox *mSecrecyCombo; 00119 QPushButton *mCategoriesButton; 00120 KSqueezedTextLabel *mCategoriesLabel; 00121 00122 enum AlarmStackPages { SimpleAlarmPage, AdvancedAlarmLabel }; 00123 00124 private: 00125 QString mCategories; 00126 KCal::Alarm::List mAlarmList; 00127 }; 00128 00129 #endif