0b24ef33c4b79cb4624a1eb0041c3594f5be38bb
[platform/framework/native/vision.git] / src / FUixVision_QrCodeGeneratorImpl.h
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
19 /**
20  * @file     FUixVision_QrCodeGeneratorImpl.h
21  * @brief    This is the header file for the %Tizen::Uix::_QrCodeGeneratorImpl class.
22  */
23
24 #ifndef _FUIX_VISION_INTERNAL_QR_CODE_GENERATOR_IMPL_H_
25 #define _FUIX_VISION_INTERNAL_QR_CODE_GENERATOR_IMPL_H_
26
27 #include <FUixVisionQrCodeGenerator.h>
28 #include "QRCodeGenerator.h"
29 #include <cstring>
30
31
32 namespace Tizen { namespace Uix { namespace Vision
33 {
34 class _QrCodeGeneratorImpl
35 {
36 public:
37     _QrCodeGeneratorImpl(void);
38     ~_QrCodeGeneratorImpl(void);
39
40     bool Encode(const char* message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility = true);
41     bool GetSize(int& width, int& height);
42     bool SaveToFile(const Tizen::Base::String& imagepath, Tizen::Media::ImageFormat imageFormat = Tizen::Media::IMG_FORMAT_BMP);
43     bool SaveToBuffer(unsigned char* image);
44
45 public:
46     static _QrCodeGeneratorImpl* GetInstance(QrCodeGenerator* pQrGenerator);
47     static const _QrCodeGeneratorImpl* GetInstance(const QrCodeGenerator* pQrGenerator);
48
49 private:
50     _QrCodeGeneratorImpl(const _QrCodeGeneratorImpl&); ///< Forbides copy constructor.
51     _QrCodeGeneratorImpl& operator=(const _QrCodeGeneratorImpl&); ///< Forbides assignment operator.
52     sari2::QRCodeGenerator __qrCodeGenerator;
53
54 };
55
56 } } } //Tizen::Uix::Vision
57
58 #endif //_FUIX_VISION_INTERNAL_QR_CODE_GENERATOR_IMPL_H_