• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

korganizer

  • sources
  • kde-4.12
  • kdepim
  • korganizer
  • interfaces
  • korganizer
baseview.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the KOrganizer interfaces.
3 
4  Copyright (c) 1999,2001,2003 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library 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 GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #include "baseview.h"
24 
25 #include <KRandom>
26 
27 using namespace KOrg;
28 
29 class BaseView::Private
30 {
31  BaseView *const q;
32 
33  public:
34  explicit Private( BaseView *qq )
35  : q( qq ),
36  mChanges( EventViews::EventView::IncidencesAdded |
37  EventViews::EventView::DatesChanged ),
38  calendar( 0 )
39  {
40  QByteArray cname = q->metaObject()->className();
41  cname.replace( ':', '_' );
42  identifier = cname + '_' + KRandom::randomString( 8 ).toLatin1();
43  }
44 
45  ~Private()
46  {
47  }
48 
49  EventViews::EventView::Changes mChanges;
50  Akonadi::ETMCalendar::Ptr calendar;
51  QByteArray identifier;
52  KDateTime startDateTime;
53  KDateTime endDateTime;
54  KDateTime actualStartDateTime;
55  KDateTime actualEndDateTime;
56 };
57 
58 BaseView::BaseView( QWidget *parent )
59  : QWidget( parent ), mChanger( 0 ), d( new Private( this ) )
60 {
61 }
62 
63 BaseView::~BaseView()
64 {
65  delete d;
66 }
67 
68 void BaseView::setCalendar( const Akonadi::ETMCalendar::Ptr &calendar )
69 {
70  if ( d->calendar != calendar ) {
71  d->calendar = calendar;
72  }
73 }
74 
75 CalPrinterBase::PrintType BaseView::printType() const
76 {
77  return CalPrinterBase::Month;
78 }
79 
80 Akonadi::ETMCalendar::Ptr BaseView::calendar()
81 {
82  return d->calendar;
83 }
84 
85 bool BaseView::isEventView()
86 {
87  return false;
88 }
89 
90 void BaseView::dayPassed( const QDate & )
91 {
92  updateView();
93 }
94 
95 void BaseView::setIncidenceChanger( Akonadi::IncidenceChanger *changer )
96 {
97  mChanger = changer;
98 }
99 
100 void BaseView::flushView()
101 {
102 }
103 
104 BaseView *BaseView::viewAt( const QPoint & )
105 {
106  return this;
107 }
108 
109 void BaseView::updateConfig()
110 {
111 }
112 
113 bool BaseView::hasConfigurationDialog() const
114 {
115  return false;
116 }
117 
118 void BaseView::setDateRange( const KDateTime &start, const KDateTime &end,
119  const QDate &preferredMonth )
120 {
121  d->startDateTime = start;
122  d->endDateTime = end;
123  showDates( start.date(), end.date(), preferredMonth );
124  const QPair<KDateTime,KDateTime> adjusted = actualDateRange( start, end, preferredMonth );
125  d->actualStartDateTime = adjusted.first;
126  d->actualEndDateTime = adjusted.second;
127 }
128 
129 KDateTime BaseView::startDateTime() const
130 {
131  return d->startDateTime;
132 }
133 
134 KDateTime BaseView::endDateTime() const
135 {
136  return d->endDateTime;
137 }
138 
139 KDateTime BaseView::actualStartDateTime() const
140 {
141  return d->actualStartDateTime;
142 }
143 
144 KDateTime BaseView::actualEndDateTime() const
145 {
146  return d->actualEndDateTime;
147 }
148 
149 void BaseView::showConfigurationDialog( QWidget * )
150 {
151 }
152 
153 QByteArray BaseView::identifier() const
154 {
155  return d->identifier;
156 }
157 
158 void BaseView::setIdentifier( const QByteArray &identifier )
159 {
160  d->identifier = identifier;
161 }
162 
163 void BaseView::restoreConfig( const KConfigGroup &configGroup )
164 {
165  doRestoreConfig( configGroup );
166 }
167 
168 void BaseView::saveConfig( KConfigGroup &configGroup )
169 {
170  doSaveConfig( configGroup );
171 }
172 
173 void BaseView::doRestoreConfig( const KConfigGroup & )
174 {
175 }
176 
177 void BaseView::doSaveConfig( KConfigGroup & )
178 {
179 }
180 
181 void BaseView::clearSelection()
182 {
183 }
184 
185 bool BaseView::eventDurationHint( QDateTime &startDt, QDateTime &endDt, bool &allDay )
186 {
187  Q_UNUSED( startDt );
188  Q_UNUSED( endDt );
189  Q_UNUSED( allDay );
190  return false;
191 }
192 
193 void BaseView::getHighlightMode( bool &highlightEvents,
194  bool &highlightTodos,
195  bool &highlightJournals )
196 {
197  highlightEvents = true;
198  highlightTodos = false;
199  highlightJournals = false;
200 }
201 
202 bool BaseView::usesFullWindow()
203 {
204  return false;
205 }
206 
207 bool BaseView::supportsZoom()
208 {
209  return false;
210 }
211 
212 bool BaseView::supportsDateRangeSelection()
213 {
214  return true;
215 }
216 
217 void BaseView::calendarReset()
218 {
219 }
220 
221 QPair<KDateTime,KDateTime> BaseView::actualDateRange( const KDateTime &start,
222  const KDateTime &end,
223  const QDate &preferredMonth ) const
224 {
225  Q_UNUSED( preferredMonth );
226  return qMakePair( start, end );
227 }
228 
229 void BaseView::setChanges( EventViews::EventView::Changes changes )
230 {
231  d->mChanges = changes;
232 }
233 
234 EventViews::EventView::Changes BaseView::changes() const
235 {
236  return d->mChanges;
237 }
238 
239 #include "baseview.moc"
KOrg::BaseView::supportsDateRangeSelection
virtual bool supportsDateRangeSelection()
returns whether this view supports date range selection Base implementation returns true...
Definition: baseview.cpp:212
KOrg::BaseView::mChanger
Akonadi::IncidenceChanger * mChanger
Definition: baseview.h:397
KOrg::BaseView::clearSelection
virtual void clearSelection()
Clear selection.
Definition: baseview.cpp:181
KOrg::BaseView::identifier
QByteArray identifier() const
Definition: baseview.cpp:153
KOrg::BaseView::restoreConfig
virtual void restoreConfig(const KConfigGroup &configGroup)
reads the view configuration.
Definition: baseview.cpp:163
KOrg::BaseView::setDateRange
virtual void setDateRange(const KDateTime &start, const KDateTime &end, const QDate &preferredMonth=QDate())
Show incidences for the given date range.
Definition: baseview.cpp:118
KOrg::BaseView::eventDurationHint
virtual bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay)
Sets the default start/end date/time for new events.
Definition: baseview.cpp:185
baseview.h
KOrg::BaseView::startDateTime
KDateTime startDateTime() const
Definition: baseview.cpp:129
KOrg::BaseView::usesFullWindow
virtual bool usesFullWindow()
returns whether this view should be displayed full window.
Definition: baseview.cpp:202
QWidget
KOrg::BaseView::actualDateRange
virtual QPair< KDateTime, KDateTime > actualDateRange(const KDateTime &start, const KDateTime &end, const QDate &preferredMonth=QDate()) const
From the requested date range (passed via setDateRange()), calculates the adjusted date range actuall...
Definition: baseview.cpp:221
KOrg::BaseView::showConfigurationDialog
virtual void showConfigurationDialog(QWidget *parent)
Definition: baseview.cpp:149
KOrg::BaseView::isEventView
virtual bool isEventView()
Returns if this view is a view for displaying events.
Definition: baseview.cpp:85
KOrg::BaseView::hasConfigurationDialog
virtual bool hasConfigurationDialog() const
Definition: baseview.cpp:113
KOrg::BaseView::dayPassed
virtual void dayPassed(const QDate &)
Definition: baseview.cpp:90
KOrg::BaseView::calendarReset
virtual void calendarReset()
Definition: baseview.cpp:217
KOrg::BaseView::printType
virtual CalPrinterBase::PrintType printType() const
Definition: baseview.cpp:75
KOrg::BaseView::flushView
virtual void flushView()
Write all unsaved data back to calendar store.
Definition: baseview.cpp:100
KOrg::BaseView::getHighlightMode
virtual void getHighlightMode(bool &highlightEvents, bool &highlightTodos, bool &highlightJournals)
Returns which incidence types should used to embolden day numbers in the date navigator when this vie...
Definition: baseview.cpp:193
KOrg::BaseView::viewAt
virtual BaseView * viewAt(const QPoint &p)
returns the view at the given widget coordinate.
Definition: baseview.cpp:104
KOrg::BaseView::setCalendar
virtual void setCalendar(const Akonadi::ETMCalendar::Ptr &cal)
Definition: baseview.cpp:68
KOrg::BaseView::setIdentifier
virtual void setIdentifier(const QByteArray &identifier)
Definition: baseview.cpp:158
KOrg::BaseView::doRestoreConfig
virtual void doRestoreConfig(const KConfigGroup &configGroup)
reimplement to read view-specific settings
Definition: baseview.cpp:173
KOrg::CalPrinterBase::Month
Definition: printplugin.h:49
KOrg::BaseView::showDates
virtual void showDates(const QDate &start, const QDate &end, const QDate &preferredMonth=QDate())=0
KOrg::BaseView::doSaveConfig
virtual void doSaveConfig(KConfigGroup &configGroup)
reimplement to write view specific settings
Definition: baseview.cpp:177
KOrg::BaseView::updateView
virtual void updateView()=0
Updates the current display to reflect changes that may have happened in the calendar since the last ...
KOrg::BaseView::changes
EventViews::EventView::Changes changes() const
Returns if there are pending changes and a redraw is needed.
Definition: baseview.cpp:234
KOrg::BaseView::actualEndDateTime
KDateTime actualEndDateTime() const
Definition: baseview.cpp:144
KOrg::BaseView::calendar
virtual Akonadi::ETMCalendar::Ptr calendar()
Return calendar object of this view.
Definition: baseview.cpp:80
KOrg::BaseView::BaseView
BaseView(QWidget *parent=0)
Constructs a view.
Definition: baseview.cpp:58
KOrg::BaseView
This class provides an interface for all views being displayed within the main calendar view...
Definition: baseview.h:51
KOrg::BaseView::updateConfig
virtual void updateConfig()
Re-reads the KOrganizer configuration and picks up relevant changes which are applicable to the view...
Definition: baseview.cpp:109
KOrg::BaseView::endDateTime
KDateTime endDateTime() const
Definition: baseview.cpp:134
KOrg::BaseView::actualStartDateTime
KDateTime actualStartDateTime() const
Definition: baseview.cpp:139
KOrg::BaseView::setChanges
virtual void setChanges(EventViews::EventView::Changes changes)
Notifies the view that there are pending changes so a redraw is needed.
Definition: baseview.cpp:229
KOrg::BaseView::setIncidenceChanger
virtual void setIncidenceChanger(Akonadi::IncidenceChanger *changer)
Assign a new incidence change helper object.
Definition: baseview.cpp:95
KOrg::BaseView::~BaseView
virtual ~BaseView()
Destructor.
Definition: baseview.cpp:63
KOrg::BaseView::supportsZoom
virtual bool supportsZoom()
returns whether this view supports zoom.
Definition: baseview.cpp:207
KOrg::CalPrinterBase::PrintType
PrintType
Definition: printplugin.h:45
KOrg::BaseView::saveConfig
virtual void saveConfig(KConfigGroup &configGroup)
writes out the view configuration.
Definition: baseview.cpp:168
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal