Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Alarm / AlarmRecurrence.cpp
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 #include "AlarmRecurrence.h"
18
19 namespace TizenApis {
20 namespace Api {
21 namespace Alarm {
22
23 AlarmRecurrence::AlarmRecurrence()
24 {
25     m_frequency = NO_RECURRENCE;
26     m_interval = 0;
27 }
28
29 AlarmRecurrence::~AlarmRecurrence()
30 {
31 }
32
33 void AlarmRecurrence::setFrequency(AlarmRecurrence::alarm_frequency_e frequency)
34 {
35     m_frequency = frequency;
36 }
37
38 AlarmRecurrence::alarm_frequency_e AlarmRecurrence::getFrequency()
39 {
40     return m_frequency;
41 }
42 void AlarmRecurrence::setInterval(int interval)
43 {
44     m_interval = interval;
45 }
46 int AlarmRecurrence::getInterval()
47 {
48     return m_interval;
49 }
50 void AlarmRecurrence::setDaysOfTheWeek(std::vector<std::string> daysOfTheWeek)
51 {
52     // copy vector
53     m_daysOfTheWeek.clear();
54     m_daysOfTheWeek.assign(daysOfTheWeek.begin(), daysOfTheWeek.end());
55     m_frequency = DAYS_OF_THE_WEEK_RECURRENCE;
56 }
57 std::vector<std::string> AlarmRecurrence::getDaysOfTheWeek()
58 {
59     return m_daysOfTheWeek;
60 }
61
62 void AlarmRecurrence::setData(AlarmRecurrencePtr ptr)
63 {
64     setFrequency(ptr->getFrequency());
65     setInterval(ptr->getInterval());
66     setDaysOfTheWeek(ptr->getDaysOfTheWeek());
67 }
68
69 }
70 }
71 }
72