e709a58a4526d490f5535dba6aeec3d95b9fec8d
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / video-view / video-view.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
18 // CLASS HEADER
19 #include <dali-toolkit/public-api/controls/video-view/video-view.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/property-map.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/controls/video-view/video-view-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 VideoView::VideoView()
34 {
35 }
36
37 VideoView::VideoView( const VideoView& videoView )
38 : Control( videoView )
39 {
40 }
41
42 VideoView& VideoView::operator=( const VideoView& videoView )
43 {
44   if( &videoView != this )
45   {
46     Control::operator=( videoView );
47   }
48
49   return *this;
50 }
51
52 VideoView::~VideoView()
53 {
54 }
55
56 VideoView VideoView::New()
57 {
58   return Internal::VideoView::New();
59 }
60
61 VideoView VideoView::New( const std::string& url )
62 {
63   VideoView videoView = Internal::VideoView::New();
64   Dali::Toolkit::GetImpl( videoView ).SetUrl( url );
65   return videoView;
66 }
67
68 VideoView VideoView::New( bool swCodec )
69 {
70   VideoView videoView = Internal::VideoView::New();
71   Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
72   return videoView;
73 }
74
75 VideoView VideoView::New( const std::string& url, bool swCodec )
76 {
77   VideoView videoView = Internal::VideoView::New();
78   Dali::Toolkit::GetImpl( videoView ).SetUrl( url );
79   Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
80   return videoView;
81 }
82
83 VideoView VideoView::DownCast( BaseHandle handle )
84 {
85   return Control::DownCast< VideoView, Internal::VideoView >( handle );
86 }
87
88 void VideoView::Play()
89 {
90   Dali::Toolkit::GetImpl( *this ).Play();
91 }
92
93 void VideoView::Pause()
94 {
95   Dali::Toolkit::GetImpl( *this ).Pause();
96 }
97
98 void VideoView::Stop()
99 {
100   Dali::Toolkit::GetImpl( *this ).Stop();
101 }
102
103 void VideoView::Forward( int millisecond )
104 {
105   Dali::Toolkit::GetImpl( *this ).Forward( millisecond );
106 }
107
108 void VideoView::Backward( int millisecond )
109 {
110   Dali::Toolkit::GetImpl( *this ).Backward( millisecond );
111 }
112
113 VideoView::VideoViewSignalType& VideoView::FinishedSignal()
114 {
115   return Dali::Toolkit::GetImpl( *this ).FinishedSignal();
116 }
117
118 VideoView::VideoView( Internal::VideoView& implementation )
119 : Control( implementation )
120 {
121 }
122
123 VideoView::VideoView( Dali::Internal::CustomActor* internal )
124 : Control( internal )
125 {
126   VerifyCustomActorPointer< Internal::VideoView >( internal );
127 }
128
129 } // namespace Toolkit
130
131 } // namespace Dali