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