[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] libkcal amendments for email alarms
From:       David Jarvie <lists () astrojar ! org ! uk>
Date:       2002-12-02 13:22:27
[Download RAW message or body]

On Friday 29 Nov 2002 10:16 pm, Cornelius Schumacher wrote:
> On Friday 29 November 2002 22:51, David Jarvie wrote:
> > Below are my revised suggestions which I believe comply with all the
> > points which you have raised. I suggest implementing the custom
> > property methods so that every property name is automatically formed
> > as X-KDE-APP-KEY where APP represents the application name, and KEY
> > represents the application's individual tag for that property. This
> > would adhere to RFC2445's recommendation that a code for the vendor
> > should preferably follow the initial X-.
>
> This looks good.

I have been thinking about how to implement the same mechanism for Events, 
etc., and notice that all components (even VCALENDAR) are allowed by RFC2445 
to have custom properties. To ensure that we don't lose custom properties 
when reading calendars and writing them back, I think that we need to 
implement custom property read/write for the following classes: Calendar, 
IncidenceBase, Alarm. If we ever read VTIMEZONE components, they should be 
treated in the same way. The best way to implement this would, I think, be to 
have a common base class for each of the above classes, whose purpose would 
be to read, write and manipulate custom properties. It would be

class CustomProperties
{
  public:
    /** Create or modify a custom calendar property. */
    void setCustomProperty(const QCString &app, const QCString &key,
                           const QString &value);
    /** Delete a custom calendar property. */
    void removeCustomProperty(const QCString &app, const QCString &key);
    /** Return the value of a custom calendar property. */
    QString customProperty(const QCString &app, const QCString &key) 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;
  private:
    QMap<QCString, QString> mCustomProperties;   // custom calendar properties
};

Each of Calendar, IncidenceBase and Alarm would be publically derived from it.

Using this, there would only need to be one place in ICalFormatImpl to read or 
to write custom properties, rather than having to duplicate code between 
Alarms and Incidences/FreeBusys.

Comments?

-- 
David Jarvie
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic