Kony Quantum is now HCL Volt MX. See Revised Terminology. Current Quantum users, see the important note about API naming.
Release:
Importing Custom Widgets for iOS
You can create, and integrate third party custom widgets for the iOS platform. To help you do so, Volt MX Iris defines the following:
A custom widget protocol. Volt MX IrisPlatform defines a custom widget protocol called CWIWidget. The widget protocol consists of mandatory methods that help you initialize, render, define properties, or update properties, for your widget. As part of custom widget implementation, a class must confirm to this protocol, so that the platform can communicate with the custom widget for initialization.
A Volt MX Environment class. The Volt MX environment class consists of a property model, which enables you to fetch data from the custom widget protocol and to send data between the application and custom widget protocol.
To successfully define an iOS custom widget into Volt MX Iris, you must do the following:
Create a custom widget class implementation (mandatory). This implementation communicates with Volt MX Iris‘s custom widget protocol CWIWidget.
(id) initWithEventDelegate: (id) eventDelegate withVoltMXEnvironment:(id) env: Initializes any object of the custom widget set. Initializing the Volt MX Environment and Custom Widget instance.
(CGSize)getPreferredSizeForGivenSize:(CGSize)givenSize: Fetch the preferred size(Height and width) for the widget. The CGSize parameter is the parent width and height of the widget.
(void)setWidgetViewFrame:(CGRect)frame: Set the position of the custom widget with respect to the parent widget. Provides x, y coordinates, height, and width for the custom widget with reference to the parent widget.
(UIView*) getWidgetView: Returns the view defined for the custom widget. This view will be defined in a custom widget class.
(void) modelUpdatedForProperty:(NSString*) propertyName withOldValue:(id) oValue newValue:(id) nValue;: Invoked when there are any updates in the end user defined properties.
(void)willBeginLayout Invoked before the widget is laid out.
(void)didEndLayout :Invoked after the widget is laid out.
(void)didCreateWidget Invoked on creation of a widget.
(void)willDestroyWidget : Invoked when the custom widget is destroyed.
The custom widget protocol provided by Volt MX Iris is as follows:
Volt MX Environment Protocol
Volt MX provides a Volt MX Environment protocol. The model property in the Volt MX Environment Protocol fetches the data from the custom widget protocol and to send across data between the application and custom widget protocol.
Sample Custom Widget Implementation
The following is a sample implementation for the custom widget, Range Slider. This consists of all the basic data about the Range Slider Widget.
Event Delegate Protocol
The Event delegate protocol consists of information about all the events to be invoked for your custom widget. The methods in this protocol are useful for raising events for the widget in the Volt MX IrisPlatform. This ensures that a mapping exists between the methods in this CustomWidgetEventDelegate protocol and the events defined in Volt MX Iris. Volt MX Iris automatically generates a class that confirms to the CustomWidgetEventDelegate protocol, passing an instance of it in the initialization method. Thus, when an event needs to be raised, the methods in protocol CustomWidgetEventDelegate can be invoked on the saved instance object.
Sample Event Delegate Implementation
The following code snippet provides a sample Event Delegate implementation for a Range Slider.