2 * Copyright (c) 2018 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.
18 using System.Collections.Generic;
21 namespace Tizen.Applications.WatchfaceComplication
24 /// Represents the image data for a complication.
26 /// <since_tizen> 6 </since_tizen>
27 public class ImageData : ComplicationData
30 /// Initializes the ImageData class.
32 /// <param name="imagePath">The image path.</param>
33 /// <param name="extraData">The extra data.</param>
34 /// <exception cref="ArgumentException">Thrown when parameter is invalid.</exception>
37 /// protected override ComplicationData OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
39 /// if (type == ComplicationTypes.Image)
41 /// return new ImageData("Image path", "extra");
43 /// else if (type == ComplicationTypes.LongText)
45 /// return new LongTextData("longlong", "icon path", "title", null);
50 /// <since_tizen> 6 </since_tizen>
51 public ImageData(string imagePath, string extraData)
53 if (imagePath == null)
54 ErrorFactory.ThrowException(ComplicationError.InvalidParam, "image path can not be null");
55 Type = ComplicationTypes.Image;
56 ImagePath = imagePath;
57 ExtraData = extraData;
61 /// The image path data.
63 /// <exception cref="ArgumentException">Thrown when try to set invalid value.</exception>
64 /// <since_tizen> 6 </since_tizen>
65 public new string ImagePath
69 return base.ImagePath;
74 ErrorFactory.ThrowException(ComplicationError.InvalidParam, "image path can not be null");
75 base.ImagePath = value;
82 /// <since_tizen> 6 </since_tizen>
83 public new string ExtraData
87 return base.ExtraData;
91 base.ExtraData = value;
96 /// The information about the screen reader text of complication data.
98 /// <since_tizen> 6 </since_tizen>
99 public new string ScreenReaderText
103 return base.ScreenReaderText;
107 base.ScreenReaderText = value;