2 * Copyright (c) 2014 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.
22 #include <dali/public-api/common/dali-common.h>
25 #include <timer-impl.h>
34 Timer Timer::New( unsigned int milliSec )
36 Internal::Adaptor::TimerPtr internal = Internal::Adaptor::Timer::New( milliSec );
37 return Timer(internal.Get());
40 Timer::Timer( const Timer& timer )
45 Timer& Timer::operator=( const Timer& timer )
47 // check self assignment
50 BaseHandle::operator=(timer);
55 Timer& Timer::operator=(BaseHandle::NullType* rhs)
57 DALI_ASSERT_ALWAYS( (rhs == NULL) && "Can only assign NULL pointer to handle");
66 Timer Timer::DownCast( BaseHandle handle )
68 return Timer( dynamic_cast<Internal::Adaptor::Timer*>( handle.GetObjectPtr() ) );
73 Internal::Adaptor::GetImplementation(*this).Start();
78 Internal::Adaptor::GetImplementation(*this).Stop();
81 void Timer::SetInterval( unsigned int interval )
83 Internal::Adaptor::GetImplementation(*this).SetInterval( interval );
86 unsigned int Timer::GetInterval() const
88 return Internal::Adaptor::GetImplementation(*this).GetInterval();
91 bool Timer::IsRunning() const
93 return Internal::Adaptor::GetImplementation(*this).IsRunning();
96 Timer::TimerSignalV2& Timer::TickSignal()
98 return Internal::Adaptor::GetImplementation(*this).TickSignal();
101 Timer::Timer(Internal::Adaptor::Timer* timer)