agendainterface/agendautil/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 class AgendaGeoValuePrivate;
       
    36 
       
    37 class XQCALENDAR_EXPORT AgendaAttendee
       
    38 {
       
    39 public:
       
    40 	enum ParticipantRole {
       
    41 		RequiredParticipant = 0,
       
    42 		OptionalParticipant,
       
    43 		NonParticipant,
       
    44 		ChairParticipant,
       
    45 		ParticipantRoleUnknown = -1
       
    46 	};
       
    47 
       
    48 	enum StatusType {
       
    49 		StatusNeedsAction = 0,
       
    50 		StatusAccepted,
       
    51 		StatusTentative,
       
    52 		StatusConfirmed,
       
    53 		StatusDeclined,
       
    54 		StatusCompleted,
       
    55 		StatusDelegated,
       
    56 		StatusInProcess,
       
    57 		StatusUnknown = -1
       
    58 	};
       
    59 
       
    60 	AgendaAttendee();
       
    61 	virtual ~AgendaAttendee();
       
    62 	AgendaAttendee(const QString& address);
       
    63 	AgendaAttendee(const AgendaAttendee& other);
       
    64 
       
    65 	void setAddress(const QString& address);
       
    66 	void setCommonName(const QString& name);
       
    67 	void setResponseRequested(bool responseRequested);
       
    68 	void setRole(ParticipantRole role);
       
    69 	void setStatus(StatusType status);
       
    70 
       
    71 	QString address() const;
       
    72 	QString commonName() const;
       
    73 	bool responseRequested() const;
       
    74 	ParticipantRole role() const;
       
    75 	StatusType status() const;
       
    76 
       
    77 	bool isNull() const;
       
    78 
       
    79 	AgendaAttendee& operator=(const AgendaAttendee& other);
       
    80 	bool operator==(const AgendaAttendee& other) const;
       
    81 	bool operator!=(const AgendaAttendee& other) const;
       
    82 
       
    83 private:
       
    84 	void detach();
       
    85 
       
    86 private:
       
    87 	AgendaAttendeePrivate* d;
       
    88 };
       
    89 
       
    90 class XQCALENDAR_EXPORT AgendaCategory
       
    91 {
       
    92 public:
       
    93 	enum CategoryType {
       
    94 		AppointmentCategory,
       
    95 		BusinessCategory,
       
    96 		EducationCategory,
       
    97 		HolidayCategory,
       
    98 		MeetingCategory,
       
    99 		MiscellaneousCategory,
       
   100 		PersonalCategory,
       
   101 		PhoneCallCategory,
       
   102 		SickDayCategory,
       
   103 		SpecialOccasionCategory,
       
   104 		TravelCategory,
       
   105 		VacationCategory,
       
   106 		ExtendedCategory,
       
   107 		UnknownCategory = -1
       
   108 	};
       
   109 
       
   110 	AgendaCategory();
       
   111 	AgendaCategory(CategoryType category);
       
   112 	AgendaCategory(const AgendaCategory& other);
       
   113 	virtual ~AgendaCategory();
       
   114 
       
   115 	void setCategory(CategoryType categoryType);
       
   116 	CategoryType category() const;
       
   117 
       
   118 	void setExtendedCategoryName(const QString& name);
       
   119 	QString extendedCategoryName() const;
       
   120 
       
   121 	bool isNull() const;
       
   122 
       
   123 	AgendaCategory& operator=(const AgendaCategory& other);
       
   124 	bool operator==(const AgendaCategory& other) const;
       
   125 	bool operator!=(const AgendaCategory& other) const;
       
   126 
       
   127 private:
       
   128 	void detach();
       
   129 
       
   130 private:
       
   131 	AgendaCategoryPrivate* d;
       
   132 };
       
   133 
       
   134 
       
   135 class XQCALENDAR_EXPORT AgendaAlarm
       
   136 {
       
   137 public:
       
   138 	static const int MaxFileNameLength = 256;
       
   139 
       
   140 	AgendaAlarm();
       
   141 	AgendaAlarm(const AgendaAlarm& other);
       
   142 	~AgendaAlarm();
       
   143 
       
   144 	void setTimeOffset(int minutes);
       
   145 	void setAlarmSoundName(const QString& alarmSoundName);
       
   146 	QString alarmSoundName() const;
       
   147 	int timeOffset() const;
       
   148 
       
   149 	bool isNull() const;
       
   150 
       
   151 	AgendaAlarm& operator=(const AgendaAlarm& other);
       
   152 	bool operator==(const AgendaAlarm& other) const;
       
   153 	bool operator!=(const AgendaAlarm& other) const;
       
   154 
       
   155 private:
       
   156 	void detach();
       
   157 
       
   158 private:
       
   159 	AgendaAlarmPrivate* d;
       
   160 };
       
   161 
       
   162 class XQCALENDAR_EXPORT AgendaGeoValue
       
   163 {
       
   164 public:
       
   165 
       
   166 	AgendaGeoValue();
       
   167 	AgendaGeoValue(const AgendaGeoValue& other);
       
   168 	~AgendaGeoValue();
       
   169 
       
   170 	void setLatLong(double latitude, double longitude);
       
   171 	void getLatLong(double& latitude, double& longitude) const;
       
   172 
       
   173 	bool isNull() const;
       
   174 
       
   175 	AgendaGeoValue& operator=(const AgendaGeoValue& other);
       
   176 	bool operator==(const AgendaGeoValue& other) const;
       
   177 	bool operator!=(const AgendaGeoValue& other) const;
       
   178 
       
   179 private:
       
   180 	void detach();
       
   181 
       
   182 private:
       
   183 	AgendaGeoValuePrivate* d;
       
   184 };
       
   185 
       
   186 class XQCALENDAR_EXPORT AgendaRepeatRule
       
   187 {
       
   188 public:
       
   189 
       
   190 	enum RuleType {
       
   191 		InvalidRule = 0,
       
   192 		DailyRule,
       
   193 		WeeklyRule,
       
   194 		MonthlyRule,
       
   195 		YearlyRule
       
   196 	};
       
   197 
       
   198 	enum Day {
       
   199 		Monday,
       
   200 		Tuesday,
       
   201 		Wednesday,
       
   202 		Thursday,
       
   203 		Friday,
       
   204 		Saturday,
       
   205 		Sunday,
       
   206 		InvalidDay = -1
       
   207 	};
       
   208 
       
   209 	enum Month {
       
   210 		January,
       
   211 		February,
       
   212 		March,
       
   213 		April,
       
   214 		May,
       
   215 		June,
       
   216 		July,
       
   217 		August,
       
   218 		September,
       
   219 		October,
       
   220 		November,
       
   221 		December,
       
   222 		InvalidMonth = -1
       
   223 	};
       
   224 
       
   225 	AgendaRepeatRule();
       
   226 	AgendaRepeatRule(RuleType type);
       
   227 	AgendaRepeatRule(const AgendaRepeatRule& other);
       
   228 	~AgendaRepeatRule();
       
   229 
       
   230 	void setType(RuleType type);
       
   231 	RuleType type() const;
       
   232 
       
   233 	int count() const;
       
   234 
       
   235 	void setInterval(int interval);
       
   236 	int interval() const;
       
   237 
       
   238 	void setUntil(const QDateTime& date);
       
   239 	QDateTime until() const;
       
   240 
       
   241 	void setRepeatRuleStart(const QDateTime& dateTime);
       
   242 	QDateTime repeatRuleStart() const;
       
   243 
       
   244 	void setWeekStart(Day day);
       
   245 	Day weekStart() const;
       
   246 
       
   247 	void setByDay(const QList<Day>& days);
       
   248 	QList<Day> byDay() const;
       
   249 
       
   250 	void setByMonthDay(const QList<int>& monthDays);
       
   251 	QList<int> byMonthDay() const;
       
   252 
       
   253 	void setByMonth(const QList<Month>& months);
       
   254 	QList<Month> byMonth() const;
       
   255 
       
   256 	bool isNull() const;
       
   257 	AgendaRepeatRule& operator=(const AgendaRepeatRule& other);
       
   258 	bool operator==(const AgendaRepeatRule& other) const;
       
   259 	bool operator!=(const AgendaRepeatRule& other) const;
       
   260 
       
   261 private:
       
   262 	void detach();
       
   263 
       
   264 private:
       
   265 	AgendaRepeatRulePrivate* d;
       
   266 };
       
   267 
       
   268 class XQCALENDAR_EXPORT AgendaEntry
       
   269 {
       
   270 public:
       
   271 	enum Type {
       
   272 		TypeAppoinment,
       
   273 		TypeTodo,
       
   274 		TypeEvent,
       
   275 		TypeReminder,
       
   276 		TypeAnniversary,
       
   277 		TypeNote,
       
   278 		TypeUnknown = -1
       
   279 	};
       
   280 
       
   281 	enum Method {
       
   282 		MethodNone,
       
   283 		MethodPublish,
       
   284 		MethodRequest,
       
   285 		MethodReply,
       
   286 		MethodAdd,
       
   287 		MethodCancel,
       
   288 		MethodRefresh,
       
   289 		MethodCounter,
       
   290 		MethodDeclineCounter,
       
   291 		MethodUnknown = -1
       
   292 	};
       
   293 
       
   294 	enum Status {
       
   295 		Tentative,
       
   296 		Confirmed,
       
   297 		Cancelled,
       
   298 		TodoNeedsAction,
       
   299 		TodoCompleted,
       
   300 		TodoInProcess,
       
   301 		NullStatus,
       
   302 
       
   303 		VCalAccepted,
       
   304 		VCalNeedsAction,
       
   305 		VCalSent,
       
   306 		VCalDeclined,
       
   307 		VCalDelegated,
       
   308 
       
   309 		StatusUnknown = -1
       
   310 	};
       
   311 
       
   312 	AgendaEntry();
       
   313 	AgendaEntry(Type type);
       
   314 	AgendaEntry(const AgendaEntry& other);
       
   315 	virtual ~AgendaEntry();
       
   316 
       
   317 	void addAttendee(const AgendaAttendee& attendee);
       
   318 	void addCategory(const AgendaCategory& category);
       
   319 
       
   320 	bool setStartAndEndTime(
       
   321 			const QDateTime& startTime, const QDateTime& endTime);
       
   322 	QDateTime startTime() const;
       
   323 	QDateTime endTime() const;
       
   324 
       
   325 	QList<AgendaAttendee>& attendees();
       
   326 	const QList<AgendaAttendee>& attendees() const;
       
   327 	QList<AgendaCategory>& categories();
       
   328 	const QList<AgendaCategory>& categories() const;
       
   329 
       
   330 	void setDescription(const QString& description);
       
   331 	QString description() const;
       
   332 
       
   333 	void setType(Type type);
       
   334 	Type type() const;
       
   335 
       
   336 	void setAlarm(const AgendaAlarm& alarm);
       
   337 	AgendaAlarm alarm() const;
       
   338 
       
   339 	void setLocation(const QString& location);
       
   340 	QString location() const;
       
   341 
       
   342 	void setSummary(const QString& summary);
       
   343 	QString summary() const;
       
   344 
       
   345 	void setMethod(Method method);
       
   346 	Method method() const;
       
   347 
       
   348 	void setRepeatRule(const AgendaRepeatRule& repeatRule);
       
   349 	AgendaRepeatRule repeatRule() const;
       
   350 
       
   351 	void setPriority(int priority);
       
   352 	int priority() const;
       
   353 
       
   354 	void setRDates(const QList<QDate>& rdates);
       
   355 	QList<QDate> rDates() const;
       
   356 
       
   357 	void setRecurrenceId(QDateTime& recTime);
       
   358 	QDateTime recurrenceId();
       
   359 
       
   360 	bool isNull() const;
       
   361 
       
   362 	ulong id() const;
       
   363 	bool isTimedEntry();
       
   364 	bool isRepeating();
       
   365 
       
   366 	QDateTime lastModifiedDateTime() const;
       
   367 	void setLastModifiedDateTime(const QDateTime& dateTime);
       
   368 
       
   369 	Status status() const;
       
   370 	void setStatus(Status status);
       
   371 
       
   372 	uint favourite() const;
       
   373 	void setFavourite(uint favourite);
       
   374 
       
   375 	void setCompletedDateTime(const QDateTime& dateTime);
       
   376 	QDateTime completedDateTime() const;
       
   377 
       
   378 	void setDTStamp(const QDateTime& dateTime);
       
   379 	QDateTime dtStamp() const;
       
   380 	
       
   381 	void setGeoValue(const AgendaGeoValue& geoValue);
       
   382 	AgendaGeoValue geoValue() const;
       
   383 	void clearGeoValue() const;
       
   384 	
       
   385 	int durationInSecs() const;
       
   386 	AgendaEntry& operator=(const AgendaEntry& other);
       
   387 	bool operator==(const AgendaEntry& other) const;
       
   388 	bool operator!=(const AgendaEntry& other) const;
       
   389 
       
   390 private:
       
   391 	void detach();
       
   392 
       
   393 private:
       
   394 	AgendaEntryPrivate* d;
       
   395 	friend class AgendaUtilPrivate;
       
   396 };
       
   397 
       
   398 #endif // AGENDAENTRY_H
       
   399 
       
   400 // End of file	--Don't remove this.