1 #ifndef __DALI_INTERNAL_BASE_INDICATOR_INTERFACE_H__
2 #define __DALI_INTERNAL_BASE_INDICATOR_INTERFACE_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/actors/actor.h>
25 #include <dali/public-api/adaptor-framework/window.h>
37 * @brief The Indicator interface.
38 * Can be used to draw an indicator graphic generated from the platform as an overlay on
39 * top of DALi scene contents.
41 class IndicatorInterface
46 * @brief Type of indiciator
50 INDICATOR_TYPE_UNKNOWN,
59 * @brief observer for listening to indicator events
65 * @brief Notify the observer if the indicator type changes
66 * @param[in] type The new indicator type
68 virtual void IndicatorTypeChanged( Type type ) = 0;
71 * @brief Notify the observer when the upload has completed.
72 * @param[in] indicator The indicator that has finished uploading.
74 virtual void IndicatorClosed(IndicatorInterface* indicator) = 0;
77 * @brief Notify the observer when the indicator visible status is changed.
78 * @param[in] isShowing Whether the indicator is visible.
80 virtual void IndicatorVisibilityChanged( bool isVisible ) = 0;
89 IndicatorInterface() {}
92 * @brief Virtual Destructor
94 virtual ~IndicatorInterface() {}
97 * @brief assign the adaptor to this object
100 virtual void SetAdaptor(Adaptor* adaptor) = 0;
103 * @brief Get the actor which contains the indicator image. Ensure that the handle is
104 * released when no longer needed.
105 * Changes from the indicator service will modify the image and resize the actor appropriately.
106 * @return The indicator actor.
108 virtual Dali::Actor GetActor() = 0;
111 * Opens a new connection for the required orientation.
112 * @param[in] orientation The new orientation
114 virtual void Open( Dali::Window::WindowOrientation orientation ) = 0;
117 * Close the current connection. Will respond with Observer::IndicatorClosed()
119 * @note, IndicatorClosed() will be called synchronously if there's no update
120 * in progress, or asychronously if waiting for SignalUploaded )
122 virtual void Close() = 0;
125 * Notify the indicator flicked.
127 virtual void Flicked() = 0;
130 * Set the opacity mode of the indicator background.
131 * @param[in] mode opacity mode
133 virtual void SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) = 0;
136 * Set whether the indicator is visible or not.
137 * @param[in] visibleMode visible mode for indicator bar.
138 * @param[in] forceUpdate true if want to change visible mode forcely
140 virtual void SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate = false ) = 0;
143 * Check whether the indicator is connected to the indicator service.
144 * @return whether the indicator is connected or not.
146 virtual bool IsConnected() = 0;
149 * Send message to the indicator service.
150 * @param[in] messageDomain Message Reference number
151 * @param[in] messageId Reference number of the message this message refers to
152 * @param[in] data The data to send as part of the message
153 * @param[in] size Length of the data, in bytes, to send
154 * @return whether the message is sent successfully or not
156 virtual bool SendMessage( int messageDomain, int messageId, const void *data, int size ) = 0;