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 TQt, and distribute the resulting executable, 00021 without including the source code for TQt in the source distribution. 00022 */ 00023 #ifndef KOEDITORGENERAL_H 00024 #define KOEDITORGENERAL_H 00025 00026 #include <libkcal/alarm.h> 00027 #include <tqlineedit.h> 00028 00029 class TQWidget; 00030 class TQBoxLayout; 00031 class TQHBox; 00032 class TQLineEdit; 00033 class TQLabel; 00034 class TQCheckBox; 00035 class TQSpinBox; 00036 class TQPushButton; 00037 class TQComboBox; 00038 class KTextEdit; 00039 class KSqueezedTextLabel; 00040 class KURL; 00041 class KOEditorAttachments; 00042 00043 namespace KCal { 00044 class Incidence; 00045 class Calendar; 00046 } 00047 using namespace KCal; 00048 00049 class FocusLineEdit : public TQLineEdit 00050 { 00051 Q_OBJECT 00052 TQ_OBJECT 00053 public: 00054 FocusLineEdit( TQWidget *parent ); 00055 00056 signals: 00057 void focusReceivedSignal(); 00058 00059 protected: 00060 void focusInEvent ( TQFocusEvent *e ); 00061 00062 private: 00063 bool mSkipFirst; 00064 }; 00065 00066 class KOEditorGeneral : public TQObject 00067 { 00068 Q_OBJECT 00069 TQ_OBJECT 00070 public: 00071 KOEditorGeneral (TQObject* parent=0,const char* name=0); 00072 virtual ~KOEditorGeneral(); 00073 00074 void initHeader( TQWidget *parent,TQBoxLayout *topLayout ); 00075 void initDescription(TQWidget *,TQBoxLayout *); 00076 void initSecrecy(TQWidget *,TQBoxLayout *); 00077 void initAlarm(TQWidget *,TQBoxLayout *); 00078 void initAttachments(TQWidget *,TQBoxLayout *); 00079 00081 void setDefaults(bool allDay); 00083 void readIncidence( Incidence *incidence, Calendar *calendar ); 00085 void writeIncidence( Incidence *incidence ); 00086 00088 bool validateInput() { return true; } 00089 00090 void enableAlarm( bool enable ); 00091 void toggleAlarm( bool on ); 00092 00093 void setSummary( const TQString & ); 00094 void setDescription( const TQString & ); 00095 00096 TQObject *typeAheadReceiver() const; 00097 00098 public slots: 00099 void setCategories(const TQStringList &categories); 00100 void selectCategories(); 00101 void setType( const TQCString &type ); 00102 void addAttachments( const TQStringList &attachments, 00103 const TQStringList& mimeTypes = TQStringList(), 00104 bool inlineAttachment = false ); 00105 00106 protected slots: 00107 void editAlarms(); 00108 void updateAlarmWidgets( Incidence *incidence ); 00109 void updateDefaultAlarmTime(); 00110 void updateAttendeeSummary( int count ); 00111 00112 signals: 00113 void openCategoryDialog(); 00114 void updateCategoryConfig(); 00115 void focusReceivedSignal(); 00116 void openURL( const KURL & ); 00117 00118 protected: 00119 TQLineEdit *mSummaryEdit; 00120 TQLineEdit *mLocationEdit; 00121 TQLabel *mAttendeeSummaryLabel; 00122 TQLabel *mRecEditLabel; 00123 TQPushButton *mRecEditButton; 00124 TQLabel *mAlarmBell; 00125 TQLabel *mAlarmInfoLabel; 00126 TQCheckBox *mAlarmButton; 00127 TQSpinBox *mAlarmTimeEdit; 00128 TQComboBox *mAlarmIncrCombo; 00129 TQPushButton *mAlarmAdvancedButton; 00130 KTextEdit *mDescriptionEdit; 00131 TQLabel *mOwnerLabel; 00132 TQComboBox *mSecrecyCombo; 00133 TQPushButton *mCategoriesButton; 00134 KSqueezedTextLabel *mCategoriesLabel; 00135 KOEditorAttachments *mAttachments; 00136 TQLabel *mResourceLabel; 00137 00138 private: 00139 Alarm *alarmFromSimplePage( Incidence *incidence ) const; 00140 bool isSimpleAlarm( Alarm *alarm ) const; 00141 00142 bool mAlarmIsSimple; 00143 TQHBox *mSimpleAlarmBox; 00144 TQStringList mCategories; 00145 TQCString mType; // as in Incidence::type() 00146 KCal::Alarm::List mAlarmList; 00147 }; 00148 00149 #endif