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 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 *event, Calendar *calendar);
00083     void writeIncidence(Incidence *);
00084 
00086     bool validateInput() { return true; }
00087 
00088     void enableAlarm( bool enable );
00089 
00090     void setSummary( const QString & );
00091     void setDescription( const QString & );
00092 
00093     QObject *typeAheadReceiver() const;
00094 
00095   public slots:
00096     void setCategories(const QStringList &categories);
00097     void selectCategories();
00098     void addAttachments( const QStringList &attachments,
00099                          const QStringList& mimeTypes = QStringList(),
00100                          bool inlineAttachment = false );
00101 
00102 
00103   protected slots:
00104     void editAlarms();
00105     void updateAlarmWidgets();
00106     void updateDefaultAlarmTime();
00107     void updateAttendeeSummary( int count );
00108 
00109   signals:
00110     void openCategoryDialog();
00111     void updateCategoryConfig();
00112     void focusReceivedSignal();
00113     void openURL( const KURL & );
00114   protected:
00115     Alarm *alarmFromSimplePage() const;
00116 
00117     QLineEdit               *mSummaryEdit;
00118     QLineEdit               *mLocationEdit;
00119     QLabel                  *mAttendeeSummaryLabel;
00120     QLabel                  *mAlarmBell;
00121     QWidgetStack            *mAlarmStack;
00122     QLabel                  *mAlarmInfoLabel;
00123     QCheckBox               *mAlarmButton;
00124     QSpinBox                *mAlarmTimeEdit;
00125     QComboBox               *mAlarmIncrCombo;
00126     QPushButton             *mAlarmEditButton;
00127     KTextEdit               *mDescriptionEdit;
00128     QLabel                  *mOwnerLabel;
00129     QComboBox               *mSecrecyCombo;
00130     QPushButton             *mCategoriesButton;
00131     KSqueezedTextLabel      *mCategoriesLabel;
00132     KOEditorAttachments     *mAttachments;
00133     QLabel                  *mResourceLabel;
00134 
00135     enum AlarmStackPages { SimpleAlarmPage, AdvancedAlarmLabel };
00136 
00137   private:
00138     QStringList mCategories;
00139     KCal::Alarm::List mAlarmList;
00140 };
00141 
00142 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys