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.
20 namespace Tizen.Multimedia.Vision
23 /// Represents a configuration of <see cref="BarcodeGenerator"/> instances.
25 /// <seealso cref="BarcodeGenerator"/>
26 /// <since_tizen> 3 </since_tizen>
27 public class BarcodeGenerationConfiguration : EngineConfiguration
29 private const string KeyTextAttr = "MV_BARCODE_GENERATE_ATTR_TEXT";
30 private const string KeyForegroundColorAttr = "MV_BARCODE_GENERATE_ATTR_COLOR_FRONT";
31 private const string KeyBackgroundColorAttr = "MV_BARCODE_GENERATE_ATTR_COLOR_BACK";
34 /// Initializes a new instance of the <see cref="BarcodeGenerationConfiguration"/> class.
36 /// <exception cref="NotSupportedException">The feature is not supported.</exception>
37 /// <since_tizen> 3 </since_tizen>
38 public BarcodeGenerationConfiguration() : base("barcode_generation")
43 /// Gets or sets the text visibility of the barcode to be generated.
45 /// <exception cref="ArgumentException"><paramref name="value"/> is not valid.</exception>
46 /// <exception cref="ObjectDisposedException">The <see cref="BarcodeGenerationConfiguration"/> already has been disposed of.</exception>
47 /// <since_tizen> 3 </since_tizen>
48 public Visibility TextVisibility
52 return (Visibility)GetInt(KeyTextAttr);
56 ValidationUtil.ValidateEnum(typeof(Visibility), value);
57 Set(KeyTextAttr, (int)value);
61 private Color _foregroundColor = Color.Black;
64 /// Gets or sets the foreground color of the barcode to be generated.
67 /// The alpha value of the color will be ignored.
69 /// <exception cref="ObjectDisposedException">The <see cref="BarcodeGenerationConfiguration"/> already has been disposed of.</exception>
70 /// <since_tizen> 3 </since_tizen>
71 public Color ForegroundColor
75 return _foregroundColor;
79 Set(KeyForegroundColorAttr, string.Format("{0:x2}{1:x2}{2:x2}", value.R, value.G, value.B));
80 _foregroundColor = value;
84 private Color _backgroundColor = Color.White;
87 /// Gets or sets the background color of the barcode to be generated.
90 /// The alpha value of the color will be ignored.
92 /// <exception cref="ObjectDisposedException">The <see cref="BarcodeGenerationConfiguration"/> already has been disposed of.</exception>
93 /// <since_tizen> 3 </since_tizen>
94 public Color BackgroundColor
98 return _backgroundColor;
102 Set(KeyBackgroundColorAttr, string.Format("{0:x2}{1:x2}{2:x2}", value.R, value.G, value.B));
103 _backgroundColor = value;