2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 namespace Tizen.Multimedia
22 /// Represents a QR configuration of <see cref="BarcodeGenerator"/>.
24 /// <since_tizen> 3</since_tizen>
25 public class QrConfiguration
28 /// Initializes a new instance of the <see cref="QrConfiguration"/> class.
30 /// <param name="qrMode">Encoding mode for the message.</param>
31 /// <param name="ecc">Error correction level.</param>
32 /// <param name="version">QR code version. From 1 to 40 inclusive.</param>
34 /// var obj = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30);
36 /// <exception cref="ArgumentOutOfRangeException">
37 /// <paramref name="version"/> is less than 1.\n
39 /// <paramref name="version"/> is greater than 40.
41 /// <exception cref="ArgumentException">
42 /// <paramref name="qrMode"/> is invalid.\n
44 /// <paramref name="ecc"/> is invalid.
46 /// <since_tizen> 3</since_tizen>
47 public QrConfiguration(QrMode qrMode, ErrorCorrectionLevel ecc, int version)
49 if (version < 1 || version > 40)
51 throw new ArgumentOutOfRangeException(nameof(version), version,
52 "Valid version range is 1 to 40 inclusive.");
54 ValidationUtil.ValidateEnum(typeof(QrMode), qrMode, nameof(qrMode));
55 ValidationUtil.ValidateEnum(typeof(ErrorCorrectionLevel), ecc, nameof(ecc));
58 ErrorCorrectionLevel = ecc;
63 /// Gets the encoding mode for the message.
65 /// <since_tizen> 3</since_tizen>
66 public QrMode Mode { get; }
69 /// Gets the error correction level.
71 /// <since_tizen> 3</since_tizen>
72 public ErrorCorrectionLevel ErrorCorrectionLevel { get; }
75 /// Gets the QR code version.
77 /// <since_tizen> 3</since_tizen>
78 public int Version { get; }