summaryrefslogtreecommitdiffstats
path: root/libkcal/customproperties.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/customproperties.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/customproperties.h')
-rw-r--r--libkcal/customproperties.h133
1 files changed, 133 insertions, 0 deletions
diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h
new file mode 100644
index 00000000..5cafff2e
--- /dev/null
+++ b/libkcal/customproperties.h
@@ -0,0 +1,133 @@
+/*
+ This file is part of libkcal.
+
+ Copyright (c) 2002,2006 David Jarvie <software@astrojar.org.uk>
+
+ 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_CUSTOMPROPERTIES_H
+#define KCAL_CUSTOMPROPERTIES_H
+
+#include <qstring.h>
+#include <qmap.h>
+#include <kdepimmacros.h>
+
+#include "libkcal_export.h"
+
+namespace KCal {
+
+/**
+ This class represents custom calendar properties.
+ It is used as a base class for classes which represent calendar components.
+ A custom property name written by libkcal has the form X-KDE-APP-KEY where
+ APP represents the application name, and KEY distinguishes individual
+ properties for the application.
+ In keeping with RFC2445, property names must be composed only of the
+ characters A-Z, a-z, 0-9 and '-'.
+*/
+class LIBKCAL_EXPORT CustomProperties
+{
+ public:
+ /**
+ Construct a new empty custom properties instance.
+ */
+ CustomProperties();
+ CustomProperties( const CustomProperties & );
+ ~CustomProperties();
+
+ bool operator==( const CustomProperties & ) const;
+
+ /**
+ Create or modify a custom calendar property.
+
+ @param app Application name as it appears in the custom property name.
+ @param key Property identifier specific to the application.
+ @param value The property's value. A call with a value of QString::null
+ will be ignored.
+ */
+ void setCustomProperty( const QCString &app, const QCString &key,
+ const QString &value );
+ /**
+ Delete a custom calendar property.
+
+ @param app Application name as it appears in the custom property name.
+ @param key Property identifier specific to the application.
+ */
+ void removeCustomProperty( const QCString &app, const QCString &key );
+ /**
+ Return the value of a custom calendar property.
+
+ @param app Application name as it appears in the custom property name.
+ @param key Property identifier specific to the application.
+ @return Property value, or QString::null if (and only if) the property
+ does not exist.
+ */
+ QString customProperty( const QCString &app, const QCString &key ) const;
+
+ /**
+ Create or modify a non-KDE or non-standard custom calendar property.
+
+ @param name Full property name
+ @param value The property's value. A call with a value of QString::null
+ will be ignored.
+ */
+ void setNonKDECustomProperty( const QCString &name, const QString &value );
+ /**
+ Delete a non-KDE or non-standard custom calendar property.
+
+ @param name Full property name
+ */
+ void removeNonKDECustomProperty( const QCString &name );
+ /**
+ Return the value of a non-KDE or non-standard custom calendar property.
+
+ @param name Full property name
+ @return Property value, or QString::null if (and only if) the property
+ does not exist.
+ */
+ QString nonKDECustomProperty( const QCString& name ) const;
+
+ /**
+ Initialise the alarm's custom calendar properties to the specified
+ key/value pairs.
+ */
+ void setCustomProperties( const QMap<QCString, QString> &properties );
+ /**
+ Return all custom calendar property key/value pairs.
+ */
+ QMap<QCString, QString> customProperties() const;
+
+ protected:
+ /**
+ Called when a custom property has been changed.
+ The default implementation does nothing: override in derived classes
+ to perform change processing.
+ */
+ virtual void customPropertyUpdated() {}
+
+ private:
+ static bool checkName(const QCString& name);
+
+ QMap<QCString, QString> mProperties; // custom calendar properties
+
+ class Private;
+ Private *d;
+};
+
+}
+
+#endif