/*
* Copyright (c) 2018 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;
using System.Collections.Generic;
using System.Text;
namespace Tizen.Applications.WatchfaceComplication
{
///
/// Represents the image data for a complication.
///
/// 6
public class ImageData : ComplicationData
{
///
/// Initializes the ImageData class.
///
/// The image path.
/// The extra data.
/// Thrown when parameter is invalid.
///
///
/// protected override ComplicationData OnDataUpdateRequested(string reqestAppId, ComplicationTypes type, Bundle contextData)
/// {
/// if (type == ComplicationTypes.Image)
/// {
/// return new ImageData("Image path", "extra");
/// }
/// else if (type == ComplicationTypes.LongText)
/// {
/// return new LongTextData("longlong", "icon path", "title", null);
/// }
/// }
///
///
/// 6
public ImageData(string imagePath, string extraData)
{
if (imagePath == null)
ErrorFactory.ThrowException(ComplicationError.InvalidParam, "image path can not be null");
Type = ComplicationTypes.Image;
ImagePath = imagePath;
ExtraData = extraData;
}
///
/// The image path data.
///
/// Thrown when try to set invalid value.
/// 6
public new string ImagePath
{
get
{
return base.ImagePath;
}
set
{
if (value == null)
ErrorFactory.ThrowException(ComplicationError.InvalidParam, "image path can not be null");
base.ImagePath = value;
}
}
///
/// The extra data.
///
/// 6
public new string ExtraData
{
get
{
return base.ExtraData;
}
set
{
base.ExtraData = value;
}
}
///
/// The information about the screen reader text of complication data.
///
/// 6
public new string ScreenReaderText
{
get
{
return base.ScreenReaderText;
}
set
{
base.ScreenReaderText = value;
}
}
}
}