Page MenuHomePhorge

kolabobject.h
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

kolabobject.h

/*
* Copyright (C) 2011 Christian Mollekopf <mollekopf@kolabsys.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KOLABOBJECT_H
#define KOLABOBJECT_H
#include "kolab_export.h"
#include <kabc/addressee.h>
#include <kabc/contactgroup.h>
#include <kcalcore/incidence.h>
#include <kcalcore/event.h>
#include <kcalcore/journal.h>
#include <kcalcore/todo.h>
#include <kmime/kmime_message.h>
namespace Kolab {
enum Version {
KolabV2,
KolabV3
};
enum ObjectType {
InvalidObject,
EventObject,
TodoObject,
JournalObject,
ContactObject,
DistlistObject,
NoteObject
};
KOLAB_EXPORT KCalCore::Event::Ptr readV2EventXML(const QByteArray &xmlData, QStringList &attachments);
/**
* Class to read Kolab Mime files
*
* It implements the Kolab specifics of Mime message handling
*
*/
class KOLAB_EXPORT KolabObjectReader {
public:
KolabObjectReader();
explicit KolabObjectReader(const KMime::Message::Ptr &msg);
~KolabObjectReader();
ObjectType parseMimeMessage(const KMime::Message::Ptr &msg);
ObjectType getType() const;
Version getVersion() const;
KCalCore::Event::Ptr getEvent() const;
KCalCore::Todo::Ptr getTodo() const;
KCalCore::Journal::Ptr getJournal() const;
KCalCore::Incidence::Ptr getIncidence() const;
KABC::Addressee getContact() const;
KABC::ContactGroup getDistlist() const;
KMime::Message::Ptr getNote() const;
private:
//@cond PRIVATE
class Private;
Private *const d;
//@endcond
};
class KOLAB_EXPORT KolabObjectWriter {
public:
static KMime::Message::Ptr writeEvent(const KCalCore::Event::Ptr &, Version v = KolabV3, const QString &tz = QString());
static KMime::Message::Ptr writeTodo(const KCalCore::Todo::Ptr &, Version v = KolabV3, const QString &tz = QString());
static KMime::Message::Ptr writeJournal(const KCalCore::Journal::Ptr &, Version v = KolabV3, const QString &tz = QString());
static KMime::Message::Ptr writeContact(const KABC::Addressee &, Version v = KolabV3);
static KMime::Message::Ptr writeDistlist(const KABC::ContactGroup &, Version v = KolabV3);
static KMime::Message::Ptr writeNote(const KMime::Message::Ptr &, Version v = KolabV3);
};
}; //Namespace
#endif // KOLABOBJECT_H

File Metadata

Mime Type
text/x-c++
Expires
Mon, Apr 6, 1:26 AM (1 d, 21 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
85/86/66a5ef752a02c2253f2ff1ef97c0
Default Alt Text
kolabobject.h (2 KB)

Event Timeline