2 * Copyright (c) 2020 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 <dali/public-api/adaptor-framework/timer.h>
22 #include <dali/internal/system/common/timer-impl.h>
23 #include <dali/public-api/dali-adaptor-common.h>
31 Timer Timer::New(unsigned int milliSec)
33 Internal::Adaptor::TimerPtr internal = Internal::Adaptor::Timer::New(milliSec);
34 return Timer(internal.Get());
37 Timer::Timer(const Timer& copy) = default;
39 Timer& Timer::operator=(const Timer& rhs) = default;
41 Timer::Timer(Timer&& rhs) = default;
43 Timer& Timer::operator=(Timer&& rhs) = default;
49 Timer Timer::DownCast(BaseHandle handle)
51 return Timer(dynamic_cast<Internal::Adaptor::Timer*>(handle.GetObjectPtr()));
56 Internal::Adaptor::GetImplementation(*this).Start();
61 Internal::Adaptor::GetImplementation(*this).Stop();
66 Internal::Adaptor::GetImplementation(*this).Pause();
71 Internal::Adaptor::GetImplementation(*this).Resume();
74 void Timer::SetInterval(unsigned int interval)
76 Internal::Adaptor::GetImplementation(*this).SetInterval(interval, true);
79 void Timer::SetInterval(unsigned int interval, bool restart)
81 Internal::Adaptor::GetImplementation(*this).SetInterval(interval, restart);
84 unsigned int Timer::GetInterval() const
86 return Internal::Adaptor::GetImplementation(*this).GetInterval();
89 bool Timer::IsRunning() const
91 return Internal::Adaptor::GetImplementation(*this).IsRunning();
94 Timer::TimerSignalType& Timer::TickSignal()
96 return Internal::Adaptor::GetImplementation(*this).TickSignal();
99 Timer::Timer(Internal::Adaptor::Timer* timer)