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