kplato

kptcalendarlistdialog.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 - 2005 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation;
7 version 2 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPTCALENDARLISTDIALOG_H
21#define KPTCALENDARLISTDIALOG_H
22
23#include "kptcalendarlistdialogbase.h"
24#include "kptcalendaredit.h"
25#include "kptcalendar.h"
26
27#include <kdialogbase.h>
28
29#include <tqstring.h>
30
31class KCommand;
32
33namespace KPlato
34{
35
36class CalendarListViewItem;
37class Project;
38class Part;
39
40class CalendarListDialogImpl : public CalendarListDialogBase {
41 TQ_OBJECT
42
43public:
44 CalendarListDialogImpl(Project &project, TQWidget *parent);
45
46 void setBaseCalendars();
47
48 Calendar *getCalendar() { return calendar->getCalendar(); }
49 void setCalendar(Calendar *cal);
50
51 TQPtrList<CalendarListViewItem> &deletedItems();
52
53 void renameStopped(TQListViewItem *item);
54
55public slots:
56 void slotSelectionChanged();
57 void slotSelectionChanged(TQListViewItem *listItem);
58
59private slots:
60 void slotBaseCalendarActivated(int id);
61 void slotCalendarModified();
62 void slotDeleteClicked();
63 void slotAddClicked();
64 void slotEnableButtonOk(bool on);
65 void slotItemRenamed(TQListViewItem *item, int col);
66 void slotListDoubleClicked(TQListViewItem *item, const TQPoint&, int col);
67 void slotStartRename(TQListViewItem *item, int col);
68 void slotRenameStarted(TQListViewItem *item, int col);
69
70signals:
71 void obligatedFieldsFilled(bool yes);
72 void calendarModified();
73 void calendarChanged();
74 void enableButtonOk(bool on);
75
76 //internal
77 void renameStarted(TQListViewItem *, int);
78 void startRename(TQListViewItem *item, int col);
79 void selectionChanged();
80
81protected:
82 CalendarListViewItem *findItem(Calendar *cal);
83
84private:
85 Project &project;
86 TQPtrList<CalendarListViewItem> m_deletedItems;
87 TQPtrList<CalendarListViewItem> baseCalendarList;
88 TQListViewItem *m_renameItem;
89};
90
91class CalendarListDialog : public KDialogBase {
92 TQ_OBJECT
93
94public:
95 CalendarListDialog(Project &project, TQWidget *parent=0, const char *name=0);
96
97 KCommand *buildCommand(Part *part);
98
99protected slots:
100 void slotOk();
101
102private:
103 Project &project;
104 CalendarListDialogImpl *dia;
105};
106
107} //KPlato namespace
108
109#endif // CALENDARLISTDIALOG_H
Project is the main node in a project, it contains child nodes and possibly sub-projects.
Definition kptproject.h:52