~ubuntu-branches/ubuntu/saucy/kdepimlibs/saucy-proposed

« back to all changes in this revision

Viewing changes to kcalcore/icalformat_p.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2014-01-16 14:37:08 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20140116143708-to5k8l8il6534d0f
Tags: 4:4.11.5-0ubuntu0.1
New upstream bugfix release (LP: #1266285)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
*/
89
89
class ICalFormatImpl
90
90
{
91
 
  public:
 
91
public:
92
92
    /**
93
93
      Construct a new iCal format for calendar object.
94
94
      @param parent is a pointer to a valid ICalFormat object.
95
95
    */
96
 
    explicit ICalFormatImpl( ICalFormat *parent );
 
96
    explicit ICalFormatImpl(ICalFormat *parent);
97
97
 
98
98
    /**
99
99
      Destructor.
105
105
      existing in @p calendar are not affected except that if a new incidence
106
106
      with the same UID is found, the existing incidence is replaced.
107
107
    */
108
 
    bool populate( const Calendar::Ptr &calendar, icalcomponent *fs,
109
 
                   bool deleted = false, const QString &notebook = QString() );
110
 
 
111
 
    icalcomponent *writeIncidence( const IncidenceBase::Ptr &incidence,
112
 
                                   iTIPMethod method = iTIPRequest,
113
 
                                   ICalTimeZones *tzList = 0,
114
 
                                   ICalTimeZones *tzUsedList = 0 );
115
 
 
116
 
    icalcomponent *writeTodo( const Todo::Ptr &todo, ICalTimeZones *tzlist = 0,
117
 
                              ICalTimeZones *tzUsedList = 0 );
118
 
 
119
 
    icalcomponent *writeEvent( const Event::Ptr &event, ICalTimeZones *tzlist = 0,
120
 
                               ICalTimeZones *tzUsedList = 0 );
121
 
 
122
 
    icalcomponent *writeJournal( const Journal::Ptr &journal, ICalTimeZones *tzlist = 0,
123
 
                                 ICalTimeZones *tzUsedList = 0 );
124
 
 
125
 
    icalcomponent *writeFreeBusy( const FreeBusy::Ptr &freebusy,
126
 
                                  iTIPMethod method = iTIPPublish );
127
 
 
128
 
    void writeIncidence( icalcomponent *parent, const Incidence::Ptr &incidence,
129
 
                         ICalTimeZones *tzlist = 0, ICalTimeZones *tzUsedList = 0 );
130
 
 
131
 
    icalproperty *writeDescription( const QString &description, bool isRich = false );
132
 
    icalproperty *writeSummary( const QString &summary, bool isRich = false );
133
 
    icalproperty *writeLocation( const QString &location, bool isRich = false );
134
 
    icalproperty *writeAttendee( const Attendee::Ptr &attendee );
135
 
    icalproperty *writeOrganizer( const Person::Ptr &organizer );
136
 
    icalproperty *writeAttachment( const Attachment::Ptr &attach );
137
 
    icalproperty *writeRecurrenceRule( Recurrence * );
138
 
    icalrecurrencetype writeRecurrenceRule( RecurrenceRule *recur );
139
 
    icalcomponent *writeAlarm( const Alarm::Ptr &alarm );
140
 
 
141
 
    QString extractErrorProperty( icalcomponent * );
142
 
    Todo::Ptr readTodo( icalcomponent *vtodo, ICalTimeZones *tzlist );
143
 
    Event::Ptr readEvent( icalcomponent *vevent, ICalTimeZones *tzlist );
144
 
    FreeBusy::Ptr readFreeBusy( icalcomponent *vfreebusy );
145
 
    Journal::Ptr readJournal( icalcomponent *vjournal, ICalTimeZones *tzlist );
146
 
    Attendee::Ptr readAttendee( icalproperty *attendee );
147
 
    Person::Ptr readOrganizer( icalproperty *organizer );
148
 
    Attachment::Ptr readAttachment( icalproperty *attach );
149
 
    void readIncidence( icalcomponent *parent, Incidence::Ptr incidence,
150
 
                        ICalTimeZones *tzlist );
151
 
    void readRecurrenceRule( icalproperty *rrule, Incidence::Ptr event );
152
 
    void readExceptionRule( icalproperty *rrule, Incidence::Ptr incidence );
153
 
    void readRecurrence( const struct icalrecurrencetype &r,
154
 
                         RecurrenceRule *recur );
155
 
    void readAlarm( icalcomponent *alarm, Incidence::Ptr incidence,
156
 
                    ICalTimeZones *tzlist );
 
108
    bool populate(const Calendar::Ptr &calendar, icalcomponent *fs,
 
109
                  bool deleted = false, const QString &notebook = QString());
 
110
 
 
111
    icalcomponent *writeIncidence(const IncidenceBase::Ptr &incidence,
 
112
                                  iTIPMethod method = iTIPRequest,
 
113
                                  ICalTimeZones *tzList = 0,
 
114
                                  ICalTimeZones *tzUsedList = 0);
 
115
 
 
116
    icalcomponent *writeTodo(const Todo::Ptr &todo, ICalTimeZones *tzlist = 0,
 
117
                             ICalTimeZones *tzUsedList = 0);
 
118
 
 
119
    icalcomponent *writeEvent(const Event::Ptr &event, ICalTimeZones *tzlist = 0,
 
120
                              ICalTimeZones *tzUsedList = 0);
 
121
 
 
122
    icalcomponent *writeJournal(const Journal::Ptr &journal, ICalTimeZones *tzlist = 0,
 
123
                                ICalTimeZones *tzUsedList = 0);
 
124
 
 
125
    icalcomponent *writeFreeBusy(const FreeBusy::Ptr &freebusy,
 
126
                                 iTIPMethod method = iTIPPublish);
 
127
 
 
128
    void writeIncidence(icalcomponent *parent, const Incidence::Ptr &incidence,
 
129
                        ICalTimeZones *tzlist = 0, ICalTimeZones *tzUsedList = 0);
 
130
 
 
131
    icalproperty *writeDescription(const QString &description, bool isRich = false);
 
132
    icalproperty *writeSummary(const QString &summary, bool isRich = false);
 
133
    icalproperty *writeLocation(const QString &location, bool isRich = false);
 
134
    icalproperty *writeAttendee(const Attendee::Ptr &attendee);
 
135
    icalproperty *writeOrganizer(const Person::Ptr &organizer);
 
136
    icalproperty *writeAttachment(const Attachment::Ptr &attach);
 
137
    icalproperty *writeRecurrenceRule(Recurrence *);
 
138
    icalrecurrencetype writeRecurrenceRule(RecurrenceRule *recur);
 
139
    icalcomponent *writeAlarm(const Alarm::Ptr &alarm);
 
140
 
 
141
    QString extractErrorProperty(icalcomponent *);
 
142
    Todo::Ptr readTodo(icalcomponent *vtodo, ICalTimeZones *tzlist);
 
143
    Event::Ptr readEvent(icalcomponent *vevent, ICalTimeZones *tzlist);
 
144
    FreeBusy::Ptr readFreeBusy(icalcomponent *vfreebusy);
 
145
    Journal::Ptr readJournal(icalcomponent *vjournal, ICalTimeZones *tzlist);
 
146
    Attendee::Ptr readAttendee(icalproperty *attendee);
 
147
    Person::Ptr readOrganizer(icalproperty *organizer);
 
148
    Attachment::Ptr readAttachment(icalproperty *attach);
 
149
    void readIncidence(icalcomponent *parent, Incidence::Ptr incidence,
 
150
                       ICalTimeZones *tzlist);
 
151
    void readRecurrenceRule(icalproperty *rrule, Incidence::Ptr event);
 
152
    void readExceptionRule(icalproperty *rrule, Incidence::Ptr incidence);
 
153
    void readRecurrence(const struct icalrecurrencetype &r,
 
154
                        RecurrenceRule *recur);
 
155
    void readAlarm(icalcomponent *alarm, Incidence::Ptr incidence,
 
156
                   ICalTimeZones *tzlist);
157
157
 
158
158
    /**
159
159
      Returns the PRODID string loaded from calendar file.
160
160
    */
161
161
    QString loadedProductId() const;
162
162
 
163
 
    static icaltimetype writeICalDate( const QDate & );
 
163
    static icaltimetype writeICalDate(const QDate &);
164
164
 
165
165
    static QDate readICalDate(icaltimetype);
166
166
 
167
 
    static icaltimetype writeICalDateTime( const KDateTime & );
 
167
    static icaltimetype writeICalDateTime(const KDateTime &);
168
168
 
169
 
    static icaltimetype writeICalUtcDateTime( const KDateTime & );
 
169
    static icaltimetype writeICalUtcDateTime(const KDateTime &);
170
170
 
171
171
    /**
172
172
      Creates an ical property from a date/time value.
183
183
      @return property, or null if error. It is the caller's responsibility
184
184
      to free the returned property.
185
185
    */
186
 
    static icalproperty *writeICalDateTimeProperty( const icalproperty_kind kind,
187
 
                                                    const KDateTime &dt,
188
 
                                                    ICalTimeZones *tzlist = 0,
189
 
                                                    ICalTimeZones *tzUsedList = 0 );
 
186
    static icalproperty *writeICalDateTimeProperty(const icalproperty_kind kind,
 
187
            const KDateTime &dt,
 
188
            ICalTimeZones *tzlist = 0,
 
189
            ICalTimeZones *tzUsedList = 0);
190
190
 
191
191
    /**
192
192
      Converts a date/time from ICal format.
200
200
      @param utc    UTC date/time is expected
201
201
      @return date/time, converted to UTC if @p utc is @c true
202
202
    */
203
 
    static KDateTime readICalDateTime( icalproperty *p, const icaltimetype &t,
204
 
                                       ICalTimeZones *tzlist, bool utc = false );
 
203
    static KDateTime readICalDateTime(icalproperty *p, const icaltimetype &t,
 
204
                                      ICalTimeZones *tzlist, bool utc = false);
205
205
 
206
206
    /**
207
207
      Converts a UTC date/time from ICal format.
212
212
      @param tzlist time zones collection
213
213
      @return date/time, or invalid if @p t is not UTC
214
214
    */
215
 
    static KDateTime readICalUtcDateTime( icalproperty *p, icaltimetype &t,
216
 
                                          ICalTimeZones *tzlist = 0 )
 
215
    static KDateTime readICalUtcDateTime(icalproperty *p, icaltimetype &t,
 
216
                                         ICalTimeZones *tzlist = 0)
217
217
    //TODO: KDE5, move this implementation to icalformat_p.cpp
218
218
    {
219
 
      return readICalDateTime( p, t, tzlist, true );
 
219
        return readICalDateTime(p, t, tzlist, true);
220
220
    }
221
221
 
222
222
    /**
229
229
      @return date or date/time, or invalid if property doesn't contain
230
230
      a time value.
231
231
    */
232
 
    static KDateTime readICalDateTimeProperty( icalproperty *p,
233
 
                                               ICalTimeZones *tzlist, bool utc = false );
 
232
    static KDateTime readICalDateTimeProperty(icalproperty *p,
 
233
            ICalTimeZones *tzlist, bool utc = false);
234
234
 
235
235
    /**
236
236
      Reads a UTC date/time value from a property.
237
237
      @param p is a pointer to a valid icalproperty structure.
238
238
    */
239
 
    static KDateTime readICalUtcDateTimeProperty( icalproperty *p )
240
 
    { return readICalDateTimeProperty( p, 0, true ); }
241
 
 
242
 
    static icaldurationtype writeICalDuration( const Duration &duration );
243
 
 
244
 
    static Duration readICalDuration( icaldurationtype d );
245
 
 
246
 
    static icaldatetimeperiodtype writeICalDatePeriod( const QDate &date );
247
 
 
248
 
    icalcomponent *createCalendarComponent( const Calendar::Ptr &calendar = Calendar::Ptr() );
249
 
 
250
 
    icalcomponent *createScheduleComponent( const IncidenceBase::Ptr &incidence,
251
 
                                            iTIPMethod method );
252
 
 
253
 
  protected:
 
239
    static KDateTime readICalUtcDateTimeProperty(icalproperty *p)
 
240
    {
 
241
        return readICalDateTimeProperty(p, 0, true);
 
242
    }
 
243
 
 
244
    static icaldurationtype writeICalDuration(const Duration &duration);
 
245
 
 
246
    static Duration readICalDuration(icaldurationtype d);
 
247
 
 
248
    static icaldatetimeperiodtype writeICalDatePeriod(const QDate &date);
 
249
 
 
250
    icalcomponent *createCalendarComponent(const Calendar::Ptr &calendar = Calendar::Ptr());
 
251
 
 
252
    icalcomponent *createScheduleComponent(const IncidenceBase::Ptr &incidence,
 
253
                                           iTIPMethod method);
 
254
 
 
255
protected:
254
256
    // void dumpIcalRecurrence( const icalrecurrencetype &r );
255
257
 
256
 
  private:
 
258
private:
257
259
    //@cond PRIVATE
258
260
    class Private;
259
261
    Private *const d;