libkcal

customproperties.h

Go to the documentation of this file.
00001 /*
00002     This file is part of libkcal.
00003 
00004     Copyright (c) 2002,2006 David Jarvie <software@astrojar.org.uk>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KCAL_CUSTOMPROPERTIES_H
00023 #define KCAL_CUSTOMPROPERTIES_H
00024 
00025 #include <qstring.h>
00026 #include <qmap.h>
00027 #include <kdepimmacros.h>
00028 
00029 #include "libkcal_export.h"
00030 
00031 namespace KCal {
00032 
00042 class LIBKCAL_EXPORT CustomProperties
00043 {
00044   public:
00048     CustomProperties();
00049     CustomProperties( const CustomProperties & );
00050     ~CustomProperties();
00051 
00052     bool operator==( const CustomProperties & ) const;
00053 
00062     void setCustomProperty( const QCString &app, const QCString &key,
00063                             const QString &value );
00070     void removeCustomProperty( const QCString &app, const QCString &key );
00079     QString customProperty( const QCString &app, const QCString &key ) const;
00080 
00088     void setNonKDECustomProperty( const QCString &name, const QString &value );
00094     void removeNonKDECustomProperty( const QCString &name );
00102     QString nonKDECustomProperty( const QCString& name ) const;
00103 
00108     void setCustomProperties( const QMap<QCString, QString> &properties );
00112     QMap<QCString, QString> customProperties() const;
00113 
00114   protected:
00120     virtual void customPropertyUpdated()  {}
00121 
00122   private:
00123     static bool checkName(const QCString& name);
00124 
00125     QMap<QCString, QString> mProperties;   // custom calendar properties
00126 
00127     class Private;
00128     Private *d;
00129 };
00130 
00131 }
00132 
00133 #endif