2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @author Shi Hezhang (hezhang.shi@samsung.com)
19 * @author Pan Rui (r.pan@samsung.com)
23 #ifndef WRTDEVICEAPIS_TASK_TASK_WRAPPER_H_
24 #define WRTDEVICEAPIS_TASK_TASK_WRAPPER_H_
27 #include <calendar-svc-provider.h>
28 #include <calendar-svc-errors.h>
29 #include <dpl/shared_ptr.h>
30 #include <Task/CalendarTask.h>
31 #include <Task/TaskFilter.h>
33 namespace WrtDeviceApis {
36 const int PLATFORM_UNSUPPORTED_DATE_YEAR = 69;
42 explicit TaskWrapper(const Api::CalendarTaskPtr &task);
43 virtual ~TaskWrapper();
44 cal_struct *convertAbstractTaskToPlatformTask();
45 Api::CalendarTaskPtr convertPlatformTaskToAbstractTask();
46 cal_struct *getPlatformTask() const;
47 Api::CalendarTaskPtr getAbstractTask() const;
48 void freePlatformTask();
50 void loadTask(int id);
52 bool matchFilters(Api::TaskFilterPtr filter);
55 int getIDFromPlatformTask() const;
56 int getStatusFromPlatformTask() const;
57 int getPriorityFromPlatformTask() const;
59 void setDescriptionToPlatformTask();
60 void setSubjectToPlatformTask();
61 void setDueDateToPlatformTask();
62 void setStatusToPlatformTask();
63 void setPriorityToPlatformTask();
64 void setIDToPlatformTask();
66 void setDescriptionFromPlatformTask();
67 void setSubjectFromPlatformTask();
68 void setDueDateFromPlatformTask();
69 void setStatusFromPlatformTask();
70 void setPriorityFromPlatformTask();
71 void setIDFromPlatformTask();
73 //temporaty solution to cover plafrorm bug
74 //int calendar_svc_struct_set_int(cal_struct* record, const char* field, int intval);
76 void displayAbstractTask(); //only for debugging
77 void displayPlatformTask(); //only for debugging
79 cal_struct *m_platformTask;
80 Api::CalendarTaskPtr m_abstractTask;
83 typedef DPL::SharedPtr<TaskWrapper> TaskWrapperPtr;
86 #endif // WRTDEVICEAPIS_TASK_TASK_WRAPPER_H_