akonadi
incidencemimetypevisitor.cpp
00001 /* 00002 Copyright (c) 2008-2009 Kevin Krammer <kevin.krammer@gmx.at> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 // No point on having warnings. This class won't be ported to KCalCore 00021 // and will be deleted in KDE5. 00022 #define WANT_DEPRECATED_KCAL_API 00023 00024 #include "incidencemimetypevisitor.h" 00025 00026 static QLatin1String sEventType( "application/x-vnd.akonadi.calendar.event" ); 00027 static QLatin1String sTodoType( "application/x-vnd.akonadi.calendar.todo" ); 00028 static QLatin1String sJournalType( "application/x-vnd.akonadi.calendar.journal" ); 00029 static QLatin1String sFreeBusyType( "application/x-vnd.akonadi.calendar.freebusy" ); 00030 00031 using namespace Akonadi; 00032 00033 class IncidenceMimeTypeVisitor::Private 00034 { 00035 public: 00036 QString mType; 00037 }; 00038 00039 IncidenceMimeTypeVisitor::IncidenceMimeTypeVisitor() : d( new Private() ) 00040 { 00041 } 00042 00043 IncidenceMimeTypeVisitor::~IncidenceMimeTypeVisitor() 00044 { 00045 delete d; 00046 } 00047 00048 bool IncidenceMimeTypeVisitor::visit( KCal::Event *event ) 00049 { 00050 Q_UNUSED( event ); 00051 d->mType = sEventType; 00052 return true; 00053 } 00054 00055 bool IncidenceMimeTypeVisitor::visit( KCal::Todo *todo ) 00056 { 00057 Q_UNUSED( todo ); 00058 d->mType = sTodoType; 00059 return true; 00060 } 00061 00062 bool IncidenceMimeTypeVisitor::visit( KCal::Journal *journal ) 00063 { 00064 Q_UNUSED( journal ); 00065 d->mType = sJournalType; 00066 return true; 00067 } 00068 00069 bool IncidenceMimeTypeVisitor::visit( KCal::FreeBusy *freebusy ) 00070 { 00071 Q_UNUSED( freebusy ); 00072 d->mType = sFreeBusyType; 00073 return true; 00074 } 00075 00076 QString IncidenceMimeTypeVisitor::mimeType() const 00077 { 00078 return d->mType; 00079 } 00080 00081 QStringList IncidenceMimeTypeVisitor::allMimeTypes() const 00082 { 00083 return QStringList() << sEventType << sTodoType << sJournalType << sFreeBusyType; 00084 } 00085 00086 QString IncidenceMimeTypeVisitor::mimeType( KCal::IncidenceBase *incidence ) 00087 { 00088 Q_ASSERT( incidence != 0 ); 00089 00090 incidence->accept( *this ); 00091 return mimeType(); 00092 } 00093 00094 QString IncidenceMimeTypeVisitor::eventMimeType() 00095 { 00096 return sEventType; 00097 } 00098 00099 QString IncidenceMimeTypeVisitor::todoMimeType() 00100 { 00101 return sTodoType; 00102 } 00103 00104 QString IncidenceMimeTypeVisitor::journalMimeType() 00105 { 00106 return sJournalType; 00107 } 00108 00109 QString IncidenceMimeTypeVisitor::freeBusyMimeType() 00110 { 00111 return sFreeBusyType; 00112 } 00113 00114 // kate: space-indent on; indent-width 2; replace-tabs on;
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:09:22 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:09:22 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.