korganizer

kotodoeditor.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 1997, 1998 Preston Brown <pbrown@kde.org>
5  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
6  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 
22  As a special exception, permission is given to link this program
23  with any edition of TQt, and distribute the resulting executable,
24  without including the source code for TQt in the source distribution.
25 */
26 #ifndef _KOTODOEDITOR_H
27 #define _KOTODOEDITOR_H
28 
29 #include "koincidenceeditor.h"
30 
31 class TQDateTime;
32 class KOEditorGeneralTodo;
33 class KOEditorRecurrence;
38 {
39  TQ_OBJECT
40 
41  public:
45  KOTodoEditor( Calendar *calendar, TQWidget *parent );
46  virtual ~KOTodoEditor();
47 
48  void init();
49 
50  void reload();
51 
55  void newTodo();
56 
62  void setTexts( const TQString &summary, const TQString &description = TQString() );
64  void editIncidence(Incidence *incidence, const TQDate &date, Calendar* calendar);
65 
67  void setDates( const TQDateTime &due, bool allDay = true, Todo *relatedTodo = 0 );
69  void readTodo(Todo *todo, Calendar *calendar, const TQDate &date);
71  void writeTodo(Todo *);
72 
74  bool validateInput();
77  bool processInput();
78 
80  void modified();
81 
82  protected slots:
83  void loadDefaults();
84  void deleteTodo();
85 
86  void slotSaveTemplate( const TQString & );
87  void updateRecurrenceSummary();
88 
89  protected:
90  void loadTemplate( /*const*/ CalendarLocal& );
91  TQStringList& templates() const;
92  TQString type() { return "Todo"; }
93  void setupGeneral();
94  void setupRecurrence();
95  int msgItemDelete();
96 
97  private:
98  Todo *mTodo;
99  Calendar *mCalendar;
100 
101  Todo *mRelatedTodo;
102 
103  KOEditorGeneralTodo *mGeneral;
104  KOEditorRecurrenceDialog *mRecurrenceDialog;
105  KOEditorRecurrence *mRecurrence;
106 };
107 
108 #endif
This is the base class for the calendar component editors.
This class provides a dialog for editing a Todo.
Definition: kotodoeditor.h:38
void readTodo(Todo *todo, Calendar *calendar, const TQDate &date)
Read event object and setup widgets accordingly.
void init()
Initialize editor.
void setTexts(const TQString &summary, const TQString &description=TQString())
Sets the given summary and description.
void setDates(const TQDateTime &due, bool allDay=true, Todo *relatedTodo=0)
Set widgets to default values.
void newTodo()
Edit new todo.
KOTodoEditor(Calendar *calendar, TQWidget *parent)
Constructs a new todo editor.
void writeTodo(Todo *)
Write event settings to event object.
bool processInput()
Process user input and create or update event.
bool validateInput()
Check if the input is valid.
void editIncidence(Incidence *incidence, const TQDate &date, Calendar *calendar)
Edit an existing todo.
void modified()
This todo has been modified externally.