patch for rc20
[framework/osp/vision.git] / src / FUixVisionQrCodeObject.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #include <FUixVisionQrCodeObject.h>
19 #include "FUixVision_QrCodeObjectImpl.h"
20
21 namespace Tizen { namespace Uix { namespace Vision
22 {
23
24 QrCodeObject::QrCodeObject(void)
25     : __pQrCodeObjectImpl(0)
26 {
27     std::unique_ptr<_QrCodeObjectImpl> pQrCodeObjectImpl(new (std::nothrow) _QrCodeObjectImpl());
28     __pQrCodeObjectImpl = pQrCodeObjectImpl.release();
29 }
30
31 QrCodeObject::~QrCodeObject(void)
32 {
33     if (__pQrCodeObjectImpl != null)
34     {
35         delete __pQrCodeObjectImpl;
36         __pQrCodeObjectImpl = null;
37     }
38 }
39
40 int
41 QrCodeObject::GetId(void) const
42 {
43     if (__pQrCodeObjectImpl)
44     {
45         return __pQrCodeObjectImpl->GetId();
46     }
47     else
48     {
49         return -1;
50     }
51 }
52
53 int
54 QrCodeObject::GetVersion(void) const
55 {
56     if (__pQrCodeObjectImpl)
57     {
58         return __pQrCodeObjectImpl->GetVersion();
59     }
60     else
61     {
62         return 0;
63     }
64 }
65
66 Tizen::Uix::Vision::QrCodeErrorCorrectionLevel
67 QrCodeObject::GetErrorCorrectionLevel(void) const
68 {
69     if (__pQrCodeObjectImpl)
70     {
71         return __pQrCodeObjectImpl->GetErrorCorrectionLevel();
72     }
73     else
74     {
75         return Tizen::Uix::Vision::QR_CODE_ERROR_CORRECTION_LEVEL_L;
76     }
77 }
78
79 Tizen::Base::String
80 QrCodeObject::GetText(void) const
81 {
82     if (__pQrCodeObjectImpl)
83     {
84         return __pQrCodeObjectImpl->GetText();
85     }
86     else
87     {
88         return Tizen::Base::String("");
89     }
90 }
91
92 const Tizen::Graphics::FloatMatrix4*
93 QrCodeObject::GetTransformMatrix(void) const
94 {
95     if (__pQrCodeObjectImpl)
96     {
97         return __pQrCodeObjectImpl->GetTransformMatrix();
98     }
99     else
100     {
101         return null;
102     }
103 }
104 const Tizen::Base::Collection::IListT<Tizen::Graphics::FloatPoint>*
105 QrCodeObject::GetRectangle(void) const
106 {
107     if (__pQrCodeObjectImpl)
108     {
109         return __pQrCodeObjectImpl->GetRectangle();
110     }
111     else
112     {
113         return null;
114     }
115 }
116
117 bool
118 QrCodeObject::Equals(const Object& obj) const
119 {
120     return (static_cast<const Object*>(this) == &obj);
121 }
122
123 int
124 QrCodeObject::GetHashCode(void) const
125 {
126     return (int)__pQrCodeObjectImpl;
127 }
128
129 } } } //Tizen::Uix::Vision