--- /dev/null
+#ifndef __DALI_INTERNAL_BASE_INDICATOR_INTERFACE_H__
+#define __DALI_INTERNAL_BASE_INDICATOR_INTERFACE_H__
+
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
+
+// INTERNAL INCLUDES
+#include <window.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+class Adaptor;
+
+/**
+ * @brief The Indicator interface.
+ * Can be used to draw an indicator graphic generated from the platform as an overlay on
+ * top of DALi scene contents.
+ */
+class IndicatorInterface
+{
+public:
+
+ /**
+ * @brief Type of indiciator
+ */
+ enum Type
+ {
+ INDICATOR_TYPE_UNKNOWN,
+ INDICATOR_TYPE_1,
+ INDICATOR_TYPE_2
+ };
+
+
+public:
+
+ /**
+ * @brief observer for listening to indicator events
+ */
+ class Observer
+ {
+ public:
+ /**
+ * @brief Notify the observer if the indicator type changes
+ * @param[in] type The new indicator type
+ */
+ virtual void IndicatorTypeChanged( Type type ) = 0;
+
+ /**
+ * @brief Notify the observer when the upload has completed.
+ * @param[in] indicator The indicator that has finished uploading.
+ */
+ virtual void IndicatorClosed(IndicatorInterface* indicator) = 0;
+
+ /**
+ * @brief Notify the observer when the indicator visible status is changed.
+ * @param[in] isShowing Whether the indicator is visible.
+ */
+ virtual void IndicatorVisibilityChanged( bool isVisible ) = 0;
+ };
+
+
+public:
+
+ /**
+ * @brief constructor
+ */
+ IndicatorInterface() {}
+
+ /**
+ * @brief Virtual Destructor
+ */
+ virtual ~IndicatorInterface() {}
+
+ /**
+ * @brief assign the adaptor to this object
+ * @param[in] adaptor
+ */
+ virtual void SetAdaptor(Adaptor* adaptor) = 0;
+
+ /**
+ * @brief Get the actor which contains the indicator image. Ensure that the handle is
+ * released when no longer needed.
+ * Changes from the indicator service will modify the image and resize the actor appropriately.
+ * @return The indicator actor.
+ */
+ virtual Dali::Actor GetActor() = 0;
+
+ /**
+ * Opens a new connection for the required orientation.
+ * @param[in] orientation The new orientation
+ */
+ virtual void Open( Dali::Window::WindowOrientation orientation ) = 0;
+
+ /**
+ * Close the current connection. Will respond with Observer::IndicatorClosed()
+ * when done.
+ * @note, IndicatorClosed() will be called synchronously if there's no update
+ * in progress, or asychronously if waiting for SignalUploaded )
+ */
+ virtual void Close() = 0;
+
+ /**
+ * Set the opacity mode of the indicator background.
+ * @param[in] mode opacity mode
+ */
+ virtual void SetOpacityMode( Dali::Window::IndicatorBgOpacity mode ) = 0;
+
+ /**
+ * Set whether the indicator is visible or not.
+ * @param[in] visibleMode visible mode for indicator bar.
+ * @param[in] forceUpdate true if want to change visible mode forcely
+ */
+ virtual void SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate = false ) = 0;
+
+ /**
+ * Check whether the indicator is connected to the indicator service.
+ * @return whether the indicator is connected or not.
+ */
+ virtual bool IsConnected() = 0;
+
+ /**
+ * Send message to the indicator service.
+ * @param[in] messageDomain Message Reference number
+ * @param[in] messageId Reference number of the message this message refers to
+ * @param[in] data The data to send as part of the message
+ * @param[in] size Length of the data, in bytes, to send
+ * @return whether the message is sent successfully or not
+ */
+ virtual bool SendMessage( int messageDomain, int messageId, const void *data, int size ) = 0;
+
+
+};
+
+} // Adaptor
+} // Internal
+} // Dali
+
+#endif
#include <accessibility-adaptor.h>
#include <accessibility-action-handler.h>
#include <accessibility-gesture-handler.h>
-#include <indicator-impl.h>
+#include <indicator-interface.h>
#include <accessibility-gesture-detector.h>
namespace Dali
void SetGestureHandler(AccessibilityGestureHandler& handler);
/**
- * Set the Indicator
+ * @brief Set the Indicator
+ * @param[in] Indiciator interface
*/
- void SetIndicator(Indicator* indicator);
+ void SetIndicator( IndicatorInterface* indicator );
/**
* @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
AccessibilityGestureDetectorPtr mAccessibilityGestureDetector; ///< The accessibility gesture detector
- Indicator* mIndicator; ///< The indicator
+ IndicatorInterface* mIndicator; ///< The indicator
bool mIndicatorFocused; ///< Whether the Indicator is focused
public:
$(adaptor_common_dir)/command-line-options.cpp \
$(adaptor_common_dir)/drag-and-drop-detector-impl.cpp \
$(adaptor_common_dir)/feedback-player-impl.cpp \
- $(adaptor_common_dir)/indicator-impl.cpp \
$(adaptor_common_dir)/indicator-buffer.cpp \
$(adaptor_common_dir)/kernel-trace.cpp \
$(adaptor_common_dir)/system-trace.cpp \
$(adaptor_common_dir)/orientation-impl.cpp \
$(adaptor_common_dir)/performance-logger-impl.cpp \
$(adaptor_common_dir)/physical-keyboard-impl.cpp \
- $(adaptor_common_dir)/server-connection.cpp \
$(adaptor_common_dir)/shared-file.cpp \
$(adaptor_common_dir)/singleton-service-impl.cpp \
$(adaptor_common_dir)/sound-player-impl.cpp \
$(adaptor_common_dir)/event-loop/ecore/ecore-file-descriptor-monitor.cpp \
$(adaptor_common_dir)/event-loop/ecore/ecore-timer-impl.cpp
- adaptor_common_internal_uv_src_files = \
+adaptor_common_internal_uv_src_files = \
$(adaptor_common_dir)/event-loop/lib-uv/uv-callback-manager.cpp \
$(adaptor_common_dir)/event-loop/lib-uv/uv-file-descriptor-monitor.cpp \
$(adaptor_common_dir)/event-loop/lib-uv/uv-timer-impl.cpp
// INTERNAL INCLUDES
#include <base/lifecycle-observer.h>
+#include <base/interfaces/indicator-interface.h>
#include <adaptor-impl.h>
-#include <indicator-impl.h>
#include <window.h>
#include <orientation.h>
#include <render-surface.h>
{
namespace Adaptor
{
-class Indicator;
class Orientation;
class Window;
/**
* Window provides a surface to render onto with orientation & indicator properties.
*/
-class Window : public Dali::BaseObject, public Indicator::Observer, public LifeCycleObserver
+class Window : public Dali::BaseObject, public IndicatorInterface::Observer, public LifeCycleObserver
{
public:
typedef Dali::Window::IndicatorSignalType IndicatorSignalType;
*/
void SetIndicatorProperties( bool isShown, Dali::Window::WindowOrientation lastOrientation );
-private: // Indicator::Observer interface
+private: // IndicatorInterface::Observer interface
/**
- * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorTypeChanged()
+ * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged()
*/
- virtual void IndicatorTypeChanged( Indicator::Type type );
+ virtual void IndicatorTypeChanged( IndicatorInterface::Type type );
/**
- * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorClosed()
+ * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorClosed()
*/
- virtual void IndicatorClosed(Indicator* indicator);
+ virtual void IndicatorClosed( IndicatorInterface* indicator);
/**
- * @copydoc Dali::Internal::Adaptor::Indicator::Observer::IndicatorVisibilityChanged()
+ * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorVisibilityChanged()
*/
virtual void IndicatorVisibilityChanged( bool isVisible );
private:
- typedef std::vector<Indicator*> DiscardedIndicators;
+ typedef std::vector< IndicatorInterface * > DiscardedIndicators;
RenderSurface* mSurface;
Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
bool mIsTransparent:1;
bool mWMRotationAppSet:1;
bool mEcoreEventHander:1;
- Indicator* mIndicator;
+ IndicatorInterface* mIndicator;
Dali::Window::WindowOrientation mIndicatorOrientation;
Dali::Window::WindowOrientation mNextIndicatorOrientation;
Dali::Window::IndicatorBgOpacity mIndicatorOpacityMode;
*/
// CLASS HEADER
-#include "indicator-impl.h"
+#include "ecore-indicator-impl.h"
// EXTERNAL INCLUDES
#include <Ecore.h>
return mLocked;
}
-Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, Observer* observer )
+Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer )
: mPixmap( 0 ),
mGestureDetected( false ),
mConnection( this ),
-#ifndef __DALI_INTERNAL_INDICATOR_H__
-#define __DALI_INTERNAL_INDICATOR_H__
+#ifndef __DALI_INTERNAL_ECORE_INDICATOR_H__
+#define __DALI_INTERNAL_ECORE_INDICATOR_H__
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/events/pan-gesture.h>
#include <dali/public-api/events/pan-gesture-detector.h>
#include <dali/devel-api/rendering/renderer.h>
// INTERNAL INCLUDES
+#include <base/interfaces/indicator-interface.h>
#include <indicator-buffer.h>
-#include <server-connection.h>
+#include <ecore-server-connection.h>
#include <shared-file.h>
#include <timer.h>
#include <window.h>
* The Indicator class connects to the indicator server, and gets and draws the indicator
* for the given orientation.
*/
-class Indicator : public ConnectionTracker, public ServerConnection::Observer
+class Indicator : public ConnectionTracker, public ServerConnection::Observer, public IndicatorInterface
{
public:
+
enum State
{
DISCONNECTED,
CONNECTED
};
- enum Type
- {
- INDICATOR_TYPE_UNKNOWN,
- INDICATOR_TYPE_1,
- INDICATOR_TYPE_2
- };
-
-public:
- class Observer
- {
- public:
- /**
- * Notify the observer if the indicator type changes
- * @param[in] type The new indicator type
- */
- virtual void IndicatorTypeChanged( Type type ) = 0;
-
- /**
- * Notify the observer when the upload has completed.
- * @param[in] indicator The indicator that has finished uploading.
- */
- virtual void IndicatorClosed(Indicator* indicator) = 0;
-
- /**
- * Notify the observer when the indicator visible status is changed.
- * @param[in] isShowing Whether the indicator is visible.
- */
- virtual void IndicatorVisibilityChanged( bool isVisible ) = 0;
- };
protected:
/**
};
-public:
+public: // Dali::Internal::Adaptor::IndicicatorInterface
/**
- * Constructor. Creates a new indicator and opens a connection for
- * the required orientation.
- * @param[in] orientation The orientation in which to draw the indicator
- * @param[in] observer The indicator closed
+ * @copydoc Dali::Internal::IndicatorInterface::IndicatorInterface
*/
Indicator( Adaptor* adaptor,
Dali::Window::WindowOrientation orientation,
- Observer* observer );
+ IndicatorInterface::Observer* observer );
/**
- * Destructor
+ * @copydoc Dali::Internal::IndicatorInterface::~IndicatorInterface
*/
virtual ~Indicator();
- void SetAdaptor(Adaptor* adaptor);
+
+ virtual void SetAdaptor(Adaptor* adaptor);
/**
- * Get the actor which contains the indicator image. Ensure that the handle is
- * released when no longer needed.
- * Changes from the indicator service will modify the image and resize the actor appropriately.
- * @return The indicator actor.
+ * @copydoc Dali::Internal::IndicatorInterface::GetActor
*/
- Dali::Actor GetActor();
+ virtual Dali::Actor GetActor();
/**
- * Opens a new connection for the required orientation.
- * @param[in] orientation The new orientation
+ * @copydoc Dali::Internal::IndicatorInterface::Open
*/
- void Open( Dali::Window::WindowOrientation orientation );
+ virtual void Open( Dali::Window::WindowOrientation orientation );
/**
- * Close the current connection. Will respond with Observer::IndicatorClosed()
- * when done.
- * @note, IndicatorClosed() will be called synchronously if there's no update
- * in progress, or asychronously if waiting for SignalUploaded )
+ * @copydoc Dali::Internal::IndicatorInterface::Close
*/
- void Close();
+ virtual void Close();
/**
- * Set the opacity mode of the indicator background.
- * @param[in] mode opacity mode
+ * @copydoc Dali::Internal::IndicatorInterface::SetOpacityMode
*/
- void SetOpacityMode( Dali::Window::IndicatorBgOpacity mode );
+ virtual void SetOpacityMode( Dali::Window::IndicatorBgOpacity mode );
/**
- * Set whether the indicator is visible or not.
- * @param[in] visibleMode visible mode for indicator bar.
- * @param[in] forceUpdate true if want to change visible mode forcely
+ * @copydoc Dali::Internal::IndicatorInterface::SetVisible
*/
- void SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate = false );
+ virtual void SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate = false );
/**
- * Check whether the indicator is connected to the indicator service.
- * @return whether the indicator is connected or not.
+ * @copydoc Dali::Internal::IndicatorInterface::IsConnected
*/
- bool IsConnected();
+ virtual bool IsConnected();
/**
- * Send message to the indicator service.
- * @param[in] messageDomain Message Reference number
- * @param[in] messageId Reference number of the message this message refers to
- * @param[in] data The data to send as part of the message
- * @param[in] size Length of the data, in bytes, to send
- * @return whether the message is sent successfully or not
+ * @copydoc Dali::Internal::IndicatorInterface::SendMessage
*/
- bool SendMessage( int messageDomain, int messageId, const void *data, int size );
+ virtual bool SendMessage( int messageDomain, int messageId, const void *data, int size );
private:
/**
Adaptor* mAdaptor;
ServerConnection* mServerConnection;
- Indicator::Observer* mObserver; ///< Upload observer
+ IndicatorInterface::Observer* mObserver; ///< Upload observer
Dali::Window::WindowOrientation mOrientation;
int mImageWidth;
*/
// CLASS HEADER
-#include "server-connection.h"
+#include "ecore-server-connection.h"
// EXTERNAL INCLUDES
#include <Ecore.h>
-#ifndef __DALI_INTERNAL_ADAPTOR_CONNECTION_H_
-#define __DALI_INTERNAL_ADAPTOR_CONNECTION_H_
+#ifndef __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_
+#define __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
} // Internal
} // Dali
-#endif // __DALI_INTERNAL_ADAPTOR_CONNECTION_H_
+#endif // __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_
# ECore Common
adaptor_ecore_common_internal_src_files = \
- $(adaptor_ecore_common_dir)/ecore-virtual-keyboard.cpp
+ $(adaptor_ecore_common_dir)/ecore-virtual-keyboard.cpp \
+ $(adaptor_ecore_common_dir)/ecore-indicator-impl.cpp \
+ $(adaptor_ecore_common_dir)/ecore-server-connection.cpp
return mIsEnabled;
}
-void AccessibilityAdaptor::SetIndicator(Indicator* indicator)
+void AccessibilityAdaptor::SetIndicator(IndicatorInterface* indicator)
{
mIndicator = indicator;
}
return mIsEnabled;
}
-void AccessibilityAdaptor::SetIndicator(Indicator* indicator)
+void AccessibilityAdaptor::SetIndicator(IndicatorInterface* indicator)
{
mIndicator = indicator;
}
#include <accessibility-adaptor.h>
#include <accessibility-action-handler.h>
#include <accessibility-gesture-handler.h>
-#include <indicator-impl.h>
+#include <indicator-interface.h>
#include <accessibility-gesture-detector.h>
namespace Dali
/**
* Set the Indicator
*/
- void SetIndicator(Indicator* indicator);
+ void SetIndicator(IndicatorInterface* indicator);
/**
* @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
AccessibilityGestureDetectorPtr mAccessibilityGestureDetector; ///< The accessibility gesture detector
- Indicator* mIndicator; ///< The indicator
+ IndicatorInterface* mIndicator; ///< The indicator
bool mIndicatorFocused; ///< Whether the Indicator is focused
public:
// INTERNAL HEADERS
#include <window-render-surface.h>
#include <drag-and-drop-detector-impl.h>
-#include <indicator-impl.h>
+#include <ecore-indicator-impl.h>
#include <window-visibility-observer.h>
#include <orientation-impl.h>
{
}
-void Window::IndicatorClosed( Indicator* indicator )
+void Window::IndicatorClosed( IndicatorInterface* indicator )
{
DALI_LOG_TRACE_METHOD( gWindowLogFilter );
// INTERNAL HEADERS
#include <window-render-surface.h>
#include <drag-and-drop-detector-impl.h>
-#include <indicator-impl.h>
+#include <ecore-indicator-impl.h>
#include <window-visibility-observer.h>
#include <orientation.h>
#include <orientation-impl.h>
}
}
-void Window::IndicatorClosed( Indicator* indicator )
+void Window::IndicatorClosed( IndicatorInterface* indicator )
{
DALI_LOG_TRACE_METHOD( gWindowLogFilter );