• 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
  • timespentview
kotimespentview.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2007 Bruno Virlet <bruno.virlet@gmail.com>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of Qt, and distribute the resulting executable,
22  without including the source code for Qt in the source distribution.
23 */
24 
25 #include "kotimespentview.h"
26 
27 #include <calendarviews/timespent/timespentview.h>
28 #include <Akonadi/Calendar/ETMCalendar>
29 #include <calendarsupport/kcalprefs.h>
30 #include <calendarsupport/utils.h>
31 
32 #include <KCalCore/Event>
33 
34 #include <QVBoxLayout>
35 
36 KOTimeSpentView::KOTimeSpentView( QWidget *parent )
37  : KOrg::BaseView( parent )
38 {
39  mView = new EventViews::TimeSpentView( this );
40  QBoxLayout *topLayout = new QVBoxLayout( this );
41  topLayout->addWidget( mView );
42 
43  connect( mView, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
44  SIGNAL(incidenceSelected(Akonadi::Item,QDate)) );
45 
46  connect( mView, SIGNAL(showIncidenceSignal(Akonadi::Item)),
47  SIGNAL(showIncidenceSignal(Akonadi::Item)) );
48 
49  connect( mView, SIGNAL(editIncidenceSignal(Akonadi::Item)),
50  SIGNAL(editIncidenceSignal(Akonadi::Item)) );
51 
52  connect( mView, SIGNAL(deleteIncidenceSignal(Akonadi::Item)),
53  SIGNAL(deleteIncidenceSignal(Akonadi::Item)) );
54 
55  connect( mView, SIGNAL(cutIncidenceSignal(Akonadi::Item)),
56  SIGNAL(cutIncidenceSignal(Akonadi::Item)) );
57 
58  connect( mView, SIGNAL(copyIncidenceSignal(Akonadi::Item)),
59  SIGNAL(copyIncidenceSignal(Akonadi::Item)) );
60 
61  connect( mView, SIGNAL(pasteIncidenceSignal()),
62  SIGNAL(pasteIncidenceSignal()) );
63 
64  connect( mView, SIGNAL(toggleAlarmSignal(Akonadi::Item)),
65  SIGNAL(toggleAlarmSignal(Akonadi::Item)) );
66 
67  connect( mView, SIGNAL(toggleTodoCompletedSignal(Akonadi::Item)),
68  SIGNAL(toggleTodoCompletedSignal(Akonadi::Item)) );
69 
70  connect( mView, SIGNAL(copyIncidenceToResourceSignal(Akonadi::Item,QString)),
71  SIGNAL(copyIncidenceToResourceSignal(Akonadi::Item,QString)) );
72 
73  connect( mView, SIGNAL(moveIncidenceToResourceSignal(Akonadi::Item,QString)),
74  SIGNAL(moveIncidenceToResourceSignal(Akonadi::Item,QString)) );
75 
76  connect( mView, SIGNAL(dissociateOccurrencesSignal(Akonadi::Item,QDate)),
77  SIGNAL(dissociateOccurrencesSignal(Akonadi::Item,QDate)) );
78 
79  connect( mView, SIGNAL(newEventSignal()),
80  SIGNAL(newEventSignal()) );
81 
82  connect( mView, SIGNAL(newEventSignal(QDate)),
83  SIGNAL(newEventSignal(QDate)) );
84 
85  connect( mView, SIGNAL(newEventSignal(QDateTime)),
86  SIGNAL(newEventSignal(QDateTime)) );
87 
88  connect( mView, SIGNAL(newEventSignal(QDateTime,QDateTime)),
89  SIGNAL(newEventSignal(QDateTime,QDateTime)) );
90 
91  connect( mView, SIGNAL(newTodoSignal(QDate)),
92  SIGNAL(newTodoSignal(QDate)) );
93 
94  connect( mView, SIGNAL(newSubTodoSignal(Akonadi::Item)),
95  SIGNAL(newSubTodoSignal(Akonadi::Item)) );
96 
97  connect( mView, SIGNAL(newJournalSignal(QDate)),
98  SIGNAL(newJournalSignal(QDate)) );
99 }
100 
101 KOTimeSpentView::~KOTimeSpentView()
102 {
103 }
104 
105 int KOTimeSpentView::currentDateCount() const
106 {
107  return mView->currentDateCount();
108 }
109 
110 void KOTimeSpentView::showDates( const QDate &start, const QDate &end,
111  const QDate &dummy )
112 {
113  return mView->showDates( start, end, dummy );
114 }
115 
116 void KOTimeSpentView::showIncidences( const Akonadi::Item::List &incidenceList, const QDate &date )
117 {
118  Q_UNUSED( incidenceList );
119  Q_UNUSED( date );
120 }
121 
122 void KOTimeSpentView::changeIncidenceDisplay( const Akonadi::Item &,
123  Akonadi::IncidenceChanger::ChangeType )
124 {
125  mView->updateView();
126 }
127 
128 void KOTimeSpentView::updateView()
129 {
130  mView->updateView();
131 }
132 
133 KOrg::CalPrinterBase::PrintType KOTimeSpentView::printType() const
134 {
135  // If up to three days are selected, use day style, otherwise week
136  if ( currentDateCount() <= 3 ) {
137  return KOrg::CalPrinterBase::Day;
138  } else {
139  return KOrg::CalPrinterBase::Week;
140  }
141 }
142 
143 void KOTimeSpentView::setCalendar( const Akonadi::ETMCalendar::Ptr &cal )
144 {
145  KOrg::BaseView::setCalendar( cal );
146  mView->setCalendar( cal );
147 }
148 
149 #include "kotimespentview.moc"
KOTimeSpentView::showDates
virtual void showDates(const QDate &start, const QDate &end, const QDate &preferredMonth=QDate())
Definition: kotimespentview.cpp:110
KOrg::BaseView::incidenceSelected
void incidenceSelected(const Akonadi::Item &, const QDate)
KOTimeSpentView::printType
virtual KOrg::CalPrinterBase::PrintType printType() const
Definition: kotimespentview.cpp:133
KOTimeSpentView::~KOTimeSpentView
~KOTimeSpentView()
Definition: kotimespentview.cpp:101
QWidget
KOrg::BaseView::toggleAlarmSignal
void toggleAlarmSignal(const Akonadi::Item &)
instructs the receiver to toggle the alarms of the Incidence.
KOTimeSpentView::KOTimeSpentView
KOTimeSpentView(QWidget *parent=0)
Definition: kotimespentview.cpp:36
KOrg::BaseView::newTodoSignal
void newTodoSignal(const QDate &)
kotimespentview.h
KOrg::BaseView::setCalendar
virtual void setCalendar(const Akonadi::ETMCalendar::Ptr &cal)
Definition: baseview.cpp:68
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::BaseView::editIncidenceSignal
void editIncidenceSignal(const Akonadi::Item &)
instructs the receiver to begin editing the incidence specified in some manner.
KOrg::BaseView::showIncidenceSignal
void showIncidenceSignal(const Akonadi::Item &)
instructs the receiver to show the incidence in read-only mode.
KOTimeSpentView::currentDateCount
virtual int currentDateCount() const
Returns the number of currently shown dates.
Definition: kotimespentview.cpp:105
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::CalPrinterBase::Day
Definition: printplugin.h:47
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)...
KOTimeSpentView::updateView
virtual void updateView()
Definition: kotimespentview.cpp:128
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::CalPrinterBase::Week
Definition: printplugin.h:48
KOTimeSpentView::showIncidences
virtual void showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date)
Definition: kotimespentview.cpp:116
KOTimeSpentView::changeIncidenceDisplay
void changeIncidenceDisplay(const Akonadi::Item &, Akonadi::IncidenceChanger::ChangeType)
Definition: kotimespentview.cpp:122
KOrg::BaseView::newEventSignal
void newEventSignal()
instructs the receiver to create a new event in given collection.
KOrg::BaseView::copyIncidenceToResourceSignal
void copyIncidenceToResourceSignal(const Akonadi::Item &, const QString &)
Copy the incidence to the specified resource.
KOrg::BaseView::newJournalSignal
void newJournalSignal(const QDate &)
KOrg::BaseView::pasteIncidenceSignal
void pasteIncidenceSignal()
instructs the receiver to paste the incidence
KOTimeSpentView::setCalendar
void setCalendar(const Akonadi::ETMCalendar::Ptr &cal)
Definition: kotimespentview.cpp:143
KOrg::CalPrinterBase::PrintType
PrintType
Definition: printplugin.h:45
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