KCalendarCore

calformat.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
16 #ifndef KCALCORE_CALFORMAT_H
17 #define KCALCORE_CALFORMAT_H
18 
19 #include "kcalendarcore_export.h"
20 #include "calendar.h"
21 
22 #include <QString>
23 
24 namespace KCalendarCore
25 {
26 
27 class Exception;
28 
36 class KCALENDARCORE_EXPORT CalFormat
37 {
38 public:
42  CalFormat();
43 
47  virtual ~CalFormat();
48 
57  virtual bool load(const Calendar::Ptr &calendar, const QString &fileName) = 0;
58 
67  virtual bool save(const Calendar::Ptr &calendar, const QString &fileName) = 0;
68 
80  virtual bool fromString(const Calendar::Ptr &calendar, const QString &string,
81  bool deleted = false, const QString &notebook = QString()) = 0;
82 
97  virtual bool fromRawString(const Calendar::Ptr &calendar, const QByteArray &string,
98  bool deleted = false, const QString &notebook = QString()) = 0;
99 
110  virtual QString toString(const Calendar::Ptr &calendar,
111  const QString &notebook = QString(), bool deleted = false) = 0;
112 
116  void clearException();
117 
122  Exception *exception() const;
123 
131  static void setApplication(const QString &application,
132  const QString &productID);
133 
137  static const QString &application(); //krazy:exclude=constref
138 
142  static const QString &productId(); //krazy:exclude=constref
143 
148  QString loadedProductId();
149 
153  static QString createUniqueId();
154 
161  void setException(Exception *error);
162 
163 protected:
169  void setLoadedProductId(const QString &id);
170 
175  virtual void virtual_hook(int id, void *data);
176 
177 private:
178  //@cond PRIVATE
179  Q_DISABLE_COPY(CalFormat)
180  class Private;
181  Private *const d;
182  //@endcond
183 };
184 
185 }
186 
187 #endif
typedef Exception
An abstract base class that provides an interface to various calendar formats.
Definition: calformat.h:36
This file is part of the API for handling calendar data and defines the Calendar class.
Exception base class, currently used as a fancy kind of error code and not as an C++ exception...
Definition: exceptions.h:42
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Oct 28 2020 22:55:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.