• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
  • kcal
incidencemimetypevisitor.cpp
1 /*
2  Copyright (c) 2008-2009 Kevin Krammer <kevin.krammer@gmx.at>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 // No point on having warnings. This class won't be ported to KCalCore
21 // and will be deleted in KDE5.
22 #define WANT_DEPRECATED_KCAL_API
23 
24 #include "incidencemimetypevisitor.h"
25 
26 static QLatin1String sEventType("application/x-vnd.akonadi.calendar.event");
27 static QLatin1String sTodoType("application/x-vnd.akonadi.calendar.todo");
28 static QLatin1String sJournalType("application/x-vnd.akonadi.calendar.journal");
29 static QLatin1String sFreeBusyType("application/x-vnd.akonadi.calendar.freebusy");
30 
31 using namespace Akonadi;
32 
33 class IncidenceMimeTypeVisitor::Private
34 {
35 public:
36  QString mType;
37 };
38 
39 IncidenceMimeTypeVisitor::IncidenceMimeTypeVisitor()
40  : d(new Private())
41 {
42 }
43 
44 IncidenceMimeTypeVisitor::~IncidenceMimeTypeVisitor()
45 {
46  delete d;
47 }
48 
49 bool IncidenceMimeTypeVisitor::visit(KCal::Event *event)
50 {
51  Q_UNUSED(event);
52  d->mType = sEventType;
53  return true;
54 }
55 
56 bool IncidenceMimeTypeVisitor::visit(KCal::Todo *todo)
57 {
58  Q_UNUSED(todo);
59  d->mType = sTodoType;
60  return true;
61 }
62 
63 bool IncidenceMimeTypeVisitor::visit(KCal::Journal *journal)
64 {
65  Q_UNUSED(journal);
66  d->mType = sJournalType;
67  return true;
68 }
69 
70 bool IncidenceMimeTypeVisitor::visit(KCal::FreeBusy *freebusy)
71 {
72  Q_UNUSED(freebusy);
73  d->mType = sFreeBusyType;
74  return true;
75 }
76 
77 QString IncidenceMimeTypeVisitor::mimeType() const
78 {
79  return d->mType;
80 }
81 
82 QStringList IncidenceMimeTypeVisitor::allMimeTypes() const
83 {
84  return QStringList() << sEventType << sTodoType << sJournalType << sFreeBusyType;
85 }
86 
87 QString IncidenceMimeTypeVisitor::mimeType(KCal::IncidenceBase *incidence)
88 {
89  Q_ASSERT(incidence != 0);
90 
91  incidence->accept(*this);
92  return mimeType();
93 }
94 
95 QString IncidenceMimeTypeVisitor::eventMimeType()
96 {
97  return sEventType;
98 }
99 
100 QString IncidenceMimeTypeVisitor::todoMimeType()
101 {
102  return sTodoType;
103 }
104 
105 QString IncidenceMimeTypeVisitor::journalMimeType()
106 {
107  return sJournalType;
108 }
109 
110 QString IncidenceMimeTypeVisitor::freeBusyMimeType()
111 {
112  return sFreeBusyType;
113 }
114 
115 // kate: space-indent on; indent-width 2; replace-tabs on;
Akonadi::IncidenceMimeTypeVisitor::todoMimeType
static QString todoMimeType()
Returns the sub MIME type for Todos.
Definition: incidencemimetypevisitor.cpp:100
Akonadi::IncidenceMimeTypeVisitor::~IncidenceMimeTypeVisitor
virtual ~IncidenceMimeTypeVisitor()
Destroys the instance.
Definition: incidencemimetypevisitor.cpp:44
Akonadi::IncidenceMimeTypeVisitor::freeBusyMimeType
static QString freeBusyMimeType()
Returns the sub MIME type for FreeBusys.
Definition: incidencemimetypevisitor.cpp:110
Akonadi::IncidenceMimeTypeVisitor::allMimeTypes
QStringList allMimeTypes() const
Returns a list of all calendar component sub MIME types.
Definition: incidencemimetypevisitor.cpp:82
Akonadi::IncidenceMimeTypeVisitor::visit
virtual bool visit(KCal::Event *event)
Sets the MIME type to "application/x-vnd.akonadi.calendar.event".
Definition: incidencemimetypevisitor.cpp:49
Akonadi
FreeBusyManager::Singleton.
Definition: actionstatemanager_p.h:28
Akonadi::IncidenceMimeTypeVisitor::eventMimeType
static QString eventMimeType()
Returns the sub MIME type for Events.
Definition: incidencemimetypevisitor.cpp:95
Akonadi::IncidenceMimeTypeVisitor::mimeType
QString mimeType() const
Returns the Akonadi specific text/calendar sub MIME type of the last incidence visited by this instan...
Definition: incidencemimetypevisitor.cpp:77
Akonadi::IncidenceMimeTypeVisitor::IncidenceMimeTypeVisitor
IncidenceMimeTypeVisitor()
Creates a visitor instance.
Definition: incidencemimetypevisitor.cpp:39
Akonadi::IncidenceMimeTypeVisitor::journalMimeType
static QString journalMimeType()
Returns the sub MIME type for Journals.
Definition: incidencemimetypevisitor.cpp:105
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Sep 11 2015 09:38:46 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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