2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 #ifndef _EVENT_RECURRENCE_RULE_H_
20 #define _EVENT_RECURRENCE_RULE_H_
25 #include <dpl/shared_ptr.h>
27 #include <JavaScriptCore/JavaScript.h>
32 typedef std::vector<std::string> StringArray;
33 typedef DPL::SharedPtr<StringArray> StringArrayPtr;
35 typedef std::vector<long long int> NumberArray;
36 typedef DPL::SharedPtr<NumberArray> NumberArrayPtr;
38 #define UNDEFINED_TIME -1
39 #define DEFAULT_TIMEZONE ""
40 #define DEFAULT_INTERVAL 1
42 class EventRecurrenceRule
56 EventRecurrenceRule();
57 virtual ~EventRecurrenceRule();
59 EventRecurrence getFrequency() const;
60 void setFrequency(const EventRecurrence &value);
62 int getInterval() const;
63 void setInterval(const int &value);
65 long long int getEndDate() const;
66 void setEndDate(long long int value);
68 long getOccurrenceCount() const;
69 void setOccurrenceCount(long value);
71 std::vector<int> getDaysOfTheMonth() const;
72 void setDaysOfTheMonth(std::vector<int> value);
74 StringArrayPtr getDaysOfTheWeek() const;
75 void setDaysOfTheWeek(StringArrayPtr value);
76 JSObjectRef getDaysOfTheWeekJSRef() const;
77 void setDaysOfTheWeekJSRef(const JSObjectRef value);
79 std::vector<int> getDaysOfTheYear() const;
80 void setDaysOfTheYear(std::vector<int> value);
82 std::vector<int> getWeeksOfTheYear() const;
83 void setWeeksOfTheYear(std::vector<int> value);
85 NumberArrayPtr getSetPositions() const;
86 void setSetPositions(NumberArrayPtr value);
87 JSObjectRef getSetPositionsJSRef() const;
88 void setSetPositionsJSRef(const JSObjectRef value);
90 NumberArrayPtr getExceptions() const;
91 void setExceptions(NumberArrayPtr value);
92 JSObjectRef getExceptionsJSRef() const;
93 void setExceptionsJSRef(const JSObjectRef value);
95 std::string getTimeZone() const;
96 void setTimeZone(std::string value);
98 JSContextRef getContext() const;
99 void setContext(const JSContextRef contextRef);
102 EventRecurrence m_frequency;
104 long long int m_endDate;
105 long m_occurrenceCount;
106 std::vector<int> m_daysOfTheMonth;
107 StringArrayPtr m_daysOfTheWeek;
108 JSObjectRef m_daysOfTheWeekJSRef;
109 std::vector<int> m_daysOfTheYear;
110 std::vector<int> m_weeksOfTheYear;
111 NumberArrayPtr m_setPositions;
112 JSObjectRef m_setPositionsJSRef;
113 NumberArrayPtr m_exceptions;
114 JSObjectRef m_exceptionsJSRef;
115 std::string m_timeZone;
117 JSContextRef m_context;
120 typedef DPL::SharedPtr<EventRecurrenceRule> EventRecurrenceRulePtr;
125 #endif /* _EVENT_RECURRENCE_RULE_H_ */