modify doxygen comments
[platform/framework/native/vision.git] / inc / FUixVisionQrCodeGenerator.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     FUixVisionQrCodeGenerator.h
21  * @brief    This is the header file for the %QrCodeGenerator class.
22  *
23  * This header file contains the declarations of the %QrCodeGenerator class.
24  */
25
26 #ifndef _FUIX_VISION_QR_CODE_GENERATOR_H_
27 #define _FUIX_VISION_QR_CODE_GENERATOR_H_
28 #include <FBaseObject.h>
29 #include <FGrpBitmap.h>
30 #include <FBase.h>
31 #include <FMedia.h>
32 #include "FUixVisionQrCodeTypes.h"
33
34
35 namespace Tizen { namespace Uix { namespace Vision
36 {
37
38 /**
39  * @class    QrCodeGenerator
40  * @brief    This class provides methods to generate a QR code image.
41  *
42  * @since    2.1
43  *
44  * The %QrCodeGenerator class provides methods to generate a QR code image.
45  *
46  * The following example demonstrates how to use the %QrCodeGenerator class.
47  *
48  * @code
49  * Tizen::Uix::Vision::QrCodeGenerator qrGen;
50  * qrGen.Construct();
51  *
52  * qrGen.EncodeToFile("test message", Tizen::Uix::Vision::QR_MODE_UTF8, Tizen::Uix::Vision::QR_ECL_Q, "/mnt/ums/Others/temp.bmp", Tizen::Media::IMG_FORMAT_PNG);
53  * @endcode
54  */
55 class _OSP_EXPORT_ QrCodeGenerator
56     : public Tizen::Base::Object
57 {
58 public:
59
60     /**
61      * This is the default constructor for this class. @n
62      * The object is not fully constructed after this constructor is called. @n
63      * For full construction, the Construct() method must be called right after calling this constructor.
64      *
65      * @since    2.1
66      */
67     QrCodeGenerator(void);
68
69     /**
70      * This is the destructor for this class. @n
71      * The resources are deallocated by this method.
72      * This destructor overrides Tizen::Base::Object::~Object().
73      *
74      * @since    2.1
75      */
76     ~QrCodeGenerator(void);
77
78     /**
79      * Initializes this instance of %QRCodeGenerator. @n
80      * Every application must call %Construct() before calling any other methods of %QRCodeGenerator.
81      *
82      * @since        2.1
83      *
84      * @feature      %http://tizen.org/feature/vision.qrcode_generation
85      *
86      * @exception    E_SUCCESS          The method is successful.
87      * @exception    E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. 
88      * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
89      * @remarks      Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
90      */
91     result Construct(void);
92
93     /**
94      * Gets a list of supported image file formats.
95      *
96      * @since        2.1
97          *
98      * @return       A list of supported image file formats
99      */
100     static Tizen::Base::Collection::IListT<Tizen::Media::ImageFormat>* GetSupportedImageFileFormatsListN(void);
101
102     /**
103      * Encodes a QR code into a file.
104      *
105      * @since        2.1
106      *
107      * @return       An error code
108      * @param[in]    message                The text to encode to QR code image
109      * @param[in]    mode                   The input text encoding format (QR_CODE_MODE_ALPHANUMERIC, QR_CODE_MODE_BYTE, QR_CODE_MODE_UTF8)
110      * @param[in]    errorCorrectionLevel   The QR code error correction level
111      * @param[in]    compatibility          The compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_MODE_UTF8
112      * @param[in]    imageFilePath          The file path of the generated QR code image
113      * @param[in]    imageFormat            The image file format of the generated QR code image
114      * @param[out]   width                  The width of the generated QR code image
115      * @param[out]   height                 The height of the generated QR code image
116      * @exception    E_SUCCESS              The method is successful.
117      * @exception    E_INVALID_ARG          A specified input parameter is invalid.
118      * @exception    E_FILE_NOT_FOUND       The specified file cannot be found or accessed.
119      *
120      * @remarks      QR code encoding for UTF-8 is not standardized as yet.
121      *               So we support UTF-8 encoding/decoding compatibility to zxing(http://code.google.com/p/zxing/) library.
122      */
123     result EncodeToFile(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel errorCorrectionLevel, bool compatibility, const Tizen::Base::String& imageFilePath, Tizen::Media::ImageFormat imageFormat, int& width, int& height);
124
125     /**
126      * Encodes a QR code into a byte buffer.
127      *
128      * @since        2.1
129      *
130      * @return       A pointer to the Tizen::Base::ByteBuffer instance containing the generated QR code image
131      * @param[in]    message                  The text to encode to QR code image
132      * @param[in]    mode                     The input text encoding format (QR_MODE_ALPHANUMERIC, QR_MODE_BYTE, QR_MODE_UTF8)
133      * @param[in]    error_level              The QR code error correction level
134      * @param[in]    compatibility            The compatibility mode with zxing library for UTF-8 codes mode when mode is selected with QR_MODE_UTF8
135      * @param[out]   width                    The width of the generated QR code image
136      * @param[out]   height                   The height of the generated QR code image
137      * @exception    E_SUCCESS                The method is successful.
138      * @exception    E_INVALID_ARG            A specified input parameter is invalid.
139      *
140      * @remarks      QR code encoding for UTF-8 is not standardized as yet.
141      *               So we support UTF-8 encoding/decoding compatibility to zxing(http://code.google.com/p/zxing/) library.
142      */
143     Tizen::Base::ByteBuffer* EncodeToBufferN(const Tizen::Base::String& message, QrCodeMode mode, QrCodeErrorCorrectionLevel error_level, bool compatibility, int& width, int& height);
144
145
146 private:
147     /**
148      * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
149      */
150     QrCodeGenerator(const QrCodeGenerator& in);
151
152     /**
153      * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
154      */
155     QrCodeGenerator& operator=(const QrCodeGenerator& in);
156
157 private:
158     class _QrCodeGeneratorImpl* __pQrCodeGeneratorImpl;
159     friend class _QrCodeGeneratorImpl;
160 };
161
162 } } } //Tizen::Uix::Vision
163
164 #endif // _FUIX_VISION_QR_CODE_GENERATOR_H_