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 QHBox;
00032 class QLineEdit;
00033 class QLabel;
00034 class QCheckBox;
00035 class QSpinBox;
00036 class QPushButton;
00037 class QComboBox;
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 QLineEdit
00050 {
00051     Q_OBJECT
00052   public:
00053     FocusLineEdit( QWidget *parent );
00054 
00055   signals:
00056     void focusReceivedSignal();
00057 
00058   protected:
00059     void focusInEvent ( QFocusEvent *e );
00060 
00061   private:
00062     bool mSkipFirst;
00063 };
00064 
00065 class KOEditorGeneral : public QObject
00066 {
00067     Q_OBJECT
00068   public:
00069     KOEditorGeneral (QObject* parent=0,const char* name=0);
00070     virtual ~KOEditorGeneral();
00071 
00072     void initHeader( QWidget *parent,QBoxLayout *topLayout );
00073     void initDescription(QWidget *,QBoxLayout *);
00074     void initSecrecy(QWidget *,QBoxLayout *);
00075     void initAlarm(QWidget *,QBoxLayout *);
00076     void initAttachments(QWidget *,QBoxLayout *);
00077 
00079     void setDefaults(bool allDay);
00081     void readIncidence( Incidence *incidence, Calendar *calendar );
00083     void writeIncidence( Incidence *incidence );
00084 
00086     bool validateInput() { return true; }
00087 
00088     void enableAlarm( bool enable );
00089     void toggleAlarm( bool on );
00090 
00091     void setSummary( const QString & );
00092     void setDescription( const QString & );
00093 
00094     QObject *typeAheadReceiver() const;
00095 
00096   public slots:
00097     void setCategories(const QStringList &categories);
00098     void selectCategories();
00099     void setType( const QCString &type );
00100     void addAttachments( const QStringList &attachments,
00101                          const QStringList& mimeTypes = QStringList(),
00102                          bool inlineAttachment = false );
00103 
00104   protected slots:
00105     void editAlarms();
00106     void updateAlarmWidgets( Incidence *incidence );
00107     void updateDefaultAlarmTime();
00108     void updateAttendeeSummary( int count );
00109 
00110   signals:
00111     void openCategoryDialog();
00112     void updateCategoryConfig();
00113     void focusReceivedSignal();
00114     void openURL( const KURL & );
00115 
00116   protected:
00117     QLineEdit               *mSummaryEdit;
00118     QLineEdit               *mLocationEdit;
00119     QLabel                  *mAttendeeSummaryLabel;
00120     QLabel                  *mRecEditLabel;
00121     QPushButton             *mRecEditButton;
00122     QLabel                  *mAlarmBell;
00123     QLabel                  *mAlarmInfoLabel;
00124     QCheckBox               *mAlarmButton;
00125     QSpinBox                *mAlarmTimeEdit;
00126     QComboBox               *mAlarmIncrCombo;
00127     QPushButton             *mAlarmAdvancedButton;
00128     KTextEdit               *mDescriptionEdit;
00129     QLabel                  *mOwnerLabel;
00130     QComboBox               *mSecrecyCombo;
00131     QPushButton             *mCategoriesButton;
00132     KSqueezedTextLabel      *mCategoriesLabel;
00133     KOEditorAttachments     *mAttachments;
00134     QLabel                  *mResourceLabel;
00135 
00136   private:
00137     Alarm *alarmFromSimplePage( Incidence *incidence ) const;
00138     bool isSimpleAlarm( Alarm *alarm ) const;
00139 
00140     bool mAlarmIsSimple;
00141     QHBox *mSimpleAlarmBox;
00142     QStringList mCategories;
00143     QCString mType; // as in Incidence::type()
00144     KCal::Alarm::List mAlarmList;
00145 };
00146 
00147 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys