Fixed comment issues.
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Vision / MediaVision / QrConfiguration.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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 using System;
18
19 namespace Tizen.Multimedia
20 {
21     /// <summary>
22     /// Represents a QR configuration of <see cref="BarcodeGenerator"/>.
23     /// </summary>
24     public class QrConfiguration
25     {
26         /// <summary>
27         /// Initializes a new instance of the <see cref="QrConfiguration"/> class.
28         /// </summary>
29         /// <param name="qrMode">Encoding mode for the message.</param>
30         /// <param name="ecc">Error correction level.</param>
31         /// <param name="version">QR code version. From 1 to 40 inclusive.</param>
32         /// <code>
33         /// var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
34         /// </code>
35         /// <exception cref="ArgumentOutOfRangeException">
36         ///     <paramref name="version"/> is less than 1.\n
37         ///     -or-\n
38         ///     <paramref name="version"/> is greater than 40.
39         /// </exception>
40         /// <exception cref="ArgumentException">
41         ///     <paramref name="qrMode"/> is invalid.\n
42         ///     -or-
43         ///     <paramref name="ecc"/> is invalid.
44         /// </exception>
45         public QrConfiguration(QrMode qrMode, ErrorCorrectionLevel ecc, int version)
46         {
47             if (version < 1 || version > 40)
48             {
49                 throw new ArgumentOutOfRangeException(nameof(version), version,
50                     "Valid version range is 1 to 40 inclusive.");
51             }
52             ValidationUtil.ValidateEnum(typeof(QrMode), qrMode, nameof(qrMode));
53             ValidationUtil.ValidateEnum(typeof(ErrorCorrectionLevel), ecc, nameof(ecc));
54
55             Mode = qrMode;
56             ErrorCorrectionLevel = ecc;
57             Version = version;
58         }
59
60         /// <summary>
61         /// Gets the encoding mode for the message.
62         /// </summary>
63         public QrMode Mode { get; }
64
65         /// <summary>
66         /// Gets the error correction level.
67         /// </summary>
68         public ErrorCorrectionLevel ErrorCorrectionLevel { get; }
69
70         /// <summary>
71         /// Gets the QR code version.
72         /// </summary>
73         public int Version { get; }
74     }
75 }