2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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.
19 #include <wearable/watch/watch-time.h>
22 #ifdef APPCORE_WATCH_AVAILABLE
23 #include <appcore-watch/watch_app.h>
29 struct WatchTime::Impl
31 Impl(void *time_handle)
32 : mTimeHandle(time_handle)
39 WatchTime::WatchTime(void *time_handle)
41 mImpl = new Impl(time_handle);
44 WatchTime::~WatchTime()
53 #ifdef APPCORE_WATCH_AVAILABLE
55 WatchTime::WatchTime()
57 watch_time_h watch_time = {0,};
59 watch_time_get_current_time(&watch_time);
60 mImpl = new Impl(watch_time);
63 int WatchTime::GetHour() const
67 watch_time_get_hour(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &hour);
71 int WatchTime::GetHour24() const
75 watch_time_get_hour24(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &hour24);
79 int WatchTime::GetMinute() const
83 watch_time_get_minute(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &minute);
87 int WatchTime::GetSecond() const
91 watch_time_get_second(reinterpret_cast<watch_time_h>(mImpl->mTimeHandle), &second);
96 WatchTime::WatchTime()
101 int WatchTime::GetHour() const
106 int WatchTime::GetHour24() const
111 int WatchTime::GetMinute() const
116 int WatchTime::GetSecond() const