• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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() : d( new Private() )
40 {
41 }
42 
43 IncidenceMimeTypeVisitor::~IncidenceMimeTypeVisitor()
44 {
45  delete d;
46 }
47 
48 bool IncidenceMimeTypeVisitor::visit( KCal::Event *event )
49 {
50  Q_UNUSED( event );
51  d->mType = sEventType;
52  return true;
53 }
54 
55 bool IncidenceMimeTypeVisitor::visit( KCal::Todo *todo )
56 {
57  Q_UNUSED( todo );
58  d->mType = sTodoType;
59  return true;
60 }
61 
62 bool IncidenceMimeTypeVisitor::visit( KCal::Journal *journal )
63 {
64  Q_UNUSED( journal );
65  d->mType = sJournalType;
66  return true;
67 }
68 
69 bool IncidenceMimeTypeVisitor::visit( KCal::FreeBusy *freebusy )
70 {
71  Q_UNUSED( freebusy );
72  d->mType = sFreeBusyType;
73  return true;
74 }
75 
76 QString IncidenceMimeTypeVisitor::mimeType() const
77 {
78  return d->mType;
79 }
80 
81 QStringList IncidenceMimeTypeVisitor::allMimeTypes() const
82 {
83  return QStringList() << sEventType << sTodoType << sJournalType << sFreeBusyType;
84 }
85 
86 QString IncidenceMimeTypeVisitor::mimeType( KCal::IncidenceBase *incidence )
87 {
88  Q_ASSERT( incidence != 0 );
89 
90  incidence->accept( *this );
91  return mimeType();
92 }
93 
94 QString IncidenceMimeTypeVisitor::eventMimeType()
95 {
96  return sEventType;
97 }
98 
99 QString IncidenceMimeTypeVisitor::todoMimeType()
100 {
101  return sTodoType;
102 }
103 
104 QString IncidenceMimeTypeVisitor::journalMimeType()
105 {
106  return sJournalType;
107 }
108 
109 QString IncidenceMimeTypeVisitor::freeBusyMimeType()
110 {
111  return sFreeBusyType;
112 }
113 
114 // kate: space-indent on; indent-width 2; replace-tabs on;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:37 by doxygen 1.8.3.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.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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