summaryrefslogtreecommitdiffstats
path: root/libkcal/calformat.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /libkcal/calformat.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/calformat.h')
-rw-r--r--libkcal/calformat.h115
1 files changed, 115 insertions, 0 deletions
diff --git a/libkcal/calformat.h b/libkcal/calformat.h
new file mode 100644
index 000000000..80c36a1fa
--- /dev/null
+++ b/libkcal/calformat.h
@@ -0,0 +1,115 @@
+/*
+ This file is part of libkcal.
+
+ Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+#ifndef KCAL_CALFORMAT_H
+#define KCAL_CALFORMAT_H
+
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qevent.h>
+
+#include "exceptions.h"
+#include "event.h"
+#include "libkcal_export.h"
+
+namespace KCal {
+
+class VCalDrag;
+class Calendar;
+
+/**
+ This is the base class for calendar formats. It provides an interface for the
+ generation/interpretation of a textual representation of a calendar.
+
+ @short Class providing in interface to a calendar format
+*/
+class LIBKCAL_EXPORT CalFormat
+{
+ public:
+ /** Constructs a new format. */
+ CalFormat();
+ /** Destruct calendar format. */
+ virtual ~CalFormat();
+
+ /**
+ loads a calendar on disk into the calendar associated with this format.
+ Returns TRUE if successful,else returns FALSE.
+ @param fileName the name of the calendar on disk.
+ */
+ virtual bool load(Calendar *, const QString &fileName) = 0;
+ /** writes out the calendar to disk. Returns true if
+ * successful and false on error.
+ * @param fileName the name of the file
+ */
+ virtual bool save(Calendar *, const QString &fileName) = 0;
+
+ /**
+ Parse string and populate calendar with that information.
+ */
+ virtual bool fromString(Calendar *, const QString & ) = 0;
+ /**
+ Return calendar information as string.
+ */
+ virtual QString toString(Calendar *) = 0;
+
+ /** Clear exception status of this format object */
+ void clearException();
+ /**
+ Return exception, if there is any, containing information about the last
+ error that occurred.
+ */
+ ErrorFormat *exception();
+
+ /** Set the application name for use in unique IDs and error messages,
+ * and product ID for incidence PRODID property
+ */
+ static void setApplication(const QString& app, const QString& productID);
+ /** Return the application name used in unique IDs and error messages */
+ static const QString& application() { return mApplication; }
+ /** Return the PRODID string to write into calendar files */
+ static const QString& productId() { return mProductId; }
+ /** Return the PRODID string loaded from calendar file */
+ const QString &loadedProductId() { return mLoadedProductId; }
+
+ /** Create a unique id string. */
+ static QString createUniqueId();
+
+ /**
+ Set exception for this object. This is used by the functions of this
+ class to report errors.
+ */
+ void setException(ErrorFormat *error);
+
+ protected:
+ QString mLoadedProductId; // PRODID string loaded from calendar file
+
+ private:
+ ErrorFormat *mException;
+
+ static QString mApplication; // name of application for unique ID strings
+ static QString mProductId; // PRODID string to write to calendar files
+
+ class Private;
+ Private *d;
+};
+
+}
+
+#endif