Add move semantics to BaseHandle derived classes in Adaptor public API
[platform/core/uifw/dali-adaptor.git] / dali / public-api / capture / capture.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/public-api/capture/capture.h>
20
21 // INTERNAL HEADER
22 #include <dali/internal/system/common/capture-impl.h>
23
24 namespace Dali
25 {
26
27 Capture::Capture()
28 {
29 }
30
31 Capture Capture::New()
32 {
33   Internal::Adaptor::CapturePtr internal = Internal::Adaptor::Capture::New();
34
35   return Capture( internal.Get() );
36 }
37
38 Capture Capture::New( Dali::CameraActor cameraActor )
39 {
40   Internal::Adaptor::CapturePtr internal = Internal::Adaptor::Capture::New( cameraActor );
41
42   return Capture( internal.Get() );
43 }
44
45 Capture Capture::DownCast( BaseHandle handle )
46 {
47   return Capture( dynamic_cast< Internal::Adaptor::Capture* >( handle.GetObjectPtr() ) );
48 }
49
50 Capture::~Capture()
51 {
52 }
53
54 Capture::Capture( const Capture& copy ) = default;
55
56 Capture& Capture::operator=( const Capture& rhs ) = default;
57
58 Capture::Capture( Capture&& rhs ) = default;
59
60 Capture& Capture::operator=( Capture&& rhs ) = default;
61
62 void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality )
63 {
64   GetImpl( *this ).Start( source, size, path, clearColor, quality );
65 }
66
67 void Capture::Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor )
68 {
69   GetImpl( *this ).Start( source, size, path, clearColor );
70 }
71
72 void Capture::Start( Actor source, const Vector2& size, const std::string &path )
73 {
74   GetImpl( *this ).Start( source, size, path, Dali::Color::TRANSPARENT );
75 }
76
77 Dali::NativeImageSourcePtr Capture::GetNativeImageSource() const
78 {
79   return GetImpl( *this ).GetNativeImageSource();
80 }
81
82 Capture::CaptureFinishedSignalType& Capture::FinishedSignal()
83 {
84   return GetImpl( *this ).FinishedSignal();
85 }
86
87 Capture::Capture( Internal::Adaptor::Capture* internal )
88 : BaseHandle( internal )
89 {
90 }
91
92 } // namespace Dali