agendainterface/inc/agendaentry.h
changeset 55 2c54b51f39c4
parent 51 0b38fc5b94c6
child 57 bb2d3e476f29
equal deleted inserted replaced
51:0b38fc5b94c6 55:2c54b51f39c4
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Header file for AgendaEntry and utility classes.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef AGENDAENTRY_H
       
    19 #define AGENDAENTRY_H
       
    20 
       
    21 // System includes
       
    22 #include <QObject>
       
    23 
       
    24 // User includes
       
    25 #include "agendainterfacedefines.h"
       
    26 
       
    27 // Forward declarations
       
    28 class QDate;
       
    29 class QDateTime;
       
    30 class AgendaAlarmPrivate;
       
    31 class AgendaAttendeePrivate;
       
    32 class AgendaCategoryPrivate;
       
    33 class AgendaEntryPrivate;
       
    34 class AgendaRepeatRulePrivate;
       
    35 
       
    36 class XQCALENDAR_EXPORT AgendaAttendee
       
    37 {
       
    38 public:
       
    39 	enum ParticipantRole {
       
    40 		RequiredParticipant = 0,
       
    41 		OptionalParticipant,
       
    42 		NonParticipant,
       
    43 		ChairParticipant,
       
    44 		ParticipantRoleUnknown = -1
       
    45 	};
       
    46 
       
    47 	enum StatusType {
       
    48 		StatusNeedsAction = 0,
       
    49 		StatusAccepted,
       
    50 		StatusTentative,
       
    51 		StatusConfirmed,
       
    52 		StatusDeclined,
       
    53 		StatusCompleted,
       
    54 		StatusDelegated,
       
    55 		StatusInProcess,
       
    56 		StatusUnknown = -1
       
    57 	};
       
    58 
       
    59 	AgendaAttendee();
       
    60 	virtual ~AgendaAttendee();
       
    61 	AgendaAttendee(const QString& address);
       
    62 	AgendaAttendee(const AgendaAttendee& other);
       
    63 
       
    64 	void setAddress(const QString& address);
       
    65 	void setCommonName(const QString& name);
       
    66 	void setResponseRequested(bool responseRequested);
       
    67 	void setRole(ParticipantRole role);
       
    68 	void setStatus(StatusType status);
       
    69 
       
    70 	QString address() const;
       
    71 	QString commonName() const;
       
    72 	bool responseRequested() const;
       
    73 	ParticipantRole role() const;
       
    74 	StatusType status() const;
       
    75 
       
    76 	bool isNull() const;
       
    77 
       
    78 	AgendaAttendee& operator=(const AgendaAttendee& other);
       
    79 	bool operator==(const AgendaAttendee& other) const;
       
    80 	bool operator!=(const AgendaAttendee& other) const;
       
    81 
       
    82 private:
       
    83 	void detach();
       
    84 
       
    85 private:
       
    86 	AgendaAttendeePrivate* d;
       
    87 };
       
    88 
       
    89 class XQCALENDAR_EXPORT AgendaCategory
       
    90 {
       
    91 public:
       
    92 	enum CategoryType {
       
    93 		AppointmentCategory,
       
    94 		BusinessCategory,
       
    95 		EducationCategory,
       
    96 		HolidayCategory,
       
    97 		MeetingCategory,
       
    98 		MiscellaneousCategory,
       
    99 		PersonalCategory,
       
   100 		PhoneCallCategory,
       
   101 		SickDayCategory,
       
   102 		SpecialOccasionCategory,
       
   103 		TravelCategory,
       
   104 		VacationCategory,
       
   105 		ExtendedCategory,
       
   106 		UnknownCategory = -1
       
   107 	};
       
   108 
       
   109 	AgendaCategory();
       
   110 	AgendaCategory(CategoryType category);
       
   111 	AgendaCategory(const AgendaCategory& other);
       
   112 	virtual ~AgendaCategory();
       
   113 
       
   114 	void setCategory(CategoryType categoryType);
       
   115 	CategoryType category() const;
       
   116 
       
   117 	void setExtendedCategoryName(const QString& name);
       
   118 	QString extendedCategoryName() const;
       
   119 
       
   120 	bool isNull() const;
       
   121 
       
   122 	AgendaCategory& operator=(const AgendaCategory& other);
       
   123 	bool operator==(const AgendaCategory& other) const;
       
   124 	bool operator!=(const AgendaCategory& other) const;
       
   125 
       
   126 private:
       
   127 	void detach();
       
   128 
       
   129 private:
       
   130 	AgendaCategoryPrivate* d;
       
   131 };
       
   132 
       
   133 
       
   134 class XQCALENDAR_EXPORT AgendaAlarm
       
   135 {
       
   136 public:
       
   137 	static const int MaxFileNameLength = 256;
       
   138 
       
   139 	AgendaAlarm();
       
   140 	AgendaAlarm(const AgendaAlarm& other);
       
   141 	~AgendaAlarm();
       
   142 
       
   143 	void setTimeOffset(int minutes);
       
   144 	void setAlarmSoundName(const QString& alarmSoundName);
       
   145 	QString alarmSoundName() const;
       
   146 	int timeOffset() const;
       
   147 
       
   148 	bool isNull() const;
       
   149 
       
   150 	AgendaAlarm& operator=(const AgendaAlarm& other);
       
   151 	bool operator==(const AgendaAlarm& other) const;
       
   152 	bool operator!=(const AgendaAlarm& other) const;
       
   153 
       
   154 private:
       
   155 	void detach();
       
   156 
       
   157 private:
       
   158 	AgendaAlarmPrivate* d;
       
   159 };
       
   160 
       
   161 class XQCALENDAR_EXPORT AgendaRepeatRule
       
   162 {
       
   163 public:
       
   164 
       
   165 	enum RuleType {
       
   166 		InvalidRule = 0,
       
   167 		DailyRule,
       
   168 		WeeklyRule,
       
   169 		MonthlyRule,
       
   170 		YearlyRule
       
   171 	};
       
   172 
       
   173 	enum Day {
       
   174 		Monday,
       
   175 		Tuesday,
       
   176 		Wednesday,
       
   177 		Thursday,
       
   178 		Friday,
       
   179 		Saturday,
       
   180 		Sunday,
       
   181 		InvalidDay = -1
       
   182 	};
       
   183 
       
   184 	enum Month {
       
   185 		January,
       
   186 		February,
       
   187 		March,
       
   188 		April,
       
   189 		May,
       
   190 		June,
       
   191 		July,
       
   192 		August,
       
   193 		September,
       
   194 		October,
       
   195 		November,
       
   196 		December,
       
   197 		InvalidMonth = -1
       
   198 	};
       
   199 
       
   200 	AgendaRepeatRule();
       
   201 	AgendaRepeatRule(RuleType type);
       
   202 	AgendaRepeatRule(const AgendaRepeatRule& other);
       
   203 	~AgendaRepeatRule();
       
   204 
       
   205 	void setType(RuleType type);
       
   206 	RuleType type() const;
       
   207 
       
   208 	int count() const;
       
   209 
       
   210 	void setInterval(int interval);
       
   211 	int interval() const;
       
   212 
       
   213 	void setUntil(const QDateTime& date);
       
   214 	QDateTime until() const;
       
   215 
       
   216 	void setRepeatRuleStart(const QDateTime& date);
       
   217 	QDateTime repeatRuleStart() const;
       
   218 
       
   219 	void setWeekStart(Day day);
       
   220 	Day weekStart() const;
       
   221 
       
   222 	void setByDay(const QList<Day>& days);
       
   223 	QList<Day> byDay() const;
       
   224 
       
   225 	void setByMonthDay(const QList<int>& monthDays);
       
   226 	QList<int> byMonthDay() const;
       
   227 
       
   228 	void setByMonth(const QList<Month>& months);
       
   229 	QList<Month> byMonth() const;
       
   230 
       
   231 	bool isNull() const;
       
   232 	AgendaRepeatRule& operator=(const AgendaRepeatRule& other);
       
   233 	bool operator==(const AgendaRepeatRule& other) const;
       
   234 	bool operator!=(const AgendaRepeatRule& other) const;
       
   235 
       
   236 private:
       
   237 	void detach();
       
   238 
       
   239 private:
       
   240 	AgendaRepeatRulePrivate* d;
       
   241 };
       
   242 
       
   243 class XQCALENDAR_EXPORT AgendaEntry
       
   244 {
       
   245 public:
       
   246 	enum Type {
       
   247 		TypeAppoinment,
       
   248 		TypeTodo,
       
   249 		TypeEvent,
       
   250 		TypeReminder,
       
   251 		TypeAnniversary,
       
   252 		TypeNote,
       
   253 		TypeUnknown = -1
       
   254 	};
       
   255 
       
   256 	enum Method {
       
   257 		MethodNone,
       
   258 		MethodPublish,
       
   259 		MethodRequest,
       
   260 		MethodReply,
       
   261 		MethodAdd,
       
   262 		MethodCancel,
       
   263 		MethodRefresh,
       
   264 		MethodCounter,
       
   265 		MethodDeclineCounter,
       
   266 		MethodUnknown = -1
       
   267 	};
       
   268 
       
   269 	enum Status {
       
   270 		Tentative,
       
   271 		Confirmed,
       
   272 		Cancelled,
       
   273 		TodoNeedsAction,
       
   274 		TodoCompleted,
       
   275 		TodoInProcess,
       
   276 		NullStatus,
       
   277 
       
   278 		VCalAccepted,
       
   279 		VCalNeedsAction,
       
   280 		VCalSent,
       
   281 		VCalDeclined,
       
   282 		VCalDelegated,
       
   283 
       
   284 		StatusUnknown = -1
       
   285 	};
       
   286 
       
   287 	AgendaEntry();
       
   288 	AgendaEntry(Type type);
       
   289 	AgendaEntry(const AgendaEntry& other);
       
   290 	virtual ~AgendaEntry();
       
   291 
       
   292 	void addAttendee(const AgendaAttendee& attendee);
       
   293 	void addCategory(const AgendaCategory& category);
       
   294 
       
   295 	bool setStartAndEndTime(
       
   296 			const QDateTime& startTime, const QDateTime& endTime);
       
   297 	QDateTime startTime() const;
       
   298 	QDateTime endTime() const;
       
   299 
       
   300 	QList<AgendaAttendee>& attendees();
       
   301 	const QList<AgendaAttendee>& attendees() const;
       
   302 	QList<AgendaCategory>& categories();
       
   303 	const QList<AgendaCategory>& categories() const;
       
   304 
       
   305 	void setDescription(const QString& description);
       
   306 	QString description() const;
       
   307 
       
   308 	void setType(Type type);
       
   309 	Type type() const;
       
   310 
       
   311 	void setAlarm(const AgendaAlarm& alarm);
       
   312 	AgendaAlarm alarm() const;
       
   313 
       
   314 	void setLocation(const QString& location);
       
   315 	QString location() const;
       
   316 
       
   317 	void setSummary(const QString& summary);
       
   318 	QString summary() const;
       
   319 
       
   320 	void setMethod(Method method);
       
   321 	Method method() const;
       
   322 
       
   323 	void setRepeatRule(const AgendaRepeatRule& repeatRule);
       
   324 	AgendaRepeatRule repeatRule() const;
       
   325 
       
   326 	void setPriority(int priority);
       
   327 	int priority() const;
       
   328 
       
   329 	void setRDates(const QList<QDate>& rdates);
       
   330 	QList<QDate> rDates() const;
       
   331 
       
   332 	void setRecurrenceId(QDateTime& recTime);
       
   333 	QDateTime recurrenceId();
       
   334 
       
   335 	bool isNull() const;
       
   336 
       
   337 	ulong id() const;
       
   338 	bool isTimedEntry();
       
   339 	bool isRepeating();
       
   340 
       
   341 	QDateTime lastModifiedDateTime() const;
       
   342 	void setLastModifiedDateTime(const QDateTime& dateTime);
       
   343 
       
   344 	Status status() const;
       
   345 	void setStatus(Status status);
       
   346 
       
   347 	uint favourite() const;
       
   348 	void setFavourite(uint favourite);
       
   349 
       
   350 	void setCompletedDateTime(const QDateTime& dateTime);
       
   351 	QDateTime completedDateTime() const;
       
   352 
       
   353 	void setDTStamp(const QDateTime& dateTime);
       
   354 	QDateTime dtStamp() const;
       
   355 
       
   356 	int durationInSecs() const;
       
   357 	AgendaEntry& operator=(const AgendaEntry& other);
       
   358 	bool operator==(const AgendaEntry& other) const;
       
   359 	bool operator!=(const AgendaEntry& other) const;
       
   360 
       
   361 private:
       
   362 	void detach();
       
   363 
       
   364 private:
       
   365 	AgendaEntryPrivate* d;
       
   366 	friend class AgendaUtilPrivate;
       
   367 };
       
   368 
       
   369 #endif // AGENDAENTRY_H
       
   370 
       
   371 // End of file	--Don't remove this.