File indexing completed on 2024-11-24 04:44:12

0001 /*
0002 
0003     SPDX-FileCopyrightText: 2012 Christian Mollekopf <chrigi_1@fastmail.fm>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "kolab_export.h"
0011 
0012 #include <kolabevent.h>
0013 
0014 namespace Kolab
0015 {
0016 /**
0017  * Takes a list of events and writes them to an iCal object.
0018  *
0019  */
0020 KOLAB_EXPORT std::string toICal(const std::vector<Kolab::Event> &);
0021 /**
0022  * Takes an iCal object and returns the contained events.
0023  */
0024 KOLAB_EXPORT std::vector<Kolab::Event> fromICalEvents(const std::string &);
0025 
0026 class KOLAB_EXPORT ITipHandler
0027 {
0028 public:
0029     ITipHandler();
0030     enum ITipMethod {
0031         iTIPPublish, /**< Event, to-do, journal or freebusy posting */
0032         iTIPRequest, /**< Event, to-do or freebusy scheduling request */
0033         iTIPReply, /**< Event, to-do or freebusy reply to request */
0034         iTIPAdd, /**< Event, to-do or journal additional property request */
0035         iTIPCancel, /**< Event, to-do or journal cancellation notice */
0036         iTIPRefresh, /**< Event or to-do description update request */
0037         iTIPCounter, /**< Event or to-do submit counter proposal */
0038         iTIPDeclineCounter, /**< Event or to-do decline a counter proposal */
0039         iTIPNoMethod /**< No method */
0040     };
0041 
0042     std::string toIMip(const Kolab::Event &, ITipMethod, const std::string &from, bool bbcMe = false) const;
0043     std::vector<Kolab::Event> fromIMip(const std::string &);
0044 
0045     /**
0046      * Create iTip message from single event
0047      */
0048     std::string toITip(const Kolab::Event &, ITipMethod) const;
0049 
0050     /**
0051      * Parse iTip message with a single event
0052      */
0053     std::vector<Kolab::Event> fromITip(const std::string &);
0054     ITipMethod method() const;
0055 
0056 private:
0057     ITipMethod mMethod;
0058 };
0059 }