• 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
  • views
  • monthview
monthview.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
5  Author: Sergio Martins <sergio.martins@kdab.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 along
18  with this program; if not, write to the Free Software Foundation, Inc.,
19  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 Qt, and distribute the resulting executable,
23  without including the source code for Qt in the source distribution.
24 */
25 
26 #include "monthview.h"
27 #include "koeventpopupmenu.h"
28 #include "koprefs.h"
29 
30 #include <calendarviews/month/monthview.h>
31 
32 #include <QVBoxLayout>
33 
34 using namespace KOrg;
35 
36 class MonthView::Private
37 {
38  public:
39  Private( MonthView *qq ) : q( qq )
40  {
41  QVBoxLayout *layout = new QVBoxLayout( q );
42  layout->setMargin( 0 );
43  mMonthView = new EventViews::MonthView( EventViews::MonthView::Visible, q );
44  mMonthView->setPreferences( KOPrefs::instance()->eventViewsPreferences() );
45  layout->addWidget( mMonthView );
46  mPopup = q->eventPopup();
47  }
48 
49  EventViews::MonthView *mMonthView;
50  KOEventPopupMenu *mPopup;
51 
52  private:
53  MonthView *q;
54 };
55 
56 MonthView::MonthView( QWidget *parent )
57  : KOEventView( parent ), d( new Private( this ) )
58 {
59  connect( d->mMonthView, SIGNAL(showIncidencePopupSignal(Akonadi::Item,QDate)),
60  d->mPopup, SLOT(showIncidencePopup(Akonadi::Item,QDate)) );
61 
62  connect( d->mMonthView, SIGNAL(showNewEventPopupSignal()),
63  SLOT(showNewEventPopup()) );
64 
65  connect( d->mMonthView, SIGNAL(datesSelected(KCalCore::DateList)),
66  SIGNAL(datesSelected(KCalCore::DateList)) );
67 
68  connect( d->mMonthView, SIGNAL(shiftedEvent(QDate,QDate)),
69  SIGNAL(shiftedEvent(QDate,QDate)) );
70 
71  connect( d->mMonthView, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
72  SIGNAL(incidenceSelected(Akonadi::Item,QDate)) );
73 
74  connect( d->mMonthView, SIGNAL(showIncidenceSignal(Akonadi::Item)),
75  SIGNAL(showIncidenceSignal(Akonadi::Item)) );
76 
77  connect( d->mMonthView, SIGNAL(editIncidenceSignal(Akonadi::Item)),
78  SIGNAL(editIncidenceSignal(Akonadi::Item)) );
79 
80  connect( d->mMonthView, SIGNAL(deleteIncidenceSignal(Akonadi::Item)),
81  SIGNAL(deleteIncidenceSignal(Akonadi::Item)) );
82 
83  connect( d->mMonthView, SIGNAL(cutIncidenceSignal(Akonadi::Item)),
84  SIGNAL(cutIncidenceSignal(Akonadi::Item)) );
85 
86  connect( d->mMonthView, SIGNAL(copyIncidenceSignal(Akonadi::Item)),
87  SIGNAL(copyIncidenceSignal(Akonadi::Item)) );
88 
89  connect( d->mMonthView, SIGNAL(pasteIncidenceSignal()),
90  SIGNAL(pasteIncidenceSignal()) );
91 
92  connect( d->mMonthView, SIGNAL(toggleAlarmSignal(Akonadi::Item)),
93  SIGNAL(toggleAlarmSignal(Akonadi::Item)) );
94 
95  connect( d->mMonthView, SIGNAL(toggleTodoCompletedSignal(Akonadi::Item)),
96  SIGNAL(toggleTodoCompletedSignal(Akonadi::Item)) );
97 
98  connect( d->mMonthView, SIGNAL(copyIncidenceToResourceSignal(Akonadi::Item,QString)),
99  SIGNAL(copyIncidenceToResourceSignal(Akonadi::Item,QString)) );
100 
101  connect( d->mMonthView, SIGNAL(moveIncidenceToResourceSignal(Akonadi::Item,QString)),
102  SIGNAL(moveIncidenceToResourceSignal(Akonadi::Item,QString)) );
103 
104  connect( d->mMonthView, SIGNAL(dissociateOccurrencesSignal(Akonadi::Item,QDate)),
105  SIGNAL(dissociateOccurrencesSignal(Akonadi::Item,QDate)) );
106 
107  connect( d->mMonthView, SIGNAL(newEventSignal()),
108  SIGNAL(newEventSignal()) );
109 
110  connect( d->mMonthView, SIGNAL(newEventSignal(QDate)),
111  SIGNAL(newEventSignal(QDate)) );
112 
113  connect( d->mMonthView, SIGNAL(newEventSignal(QDateTime)),
114  SIGNAL(newEventSignal(QDateTime)) );
115 
116  connect( d->mMonthView, SIGNAL(newEventSignal(QDateTime,QDateTime)),
117  SIGNAL(newEventSignal(QDateTime,QDateTime)) );
118 
119  connect( d->mMonthView, SIGNAL(newTodoSignal(QDate)),
120  SIGNAL(newTodoSignal(QDate)) );
121 
122  connect( d->mMonthView, SIGNAL(newSubTodoSignal(Akonadi::Item)),
123  SIGNAL(newSubTodoSignal(Akonadi::Item)) );
124 
125  connect( d->mMonthView, SIGNAL(newJournalSignal(QDate)),
126  SIGNAL(newJournalSignal(QDate)) );
127 
128  connect( d->mMonthView, SIGNAL(fullViewChanged(bool)),
129  SIGNAL(fullViewChanged(bool)) );
130 }
131 
132 MonthView::~MonthView()
133 {
134  delete d;
135 }
136 
137 CalPrinterBase::PrintType MonthView::printType() const
138 {
139  return CalPrinterBase::Month;
140 }
141 
142 int MonthView::currentDateCount() const
143 {
144  return d->mMonthView->currentDateCount();
145 }
146 
147 int MonthView::currentMonth() const
148 {
149  return d->mMonthView->currentMonth();
150 }
151 
152 KCalCore::DateList MonthView::selectedIncidenceDates()
153 {
154  return d->mMonthView->selectedIncidenceDates();
155 }
156 
157 QDateTime MonthView::selectionStart()
158 {
159  return d->mMonthView->selectionStart();
160 }
161 
162 QDateTime MonthView::selectionEnd()
163 {
164  return d->mMonthView->selectionEnd();
165 }
166 
167 bool MonthView::eventDurationHint( QDateTime &startDt, QDateTime &endDt, bool &allDay )
168 {
169  return d->mMonthView->eventDurationHint( startDt, endDt, allDay );
170 }
171 
172 QDate MonthView::averageDate() const
173 {
174  return d->mMonthView->averageDate();
175 }
176 
177 bool MonthView::usesFullWindow()
178 {
179  return d->mMonthView->usesFullWindow();
180 }
181 
182 bool MonthView::supportsDateRangeSelection()
183 {
184  return d->mMonthView->supportsDateRangeSelection();
185 }
186 
187 void MonthView::updateView()
188 {
189  d->mMonthView->updateView();
190 }
191 
192 void MonthView::showIncidences( const Akonadi::Item::List &incidenceList, const QDate &date )
193 {
194  d->mMonthView->showIncidences( incidenceList, date );
195 }
196 
197 void MonthView::changeIncidenceDisplay( const Akonadi::Item &item,
198  Akonadi::IncidenceChanger::ChangeType changeType )
199 {
200  d->mMonthView->changeIncidenceDisplay( item, changeType );
201 }
202 
203 void MonthView::updateConfig()
204 {
205  d->mMonthView->updateConfig();
206 }
207 
208 int MonthView::maxDatesHint() const
209 {
210  return 6 * 7;
211 }
212 
213 Akonadi::Item::List MonthView::selectedIncidences()
214 {
215  return d->mMonthView->selectedIncidences();
216 }
217 
218 void MonthView::setTypeAheadReceiver( QObject *o )
219 {
220  d->mMonthView->setTypeAheadReceiver( o );
221 }
222 
223 void MonthView::setDateRange( const KDateTime &start, const KDateTime &end,
224  const QDate &preferredMonth )
225 {
226  d->mMonthView->setDateRange( start, end, preferredMonth );
227 }
228 
229 void MonthView::setCalendar( const Akonadi::ETMCalendar::Ptr &cal )
230 {
231  KOEventView::setCalendar( cal );
232  d->mPopup->setCalendar( cal );
233  d->mMonthView->setCalendar( cal );
234 }
235 
236 void MonthView::setIncidenceChanger( Akonadi::IncidenceChanger *changer )
237 {
238  d->mMonthView->setIncidenceChanger( changer );
239 }
240 
241 void MonthView::showDates( const QDate &start, const QDate &end, const QDate &preferredMonth )
242 {
243  Q_UNUSED( start );
244  Q_UNUSED( end );
245  Q_UNUSED( preferredMonth );
246 }
247 
248 #include "monthview.moc"
KOrg::MonthView::averageDate
QDate averageDate() const
Returns the average date in the view.
Definition: monthview.cpp:172
KOrg::BaseView::incidenceSelected
void incidenceSelected(const Akonadi::Item &, const QDate)
KOrg::MonthView::currentMonth
int currentMonth() const
Definition: monthview.cpp:147
QWidget
KOrg::BaseView::toggleAlarmSignal
void toggleAlarmSignal(const Akonadi::Item &)
instructs the receiver to toggle the alarms of the Incidence.
KOrg::MonthView
Definition: monthview.h:33
QObject
KOEventView
KOEventView is the abstract base class from which all other calendar views for event data are derived...
Definition: koeventview.h:54
KOrg::MonthView::selectedIncidenceDates
KCalCore::DateList selectedIncidenceDates()
Returns dates of the currently selected events.
Definition: monthview.cpp:152
KOrg::BaseView::newTodoSignal
void newTodoSignal(const QDate &)
KOrg::MonthView::fullViewChanged
void fullViewChanged(bool enabled)
KOrg::BaseView::setCalendar
virtual void setCalendar(const Akonadi::ETMCalendar::Ptr &cal)
Definition: baseview.cpp:68
KOEventView::datesSelected
void datesSelected(const KCalCore::DateList datelist)
When the view changes the dates that are selected in one way or another, this signal is emitted...
KOrg::BaseView::dissociateOccurrencesSignal
void dissociateOccurrencesSignal(const Akonadi::Item &, const QDate &)
Dissociate from a recurring incidence the occurrence on the given date to a new incidence or dissocia...
KOrg::MonthView::MonthView
MonthView(QWidget *parent=0)
Definition: monthview.cpp:56
koprefs.h
KOrg::CalPrinterBase::Month
Definition: printplugin.h:49
KOrg::BaseView::editIncidenceSignal
void editIncidenceSignal(const Akonadi::Item &)
instructs the receiver to begin editing the incidence specified in some manner.
koeventpopupmenu.h
KOrg::MonthView::selectionEnd
QDateTime selectionEnd()
Returns the end of the selection, or an invalid QDateTime if there is no selection or the view doesn'...
Definition: monthview.cpp:162
KOrg::MonthView::eventDurationHint
bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay)
Sets the default start/end date/time for new events.
Definition: monthview.cpp:167
KOrg::BaseView::showIncidenceSignal
void showIncidenceSignal(const Akonadi::Item &)
instructs the receiver to show the incidence in read-only mode.
KOrg::MonthView::selectedIncidences
Akonadi::Item::List selectedIncidences()
Definition: monthview.cpp:213
KOrg::MonthView::updateConfig
void updateConfig()
Definition: monthview.cpp:203
KOrg::BaseView::copyIncidenceSignal
void copyIncidenceSignal(const Akonadi::Item &)
instructs the receiver to copy the incidence
KOrg::BaseView::newSubTodoSignal
void newSubTodoSignal(const Akonadi::Item &)
KOrg::BaseView::cutIncidenceSignal
void cutIncidenceSignal(const Akonadi::Item &)
instructs the receiver to cut the Incidence
KOrg::MonthView::setDateRange
void setDateRange(const KDateTime &start, const KDateTime &end, const QDate &preferredMonth=QDate())
Show incidences for the given date range.
Definition: monthview.cpp:223
KOrg::MonthView::usesFullWindow
bool usesFullWindow()
returns whether this view should be displayed full window.
Definition: monthview.cpp:177
KOrg::MonthView::~MonthView
~MonthView()
Definition: monthview.cpp:132
KOrg::BaseView::toggleTodoCompletedSignal
void toggleTodoCompletedSignal(const Akonadi::Item &)
instructs the receiver to toggle the completion state of the Incidence (which must be a Todo type)...
KOrg::MonthView::setTypeAheadReceiver
void setTypeAheadReceiver(QObject *o)
Definition: monthview.cpp:218
KOrg::MonthView::setIncidenceChanger
void setIncidenceChanger(Akonadi::IncidenceChanger *changer)
Assign a new incidence change helper object.
Definition: monthview.cpp:236
KOrg::MonthView::showIncidences
void showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date)
Definition: monthview.cpp:192
KOrg::MonthView::maxDatesHint
int maxDatesHint() const
provides a hint back to the caller on the maximum number of dates that the view supports.
Definition: monthview.cpp:208
KOrg::BaseView::deleteIncidenceSignal
void deleteIncidenceSignal(const Akonadi::Item &)
instructs the receiver to delete the Incidence in some manner; some possibilities include automatical...
KOrg::BaseView::moveIncidenceToResourceSignal
void moveIncidenceToResourceSignal(const Akonadi::Item &, const QString &)
Move the incidence to the specified resource.
KOrg::MonthView::printType
KOrg::CalPrinterBase::PrintType printType() const
Definition: monthview.cpp:137
KOEventPopupMenu
Context menu for event views with standard event actions.
Definition: koeventpopupmenu.h:38
KOrg::MonthView::updateView
void updateView()
Definition: monthview.cpp:187
KOrg::BaseView::newEventSignal
void newEventSignal()
instructs the receiver to create a new event in given collection.
KOrg::MonthView::currentDateCount
int currentDateCount() const
Returns the number of currently shown dates.
Definition: monthview.cpp:142
KOPrefs::instance
static KOPrefs * instance()
Get instance of KOPrefs.
Definition: koprefs.cpp:68
monthview.h
KOrg::BaseView::copyIncidenceToResourceSignal
void copyIncidenceToResourceSignal(const Akonadi::Item &, const QString &)
Copy the incidence to the specified resource.
KOrg::MonthView::supportsDateRangeSelection
bool supportsDateRangeSelection()
returns whether this view supports date range selection Base implementation returns true...
Definition: monthview.cpp:182
KOrg::BaseView::newJournalSignal
void newJournalSignal(const QDate &)
KOEventView::shiftedEvent
void shiftedEvent(const QDate &olddate, const QDate &ewdate)
Emitted when an event is moved using the mouse in an agenda view (week / month).
KOrg::MonthView::changeIncidenceDisplay
void changeIncidenceDisplay(const Akonadi::Item &, Akonadi::IncidenceChanger::ChangeType)
Definition: monthview.cpp:197
KOrg::MonthView::selectionStart
QDateTime selectionStart()
Returns the start of the selection, or an invalid QDateTime if there is no selection or the view does...
Definition: monthview.cpp:157
KOrg::BaseView::pasteIncidenceSignal
void pasteIncidenceSignal()
instructs the receiver to paste the incidence
KOrg::CalPrinterBase::PrintType
PrintType
Definition: printplugin.h:45
KOrg::MonthView::setCalendar
void setCalendar(const Akonadi::ETMCalendar::Ptr &cal)
Definition: monthview.cpp:229
KOEventView::showNewEventPopup
virtual void showNewEventPopup()
Definition: koeventview.cpp:151
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