079dbcd92d32f026ba497b1a7b20617ab323725c
[framework/web/wrt-plugins-common.git] / src / modules / API / Task / CalendarTask.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * @file        CalendarTask.h
18  * @author      Shi Hezhang (hezhang.shi@samsung.com)
19  * @author      Pan Rui (r.pan@samsung.com)
20  * @version     0.1
21  */
22
23 #ifndef WRTDEVICEAPIS_TASK_CALENDAR_TASK_H_
24 #define WRTDEVICEAPIS_TASK_CALENDAR_TASK_H_
25
26 #include <ctime>
27 #include <string>
28 #include <vector>
29 #include <dpl/shared_ptr.h>
30
31 namespace WrtDeviceApis {
32 namespace Task {
33 namespace Api {
34
35 //typedef std::vector<std::string> CategoryList;
36 //typedef DPL::SharedPtr<CategoryList> CategoryListPtr;
37
38 //typedef std::vector<unsigned short> StatusList;
39 //typedef DPL::SharedPtr<CategoryList> StatusListPtr;
40 //typedef std::vector<unsigned short> PriorityList;
41 //typedef DPL::SharedPtr<CategoryList> PriorityListPtr;
42
43 /* This object represents a single calendar event */
44 class CalendarTask
45 {
46   public:
47     typedef enum
48     {
49         STATUS_COMPLETED,
50         STATUS_NEEDS_ACTION,
51         STATUS_CANCELLED,
52         STATUS_IN_PROCESS,
53         INVALID_STATUS = 10000,
54         UNDEFINED_STATUS                /* should be used only to mark a fact filter is not set */
55     } TaskStatus;
56
57     typedef enum
58     {
59         HIGH_PRIORITY,
60         MEDIUM_PRIORITY,
61         LOW_PRIORITY,
62         INVALID_PRIORITY = 10000,
63         UNDEFINED_PRIORITY                /* should be used only to mark a fact filter is not set */
64     } TaskPriority;
65
66     typedef enum
67     {
68         UNDEFINED_TASK_TIME_T_VALUE = -2,
69         INVALID_TASK_TIME_T_VALUE = -1
70     } TaskTimeTValues;
71
72     typedef enum
73     {
74         UNDEFINED_TASK_ID = -1
75     } TaskIdValues;
76
77     CalendarTask();
78     virtual ~CalendarTask();
79
80     int getId() const;
81     void setId(int value);
82
83     int getTaskId() const;
84     void setTaskId(int value);
85
86     std::string getDescription() const;
87     void setDescription(const std::string &value);
88
89     std::string getSubject() const;
90     void setSubject(const std::string &value);
91
92     time_t getDueDate() const;
93     void setDueDate(time_t value);
94
95     TaskStatus getStatus() const;
96     void setStatus(TaskStatus value);
97
98     TaskPriority getPriority() const;
99     void setPriority(TaskPriority value);
100
101     void display() const;
102     bool validate() const;
103
104     bool getIdIsSet() const;
105     bool getTaskIdIsSet() const;
106     bool getDescriptionIsSet() const;
107     bool getSubjectIsSet() const;
108     bool getDueDateIsSet() const;
109     bool getStatusIsSet() const;
110     bool getPriorityIsSet() const;
111
112   protected:
113     int m_id;
114     int m_taskId;
115     std::string m_description;
116     std::string m_subject;
117     time_t m_dueDate;
118     TaskStatus m_status;
119     TaskPriority m_priority;
120
121     bool m_descriptionIsSet;
122     bool m_subjectIsSet;
123 };
124
125 typedef DPL::SharedPtr<CalendarTask> CalendarTaskPtr;
126
127 }
128 }
129 }
130
131 #endif // WRTDEVICEAPIS_TASK_CALENDAR_TASK_H_