summaryrefslogtreecommitdiffabout
path: root/libkcal/customproperties.h
Unidiff
Diffstat (limited to 'libkcal/customproperties.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/customproperties.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/libkcal/customproperties.h b/libkcal/customproperties.h
new file mode 100644
index 0000000..0cbfdcd
--- a/dev/null
+++ b/libkcal/customproperties.h
@@ -0,0 +1,97 @@
1/*
2 This file is part of libkcal.
3 Copyright (c) 2002 David Jarvie <software@astrojar.org.uk>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef KCAL_CUSTOM_PROPERTIES_H
22#define KCAL_CUSTOM_PROPERTIES_H
23
24#include <qstring.h>
25#include <qmap.h>
26
27namespace KCal {
28
29/**
30 This class represents custom calendar properties.
31 It is used as a base class for classes which represent calendar components.
32 A custom property name written by libkcal has the form X-KDE-APP-KEY where
33 APP represents the application name, and KEY distinguishes individual
34 properties for the application.
35 In keeping with RFC2445, property names must be composed only of the
36 characters A-Z, a-z, 0-9 and '-'.
37*/
38class CustomProperties
39{
40 public:
41 /** Construct a new empty custom properties instance */
42 CustomProperties();
43 CustomProperties(const CustomProperties &);
44 ~CustomProperties();
45
46 /** Create or modify a custom calendar property.
47 @param app Application name as it appears in the custom property name.
48 @param key Property identifier specific to the application.
49 @param value The property's value. A call with a value of QString::null
50 will be ignored.
51 */
52 void setCustomProperty(const QCString &app, const QCString &key,
53 const QString &value);
54 /** Delete a custom calendar property.
55 @param app Application name as it appears in the custom property name.
56 @param key Property identifier specific to the application.
57 */
58 void removeCustomProperty(const QCString &app, const QCString &key);
59 /** Return the value of a custom calendar property.
60 @param app Application name as it appears in the custom property name.
61 @param key Property identifier specific to the application.
62 @return Property value, or QString::null if (and only if) the property does not exist.
63 */
64 QString customProperty(const QCString &app, const QCString &key) const;
65
66 /** Create or modify a non-KDE or non-standard custom calendar property.
67 @param name Full property name
68 @param value The property's value. A call with a value of QString::null
69 will be ignored.
70 */
71 void setNonKDECustomProperty(const QCString &name, const QString &value);
72 /** Delete a non-KDE or non-standard custom calendar property.
73 @param name Full property name
74 */
75 void removeNonKDECustomProperty(const QCString &name);
76 /** Return the value of a non-KDE or non-standard custom calendar property.
77 @param name Full property name
78 @return Property value, or QString::null if (and only if) the property does not exist.
79 */
80 QString nonKDECustomProperty(const QCString& name) const;
81
82 /** Initialise the alarm's custom calendar properties to the specified
83 key/value pairs.
84 */
85 void setCustomProperties(const QMap<QCString, QString> &properties);
86 /** Return all custom calendar property key/value pairs. */
87 QMap<QCString, QString> customProperties() const;
88
89 private:
90 static bool checkName(const QCString& name);
91
92 QMap<QCString, QString> mProperties; // custom calendar properties
93};
94
95}
96
97#endif