bool SetItem(const std::string &itemData);
/**
- * @copydoc Dali::Clipboard::GetItem()
+ * @copydoc Dali::Clipboard::RequestItem()
*/
- std::string GetItem( unsigned int index );
+ void RequestItem();
/**
* @copydoc Dali::Clipboard::NumberOfClipboardItems()
/**
* @copydoc Dali::Clipboard::HideClipboard()
*/
- void HideClipboard();
+ void HideClipboard(bool skipFirstHide);
+
+ /**
+ * @copydoc Dali::Clipboard::IsVisible()
+ */
+ bool IsVisible() const;
+
+ /**
+ * @brief exchange either sending or receiving buffered data
+ *
+ * @param[in] type true for send buffered data, false for receive data to buffer
+ * @param[in] event information pointer
+ * @return The buffer pointer for send or receive data
+ */
+ char* ExcuteBuffered( bool type, void *event );
private:
Impl* mImpl;
-}; // class clipboard
+public:
+}; // class clipboard
} // namespace Adaptor
} // namespace Internal
- inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
- {
- DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
- BaseObject& handle = clipboard.GetBaseObject();
- return static_cast<Internal::Adaptor::Clipboard&>(handle);
- }
-
- inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
- {
- DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
- const BaseObject& handle = clipboard.GetBaseObject();
- return static_cast<const Internal::Adaptor::Clipboard&>(handle);
- }
+inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
+{
+ DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
+ BaseObject& handle = clipboard.GetBaseObject();
+ return static_cast<Internal::Adaptor::Clipboard&>(handle);
+}
+
+inline static const Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
+{
+ DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
+ const BaseObject& handle = clipboard.GetBaseObject();
+ return static_cast<const Internal::Adaptor::Clipboard&>(handle);
+}
} // namespace Dali
{
return Internal::Adaptor::Clipboard::Get();
}
+
bool Clipboard::SetItem( const std::string &itemData)
{
return GetImplementation(*this).SetItem( itemData );
}
-std::string Clipboard::GetItem( unsigned int index )
+void Clipboard::RequestItem()
{
- return GetImplementation(*this).GetItem( index );
+ GetImplementation(*this).RequestItem();
}
unsigned int Clipboard::NumberOfItems()
void Clipboard::HideClipboard()
{
- GetImplementation(*this).HideClipboard();
+ GetImplementation(*this).HideClipboard(false);
+}
+
+bool Clipboard::IsVisible() const
+{
+ return GetImplementation(*this).IsVisible();
}
} // namespace Dali
#define __DALI_CLIPBOARD_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
bool SetItem( const std::string& itemData );
/**
- * @brief Retreive the string at the given index in the clipboard.
+ * @brief Request clipboard service to retrieve an item
*
- * @param[in] index item in clipboard list to retrieve
- * @return string the text item at the current index.
+ * Calling this method will trigger a signal from the clipboard event notifier.
+ * @see Dali::ClipboardEventNotifier::ContentSelectedSignal()
*/
- std::string GetItem( unsigned int index );
+ void RequestItem();
/**
* @brief Returns the number of item currently in the clipboard.
*/
void HideClipboard();
+ /**
+ * @brief Retrieves the clipboard's visibility
+ * @return bool true if the clipboard is visible.
+ */
+ bool IsVisible() const;
+
};
} // namespace Dali
// EXTERNAL INCLUDES
#include <Ecore.h>
#include <Evas.h>
-#ifndef WAYLAND
+#ifdef WAYLAND
+#include <Ecore_Wayland.h>
+#else
#include <Ecore_X.h>
#endif
Debug::Filter* gIndicatorLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_INDICATOR");
#endif
-#ifndef WAYLAND
// Impl to hide EFL implementation.
+
struct Indicator::Impl
{
- // Construction & Destruction
+ enum // operation mode
+ {
+ INDICATOR_HIDE,
+ INDICATOR_STAY_WITH_DURATION
+ };
/**
* Constructor
: mIndicator(indicator),
mEcoreEventHandler(NULL)
{
- // Register Client message events for quick panel state.
+#if defined(DALI_PROFILE_MOBILE)
+#if defined(WAYLAND)
+ mEcoreEventHandler = ecore_event_handler_add(ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this);
+#else
mEcoreEventHandler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, EcoreEventClientMessage, this);
+#endif
+#endif // WAYLAND && DALI_PROFILE_MOBILE
}
/**
*/
~Impl()
{
- ecore_event_handler_del(mEcoreEventHandler);
+ if ( mEcoreEventHandler )
+ {
+ ecore_event_handler_del(mEcoreEventHandler);
+ }
}
- /**
- * Called when the client messages (i.e. quick panel state) are received.
- */
- static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
+ static void SetIndicatorVisibility( void* data, int operation )
{
- Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
Indicator::Impl* indicatorImpl((Indicator::Impl*)data);
- if (clientMessageEvent == NULL || indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
+ if ( indicatorImpl == NULL || indicatorImpl->mIndicator == NULL)
{
- return ECORE_CALLBACK_PASS_ON;
+ return;
}
-
-#ifndef DALI_PROFILE_UBUNTU
- if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
+ if ( operation == INDICATOR_STAY_WITH_DURATION )
{
// if indicator is not showing, INDICATOR_FLICK_DONE is given
if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
indicatorImpl->mIndicator->ShowIndicator( AUTO_INDICATOR_STAY_DURATION );
}
}
- else if( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
+ else if( operation == INDICATOR_HIDE )
{
if( indicatorImpl->mIndicator->mVisible == Dali::Window::AUTO &&
indicatorImpl->mIndicator->mIsShowing )
indicatorImpl->mIndicator->ShowIndicator( HIDE_NOW );
}
}
-#endif
+ }
+#if defined(DALI_PROFILE_MOBILE)
+#if defined(WAYLAND)
+ /**
+ * Called when the Ecore indicator event is received.
+ */
+ static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
+ {
+ SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
+ return ECORE_CALLBACK_PASS_ON;
+ }
+#else
+ /**
+ * Called when the client messages (i.e. quick panel state) are received.
+ */
+ static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
+ {
+ Ecore_X_Event_Client_Message* clientMessageEvent((Ecore_X_Event_Client_Message*)event);
+ if ( clientMessageEvent != NULL )
+ {
+ if (clientMessageEvent->message_type == ECORE_X_ATOM_E_INDICATOR_FLICK_DONE)
+ {
+ SetIndicatorVisibility( data, INDICATOR_STAY_WITH_DURATION );
+ }
+ else if ( clientMessageEvent->message_type == ECORE_X_ATOM_E_MOVE_QUICKPANEL_STATE )
+ {
+ SetIndicatorVisibility( data, INDICATOR_HIDE );
+ }
+ }
return ECORE_CALLBACK_PASS_ON;
}
+#endif
+#endif // WAYLAND && DALI_PROFILE_MOBILE
// Data
Indicator* mIndicator;
Ecore_Event_Handler* mEcoreEventHandler;
};
-#endif
Indicator::LockFile::LockFile(const std::string filename)
: mFilename(filename),
// hide the indicator by default
mIndicatorActor.SetVisible( false );
-#ifndef WAYLAND
// create impl to handle ecore event
mImpl = new Impl(this);
-#endif
}
Indicator::~Indicator()
{
-#ifndef WAYLAND
if(mImpl)
{
delete mImpl;
mImpl = NULL;
}
-#endif
if(mEventActor)
{
break;
case Dali::PointState::UP:
+ case Dali::PointState::INTERRUPTED:
{
IpcDataEvMouseUp ipcUp( touchEvent.time );
mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );
#include <dali/public-api/object/any.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/integration-api/debug.h>
-#include <bundle.h>
+#include <unistd.h>
+
+#ifdef DALI_ELDBUS_AVAILABLE
+#include <Eldbus.h>
+#endif // DALI_ELDBUS_AVAILABLE
// INTERNAL INCLUDES
#include <singleton-service-impl.h>
+#define CBHM_DBUS_OBJPATH "/org/tizen/cbhm/dbus"
+#ifndef CBHM_DBUS_INTERFACE
+#define CBHM_DBUS_INTERFACE "org.tizen.cbhm.dbus"
+#endif /* CBHM_DBUS_INTERFACE */
+
#define CLIPBOARD_STR "CLIPBOARD_STR"
+#define CLIPBOARD_BUFFER_SIZE 512
///////////////////////////////////////////////////////////////////////////////////////////////////
// Clipboard
{
Impl()
{
- mBundle = bundle_create();
+ Eldbus_Object *eldbus_obj;
+ cbhm_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+ eldbus_obj = eldbus_object_get(cbhm_conn, CBHM_DBUS_INTERFACE, CBHM_DBUS_OBJPATH);
+ eldbus_proxy = eldbus_proxy_get(eldbus_obj, CBHM_DBUS_INTERFACE);
+ eldbus_name_owner_changed_callback_add(cbhm_conn, CBHM_DBUS_INTERFACE, NULL, cbhm_conn, EINA_TRUE);
+ eldbus_proxy_signal_handler_add(eldbus_proxy, "ItemClicked", _on_item_clicked, this);
+ mVisible = false;
+ mIsFirstTimeHidden = true;
+ }
+
+ ~Impl()
+ {
+ if (cbhm_conn)
+ eldbus_connection_unref(cbhm_conn);
+ }
+
+ Eldbus_Proxy* cbhm_proxy_get()
+ {
+ return eldbus_proxy;
+ }
+
+ Eldbus_Connection* cbhm_connection_get()
+ {
+ return cbhm_conn;
}
- void SetItem(const char *data)
+ void SetItem( const std::string &itemData )
{
- char *temp = NULL;
+ const char *data = itemData.c_str();
+ const char *types[10] = {0, };
+ int i = -1;
- if (bundle_get_str(mBundle, CLIPBOARD_STR, &temp) == BUNDLE_ERROR_NONE)
+ if (data == NULL)
{
- bundle_del(mBundle, CLIPBOARD_STR);
+ return;
}
- bundle_add_str(mBundle, CLIPBOARD_STR, data);
+ strcpy(mSendBuf, data);
+
+ // ELM_SEL_TYPE_CLIPBOARD - To distinguish clipboard selection in cbhm
+ types[++i] = "CLIPBOARD_BEGIN";
+
+ types[++i] = "application/x-elementary-markup";
+ types[++i] = "text/plain";
+ types[++i] = "text/plain;charset=utf-8";
+
+ // ELM_SEL_TYPE_CLIPBOARD - To distinguish clipboard selection in cbhm
+ types[++i] = "CLIPBOARD_END";
+ ecore_wl_dnd_selection_set(ecore_wl_input_get(), types);
}
- char *GetItem()
+ void RequestItem()
{
- char *data = NULL;
+ const char *types[10] = {0, };
+ int i = -1;
- if ( bundle_get_count(mBundle) )
+ types[++i] = "application/x-elementary-markup";
+ types[++i] = "text/plain";
+ types[++i] = "text/plain;charset=utf-8";
+ ecore_wl_dnd_selection_get(ecore_wl_input_get(), *types);
+ }
+
+ char *ExcuteSend( void *event )
+ {
+ Ecore_Wl_Event_Data_Source_Send *ev = (Ecore_Wl_Event_Data_Source_Send *)event;
+ int len_buf = strlen(mSendBuf);
+ int len_remained = len_buf;
+ int len_written = 0, ret;
+ char *buf = mSendBuf;
+
+ while (len_written < len_buf)
{
- bundle_get_str(mBundle, CLIPBOARD_STR, &data);
+ ret = write(ev->fd, buf, len_remained);
+ if (ret == -1) break;
+ buf += ret;
+ len_written += ret;
+ len_remained -= ret;
}
- return data;
+ close(ev->fd);
+ return (char *)mSendBuf;
+ }
+
+ char *ExcuteReceive( void *event )
+ {
+ Ecore_Wl_Event_Selection_Data_Ready *ev = (Ecore_Wl_Event_Selection_Data_Ready *)event;
+
+ strncpy(mReceiveBuf, (char *)ev->data, ev->len);
+ mReceiveBuf[ev->len] = '\0';
+ return (char *)mReceiveBuf;
}
int GetCount()
{
- return bundle_get_count(mBundle);
+ Eldbus_Message *reply, *req;
+ const char *errname = NULL, *errmsg = NULL;
+ int count = -1;
+
+ if (!(req = eldbus_proxy_method_call_new(eldbus_proxy, "CbhmGetCount")))
+ {
+ DALI_LOG_ERROR("Failed to create method call on org.freedesktop.DBus.Properties.Get");
+ return -1;
+ }
+
+ eldbus_message_ref(req);
+ reply = eldbus_proxy_send_and_block(eldbus_proxy, req, 100);
+ if (!reply || eldbus_message_error_get(reply, &errname, &errmsg))
+ {
+ DALI_LOG_ERROR("Unable to call method org.freedesktop.DBus.Properties.Get: %s %s",
+ errname, errmsg);
+ eldbus_message_unref(req);
+ return -1;
+ }
+
+ if (!eldbus_message_arguments_get(reply, "i", &count))
+ {
+ DALI_LOG_ERROR("Cannot get arguments from eldbus");
+ eldbus_message_unref(req);
+ return -1;
+ }
+
+ eldbus_message_unref(req);
+ DALI_LOG_ERROR("cbhm item count(%d)", count);
+ return count;
+ }
+
+ void ShowClipboard()
+ {
+ eldbus_proxy_call(cbhm_proxy_get(), "CbhmShow", NULL, NULL, -1, "s", "0");
+ mIsFirstTimeHidden = true;
+ mVisible = true;
+ }
+
+ void HideClipboard( bool skipFirstHide )
+ {
+ if ( skipFirstHide && mIsFirstTimeHidden )
+ {
+ mIsFirstTimeHidden = false;
+ return;
+ }
+ eldbus_proxy_call(cbhm_proxy_get(), "CbhmHide", NULL, NULL, -1, "");
+ mIsFirstTimeHidden = false;
+ mVisible = false;
}
- bundle *mBundle;
+ bool IsVisible() const
+ {
+ return mVisible;
+ }
+
+ static void _on_item_clicked(void *data, const Eldbus_Message *msg EINA_UNUSED)
+ {
+ static_cast<Clipboard::Impl*>(data)->RequestItem();
+ }
+
+ Eldbus_Proxy *eldbus_proxy;
+ Eldbus_Connection *cbhm_conn;
+
+ char mSendBuf[CLIPBOARD_BUFFER_SIZE];
+ char mReceiveBuf[CLIPBOARD_BUFFER_SIZE];
+ bool mVisible;
+ bool mIsFirstTimeHidden;
};
Clipboard::Clipboard(Impl* impl)
bool Clipboard::SetItem(const std::string &itemData )
{
- mImpl->SetItem( const_cast<char*>( itemData.c_str()) );
+ mImpl->SetItem( itemData );
return true;
}
/*
- * Get string at given index of clipboard
+ * Request clipboard service to give an item
*/
-std::string Clipboard::GetItem( unsigned int index ) // change string to a Dali::Text object.
+void Clipboard::RequestItem()
{
- std::string clipboardString(mImpl->GetItem());
- return clipboardString;
+ mImpl->RequestItem();
}
/*
return mImpl->GetCount();
}
-/**
- * Show clipboard window
- * Function to send message to show the Clipboard (cbhm) as no direct API available
- * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c
- */
void Clipboard::ShowClipboard()
{
+ mImpl->ShowClipboard();
+}
+
+void Clipboard::HideClipboard(bool skipFirstHide)
+{
+ mImpl->HideClipboard(skipFirstHide);
}
-void Clipboard::HideClipboard()
+bool Clipboard::IsVisible() const
{
+ return mImpl->IsVisible();
}
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+ return (type ? mImpl->ExcuteSend( event ) : mImpl->ExcuteReceive( event ));
+}
} // namespace Adaptor
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, handler ) );
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, handler ) );
+ // Register Selection event - clipboard selection
+ mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, handler ) );
+ mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, handler ) );
+
// Register Detent event
mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetent, handler) );
+
#ifndef DALI_PROFILE_UBUNTU
// Register Vconf notify - font name and size
vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler );
}
}
}
- // No need to connect callbacks as KeyboardStatusChanged will be called.
+ Dali::Clipboard clipboard = Clipboard::Get();
+ clipboard.HideClipboard();
}
return ECORE_CALLBACK_PASS_ON;
}
}
- // Clipboard don't support that whether clipboard is shown or not. Hide clipboard.
+ // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard
Dali::Clipboard clipboard = Clipboard::Get();
- clipboard.HideClipboard();
+ if ( clipboard )
+ {
+ Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+ clipBoardImpl.HideClipboard(true);
+ }
}
return ECORE_CALLBACK_PASS_ON;
}
/**
- * Called when detent event is recevied
- */
+ * Called when the source window notifies us the content in clipboard is selected.
+ */
+ static Eina_Bool EcoreEventDataSend( void* data, int type, void* event )
+ {
+ DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataSend\n" );
+
+ Dali::Clipboard clipboard = Clipboard::Get();
+ if ( clipboard )
+ {
+ Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+ clipBoardImpl.ExcuteBuffered( true, event );
+ }
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ /**
+ * Called when the source window sends us about the selected content.
+ * For example, when item is selected in the clipboard.
+ */
+ static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event )
+ {
+ DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataReceive\n" );
+
+ EventHandler* handler( (EventHandler*)data );
+ Dali::Clipboard clipboard = Clipboard::Get();
+ char *selectionData = NULL;
+ if ( clipboard )
+ {
+ Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
+ selectionData = clipBoardImpl.ExcuteBuffered( false, event );
+ }
+ if ( selectionData && handler->mClipboardEventNotifier )
+ {
+ ClipboardEventNotifier& clipboardEventNotifier( ClipboardEventNotifier::GetImplementation( handler->mClipboardEventNotifier ) );
+ std::string content( selectionData, strlen(selectionData) );
+
+ clipboardEventNotifier.SetContent( content );
+ clipboardEventNotifier.EmitContentSelectedSignal();
+ }
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
+ /*
+ * Called when detent event is recevied
+ */
static Eina_Bool EcoreEventDetent( void* data, int type, void* event )
{
DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDetent\n" );
void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
{
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+ if( wlSurface )
+ {
+ Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+ if ( isShow )
+ {
+ ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_ON);
+ }
+ else
+ {
+ ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_OFF);
+ }
+ }
}
void Window::IndicatorTypeChanged(Indicator::Type type)
{
+#if defined(DALI_PROFILE_MOBILE)
+ ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+ if( wlSurface )
+ {
+ Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+ switch(type)
+ {
+ case Indicator::INDICATOR_TYPE_1:
+ ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
+ break;
+
+ case Indicator::INDICATOR_TYPE_2:
+ ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN);
+ break;
+
+ case Indicator::INDICATOR_TYPE_UNKNOWN:
+ default:
+ break;
+ }
+ }
+#endif //MOBILE
}
void Window::IndicatorClosed( IndicatorInterface* indicator )
}
/*
- * Get string at given index of clipboard
+ * Request clipboard service to retrieve an item
*/
-std::string Clipboard::GetItem( unsigned int index ) // change string to a Dali::Text object.
+void Clipboard::RequestItem()
{
- return "not supported";
}
/*
{
}
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
{
}
+bool Clipboard::IsVisible() const
+{
+ return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+ return NULL;
+}
} // namespace Adaptor
WatchTimeSignal& TimeTickSignal();
/**
- * @brief This signal is emitted at every second in ambient mode
+ * @brief This signal is emitted at each minute in ambient mode
* A callback of the following type may be connected:
* @code
* void YourCallbackName(Application& application, WatchTimeSignal &time);
#include <adaptor-impl.h>
#include <ecore-x-window-interface.h>
#include <singleton-service-impl.h>
+#include <clipboard-event-notifier-impl.h>
namespace //unnamed namespace
{
}
/*
- * Get string at given index of clipboard
+ * Request clipboard service to retrieve an item
*/
-std::string Clipboard::GetItem( unsigned int index ) // change string to a Dali::Text object.
+void Clipboard::RequestItem()
{
- if ( index >= NumberOfItems() )
- {
- return "";
- }
-
+ int index = 0;
char sendBuf[20];
snprintf( sendBuf, 20, "%s%d", CBHM_ITEM, index );
Ecore_X_Atom xAtomCbhmItem = ecore_x_atom_get( sendBuf );
Ecore_X_Atom xAtomCbhmError = ecore_x_atom_get( CBHM_ERROR );
if ( xAtomItemType != xAtomCbhmError )
{
- return clipboardString;
+ // Call ClipboardEventNotifier to notify event observe of retrieved string
+ Dali::ClipboardEventNotifier clipboardEventNotifier(ClipboardEventNotifier::Get());
+ if ( clipboardEventNotifier )
+ {
+ ClipboardEventNotifier& notifierImpl( ClipboardEventNotifier::GetImplementation( clipboardEventNotifier ) );
+
+ notifierImpl.SetContent( clipboardString );
+ notifierImpl.EmitContentSelectedSignal();
+ }
}
}
- return "";
}
/*
ECore::WindowInterface::SendXEvent( ecore_x_display_get(), cbhmWin, False, NoEventMask, atomCbhmMsg, 8, SHOW );
}
-void Clipboard::HideClipboard()
+void Clipboard::HideClipboard(bool skipFirstHide)
{
Ecore_X_Window cbhmWin = ECore::WindowInterface::GetWindow();
// Launch the clipboard window
ecore_x_selection_secondary_clear();
}
+bool Clipboard::IsVisible() const
+{
+ return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+ return NULL;
+}
} // namespace Adaptor