/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; namespace Tizen.Multimedia.Vision { /// /// Represents a QR configuration of . /// /// 4 public class QrConfiguration { private string _embedImagePath; private QrShape _dataShape = QrShape.Rectangular; private QrShape _finderShape = QrShape.Rectangular; /// /// Initializes a new instance of the class. /// /// Encoding mode for the message. /// Error correction level. /// QR code version. From 1 to 40 inclusive. /// /// is less than 1.
/// -or-
/// is greater than 40. ///
/// /// is invalid.
/// -or-
/// is invalid. ///
/// /// /// var qrConfig = new QrConfiguration(QrMode.Numeric, ErrorCorrectionLevel.Medium, 30); /// /// /// 4 public QrConfiguration(QrMode qrMode, ErrorCorrectionLevel ecc, int version) { if (version < 1 || version > 40) { throw new ArgumentOutOfRangeException(nameof(version), version, "Valid version range is 1 to 40 inclusive."); } ValidationUtil.ValidateEnum(typeof(QrMode), qrMode, nameof(qrMode)); ValidationUtil.ValidateEnum(typeof(ErrorCorrectionLevel), ecc, nameof(ecc)); Mode = qrMode; ErrorCorrectionLevel = ecc; Version = version; } /// /// Gets the encoding mode for the message. /// /// 4 public QrMode Mode { get; } /// /// Gets the error correction level. /// /// 4 public ErrorCorrectionLevel ErrorCorrectionLevel { get; } /// /// Gets the QR code version. /// /// 4 public int Version { get; } /// /// Gets or sets the embed image absolute path of the Design QR code. /// /// /// The mediastorage privilege (http://tizen.org/privilege/mediastorage) is needed if the image path is relevant to media storage.
/// The externalstorage privilege (http://tizen.org/privilege/externalstorage) is needed if the image path is relevant to external storage. ///
/// is null. /// is zero-length string. /// 11 public string EmbedImagePath { get { return _embedImagePath; } set { ValidationUtil.ValidateIsNullOrEmpty(value, nameof(value)); _embedImagePath = value; } } /// /// Gets or sets the data shape of the Design QR code. /// /// The default value is . /// is not valid. /// 11 public QrShape DataShape { get { return _dataShape; } set { ValidationUtil.ValidateEnum(typeof(QrShape), value, nameof(value)); _dataShape = value; } } /// /// Gets or sets the finder shape of the Design QR code. /// /// The default value is . /// is not valid. /// 11 public QrShape FinderShape { get { return _finderShape; } set { ValidationUtil.ValidateEnum(typeof(QrShape), value, nameof(value)); _finderShape = value; } } } }