korganizer

koviewmanager.h
1/*
2 This file is part of KOrganizer.
3
4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21 As a special exception, permission is given to link this program
22 with any edition of TQt, and distribute the resulting executable,
23 without including the source code for TQt in the source distribution.
24*/
25#ifndef KOVIEWMANAGER_H
26#define KOVIEWMANAGER_H
27
28#include <tqobject.h>
29class TQWidget;
30class TQTabWidget;
31
32class CalendarView;
33
34class KOListView;
35class KOAgendaView;
36class KOMonthView;
37class KOTodoView;
38class KOWhatsNextView;
39class KOJournalView;
40class KOTimelineView;
41
42namespace KOrg {
43 class BaseView;
44 class MultiAgendaView;
45}
46using namespace KCal;
47
52class KOViewManager : public TQObject
53{
54 TQ_OBJECT
55
56 public:
57
58 enum AgendaMode {
59 AGENDA_NONE,
60 AGENDA_DAY,
61 AGENDA_WORK_WEEK,
62 AGENDA_WEEK,
63 AGENDA_NEXTX,
64 AGENDA_OTHER // for example, showing 8 days
65 };
66
68 virtual ~KOViewManager();
69
71 void showView( KOrg::BaseView * );
72
73 void readSettings( TDEConfig *config );
74 void writeSettings( TDEConfig *config );
75
77 void readCurrentView( TDEConfig * );
79 void writeCurrentView( TDEConfig * );
80
81 KOrg::BaseView *currentView();
82
83 void setDocumentId( const TQString & );
84
85 void updateView();
86 void updateView( const TQDate &start, const TQDate &end );
87
88 void goMenu( bool enable );
89 void raiseCurrentView();
90
91 void connectView( KOrg::BaseView * );
92 void addView( KOrg::BaseView * );
93
94 Incidence *currentSelection();
95 TQDate currentSelectionDate();
96
97 KOAgendaView *agendaView() const { return mAgendaView; }
98 KOrg::MultiAgendaView *multiAgendaView() const { return mAgendaSideBySideView; }
99 KOTodoView *todoView() const { return mTodoView; }
100 KOMonthView *monthView() const { return mMonthView; }
101
102 void updateMultiCalendarDisplay();
103
104 /*
105 * Returns true if the agenda is the current view.
106 *
107 * Never use the pointer returned by agendaView()
108 * to know if agenda is selected, because agenda has other modes
109 * (tabbed, side by side). Use this function instead.
110 */
111 bool agendaIsSelected() const;
112
117 AgendaMode agendaMode() const { return mAgendaMode; }
118
119 public slots:
120 void showWhatsNextView();
121 void showListView();
122 void showAgendaView();
123 void showDayView();
124 void showWorkWeekView();
125 void showWeekView();
126 void showNextXView();
127 void showMonthView();
128 void showTodoView();
129 void showTimelineView();
130 void showJournalView();
131
132 void showEventView();
133
134 void connectTodoView( KOTodoView *todoView );
135
136 void zoomInHorizontally();
137 void zoomOutHorizontally();
138 void zoomInVertically();
139 void zoomOutVertically();
140
141 void resourcesChanged();
142
143 private slots:
144 void currentAgendaViewTabChanged( TQWidget* );
145 private:
146 TQWidget* widgetForView( KOrg::BaseView* ) const;
147 CalendarView *mMainView;
148
149 KOAgendaView *mAgendaView;
150 MultiAgendaView *mAgendaSideBySideView;
151 KOListView *mListView;
152 KOMonthView *mMonthView;
153 KOTodoView *mTodoView;
154 KOWhatsNextView *mWhatsNextView;
155 KOJournalView *mJournalView;
156 KOTimelineView *mTimelineView;
157
158 KOrg::BaseView *mCurrentView;
159
160 KOrg::BaseView *mLastEventView;
161 TQTabWidget *mAgendaViewTabs;
162 int mAgendaViewTabIndex;
163
164 AgendaMode mAgendaMode;
165
166};
167
168#endif
This is the main calendar widget.
Definition: calendarview.h:82
KOAgendaView is the agenda-like view used to display events in a single one or multi-day view.
Definition: koagendaview.h:109
This class provides a journal view.
Definition: kojournalview.h:42
This class provides a multi-column list view of events.
Definition: kolistview.h:69
The class KOMonthView represents the monthly view in KOrganizer.
Definition: komonthview.h:246
This class provides a view ....
This class provides a multi-column list view of todo events.
Definition: kotodoview.h:114
This class manages the views of the calendar.
Definition: koviewmanager.h:53
AgendaMode agendaMode() const
If the agenda view is selected it returns the current range mode: week, work week,...
void writeCurrentView(TDEConfig *)
Write which view is currently shown to config file.
void readCurrentView(TDEConfig *)
Read which view was shown last from config file.
void showView(KOrg::BaseView *)
changes the view to be the currently selected view
This class provides a view of the next events and todos.
This class provides an interface for all views being displayed within the main calendar view.
Definition: baseview.h:60
Shows one agenda for every resource side-by-side.