2 * Copyright (c) 2018 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/public-api/dali-adaptor-common.h>
23 #include <dali/internal/system/common/timer-impl.h>
32 Timer Timer::New( unsigned int milliSec )
34 Internal::Adaptor::TimerPtr internal = Internal::Adaptor::Timer::New( milliSec );
35 return Timer(internal.Get());
38 Timer::Timer( const Timer& timer )
43 Timer& Timer::operator=( const Timer& timer )
45 // check self assignment
48 BaseHandle::operator=(timer);
57 Timer Timer::DownCast( BaseHandle handle )
59 return Timer( dynamic_cast<Internal::Adaptor::Timer*>( handle.GetObjectPtr() ) );
64 Internal::Adaptor::GetImplementation(*this).Start();
69 Internal::Adaptor::GetImplementation(*this).Stop();
74 Internal::Adaptor::GetImplementation(*this).Pause();
79 Internal::Adaptor::GetImplementation(*this).Resume();
82 void Timer::SetInterval( unsigned int interval )
84 Internal::Adaptor::GetImplementation(*this).SetInterval( interval, true );
87 void Timer::SetInterval( unsigned int interval, bool restart )
89 Internal::Adaptor::GetImplementation(*this).SetInterval( interval, restart );
92 unsigned int Timer::GetInterval() const
94 return Internal::Adaptor::GetImplementation(*this).GetInterval();
97 bool Timer::IsRunning() const
99 return Internal::Adaptor::GetImplementation(*this).IsRunning();
102 Timer::TimerSignalType& Timer::TickSignal()
104 return Internal::Adaptor::GetImplementation(*this).TickSignal();
107 Timer::Timer(Internal::Adaptor::Timer* timer)