kplato

kptcalendarlistdialog.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 - 2005 Dag Andersen <danders@get2net.dk>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation;
00007    version 2 of the License.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KPTCALENDARLISTDIALOG_H
00021 #define KPTCALENDARLISTDIALOG_H
00022 
00023 #include "kptcalendarlistdialogbase.h"
00024 #include "kptcalendaredit.h"
00025 #include "kptcalendar.h"
00026 
00027 #include <kdialogbase.h>
00028 
00029 #include <qstring.h>
00030 
00031 class KCommand;
00032 
00033 namespace KPlato
00034 {
00035 
00036 class CalendarListViewItem;
00037 class Project;
00038 class Part;
00039 
00040 class CalendarListDialogImpl : public CalendarListDialogBase {
00041     Q_OBJECT
00042 public:
00043     CalendarListDialogImpl(Project &project, QWidget *parent);
00044 
00045     void setBaseCalendars();
00046     
00047     Calendar *getCalendar() { return calendar->getCalendar(); }
00048     void setCalendar(Calendar *cal);
00049 
00050     QPtrList<CalendarListViewItem> &deletedItems();
00051 
00052     void renameStopped(QListViewItem *item);
00053 
00054 public slots:
00055     void slotSelectionChanged();
00056     void slotSelectionChanged(QListViewItem *listItem);
00057 
00058 private slots:
00059     void slotBaseCalendarActivated(int id);
00060     void slotCalendarModified();
00061     void slotDeleteClicked();
00062     void slotAddClicked();
00063     void slotEnableButtonOk(bool on);
00064     void slotItemRenamed(QListViewItem *item, int col);
00065     void slotListDoubleClicked(QListViewItem *item, const QPoint&, int col);
00066     void slotStartRename(QListViewItem *item, int col);
00067     void slotRenameStarted(QListViewItem *item, int col);
00068 
00069 signals:
00070     void obligatedFieldsFilled(bool yes);
00071     void calendarModified();
00072     void calendarChanged();
00073     void enableButtonOk(bool on);
00074 
00075     //internal
00076     void renameStarted(QListViewItem *, int);
00077     void startRename(QListViewItem *item, int col);
00078     void selectionChanged();
00079 
00080 protected:
00081     CalendarListViewItem *findItem(Calendar *cal);
00082     
00083 private:
00084     Project &project;
00085     QPtrList<CalendarListViewItem> m_deletedItems;
00086     QPtrList<CalendarListViewItem> baseCalendarList;
00087     QListViewItem *m_renameItem;
00088 };
00089 
00090 class CalendarListDialog : public KDialogBase {
00091     Q_OBJECT
00092 public:
00093     CalendarListDialog(Project &project, QWidget *parent=0, const char *name=0);
00094     
00095     KCommand *buildCommand(Part *part);
00096 
00097 protected slots:
00098     void slotOk();
00099     
00100 private:
00101     Project &project;
00102     CalendarListDialogImpl *dia;
00103 };
00104 
00105 }  //KPlato namespace
00106 
00107 #endif // CALENDARLISTDIALOG_H
KDE Home | KDE Accessibility Home | Description of Access Keys