• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KCalCore Library

vcalformat.h
Go to the documentation of this file.
00001 /*
00002   This file is part of the kcalcore library.
00003 
00004   Copyright (c) 1998 Preston Brown <pbrown@kde.org>
00005   Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Library General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Library General Public License for more details.
00016 
00017   You should have received a copy of the GNU Library General Public License
00018   along with this library; see the file COPYING.LIB.  If not, write to
00019   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020   Boston, MA 02110-1301, USA.
00021 */
00038 #ifndef KCALCORE_VCALFORMAT_H
00039 #define KCALCORE_VCALFORMAT_H
00040 
00041 #include "kcalcore_export.h"
00042 #include "attendee.h"
00043 #include "calformat.h"
00044 #include "event.h"
00045 #include "todo.h"
00046 #include "journal.h"
00047 
00048 struct VObject;
00049 
00050 class KDateTime;
00051 
00052 class QDate;
00053 
00054 #define _VCAL_VERSION "1.0"
00055 
00056 namespace KCalCore {
00057 
00058 class Event;
00059 class Todo;
00060 
00069 class KCALCORE_EXPORT VCalFormat : public CalFormat
00070 {
00071   public:
00075     VCalFormat();
00076 
00080     virtual ~VCalFormat();
00081 
00086     bool load( const Calendar::Ptr &calendar, const QString &fileName );
00087 
00092     bool save( const Calendar::Ptr &calendar, const QString &fileName );
00093 
00098     bool fromString( const Calendar::Ptr &calendar, const QString &string,
00099                      bool deleted = false, const QString &notebook = QString() );
00100 
00105     QString toString( const Calendar::Ptr &calendar, const QString &notebook = QString(),
00106                       bool deleted = false );
00107 
00112     bool fromRawString( const Calendar::Ptr &calendar, const QByteArray &string,
00113                         bool deleted = false, const QString &notebook = QString() );
00114 
00115   protected:
00120     Todo::Ptr VTodoToEvent( VObject *vtodo );
00121 
00126     Event::Ptr VEventToEvent( VObject *vevent );
00127 
00132     VObject *eventToVEvent( const Event::Ptr &event );
00133 
00137     QString parseTZ( const QByteArray &timezone ) const;
00138 
00142     QString parseDst( QByteArray &timezone ) const;
00143 
00148     VObject *eventToVTodo( const Todo::Ptr &todo );
00149 
00154     QString qDateToISO( const QDate &date );
00155 
00161     QString kDateTimeToISO( const KDateTime &date, bool zulu = true );
00162 
00168     KDateTime ISOToKDateTime( const QString &dtStr );
00169 
00175     QDate ISOToQDate( const QString &dtStr );
00176 
00187     bool parseTZOffsetISO8601( const QString &s, int &result );
00188 
00193     void populate( VObject *vcal, bool deleted = false, const QString &notebook = QString() );
00194 
00202     const char *dayFromNum( int day );
00203 
00210     int numFromDay( const QString &day );
00211 
00219     Attendee::PartStat readStatus( const char *s ) const;
00220 
00227     QByteArray writeStatus( Attendee::PartStat status ) const;
00228 
00229     void readCustomProperties( VObject *o, const Incidence::Ptr &i );
00230     void writeCustomProperties( VObject *o, const Incidence::Ptr &i );
00231 
00232   protected:
00237     virtual void virtual_hook( int id, void *data );
00238 
00239   private:
00243     enum PilotState {
00244       SYNCNONE = 0,
00245       SYNCMOD = 1,
00246       SYNCDEL = 3
00247     };
00248 
00249     //@cond PRIVATE
00250     Q_DISABLE_COPY( VCalFormat )
00251     class Private;
00252     Private *const d;
00253     //@endcond
00254 };
00255 
00256 }
00257 
00258 #endif

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal