X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-clipboard.h;h=7ad3187615d9e683be42094397097a75dbe93163;hb=9c8053630acca0acafaed587e9166710da1010f9;hp=3cb121b1326519da3a770ce35a448d0c80abe2aa;hpb=a881757839b7abb008873a68c67e17b3ba39669b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.h index 3cb121b..7ad3187 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.h @@ -1,8 +1,8 @@ -#ifndef __TOOLKIT_CLIPBOARD_H__ -#define __TOOLKIT_CLIPBOARD_H__ +#ifndef TOOLKIT_CLIPBOARD_H +#define TOOLKIT_CLIPBOARD_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -18,11 +18,12 @@ * */ -#define __DALI_CLIPBOARD_H__ +#define DALI_CLIPBOARD_H // EXTERNAL INCLUDES #include #include +#include namespace Dali DALI_IMPORT_API { @@ -44,21 +45,60 @@ class Clipboard : public BaseHandle { public: /** + * @brief Structure that contains information about the clipboard data information. + */ + struct ClipData + { + ClipData(const char* mimeType = nullptr, const char* data = nullptr) + { + this->mimeType = mimeType; + this->data = data; + } + void SetMimeType(const char* mimeType) + { + this->mimeType = mimeType; + } + const char* GetMimeType() const + { + return mimeType; + } + void SetData(const char* data) + { + this->data = data; + } + const char* GetData() const + { + return data; + } + + private: + const char* mimeType {nullptr}; ///< The mime type of clip data. + const char* data {nullptr}; ///< The clip data. + }; + + /// @brief Data send completed signal. + typedef Signal DataSentSignalType; + + /// @brief Data receive completed signal. + typedef Signal DataReceivedSignalType; + + + /** * Create an uninitialized Clipboard; * this can be initialized with one of the derived Clipboard' New() methods */ Clipboard(); /** - * Virtual destructor. + * Non virtual destructor. */ - virtual ~Clipboard(); + ~Clipboard(); /** * This constructor is used by Adaptor::GetClipboard(). * @param[in] clipboard A pointer to the clipboard. */ - Clipboard( Internal::Adaptor::Clipboard* clipboard ); + Clipboard(Internal::Adaptor::Clipboard* clipboard); /** * Retrieve a handle to the ClipboardEventNotifier instance @@ -67,24 +107,48 @@ public: static Clipboard Get(); /** - * Send the given string to the clipboard - * @param[in] itemData string to send to clip board - * @return bool true if the internal clip board sending was successful. + * @brief Checks whether the clipboard is available. + * @return true, if it is available, false otherwise. */ - bool SetItem( const std::string& itemData ); + static bool IsAvailable(); /** - * Retreive the string at the given index in the clip board. - * @param[in] index item in clipboard list to retrieve - * @return string the text item at the current index. + * @brief This signal is emitted when the data send complete. + * @note + * SetData() opertion does not follow a synchronous call. + * It follows the sequence below. + * SetData() -> EcoreEventDataSend() -> SendData() -> DataSentSignal() Emit */ - std::string GetItem( unsigned int index ); + DataSentSignalType& DataSentSignal(); /** - * Returns the number of item currently in the clipboard - * @return unsigned int number of clipboard items + * @brief This signal is emitted when the data receive complete. + * @note + * GetData() opertion does not follow a synchronous call. + * It follows the sequence below. + * GetData() -> EcoreEventOfferDataReady() -> ReceiveData() -> DataReceivedSignal() Emit */ - unsigned int NumberOfItems(); + DataReceivedSignalType& DataReceivedSignal(); + + /** + * @brief Send the given data to the clipboard. + * @param[in] clipData data to send to the clipboard + * @return bool true if the internal clipboard sending was successful. + */ + bool SetData(const ClipData& clipData); + + /** + * @brief Request data from the clipboard. + * @param[in] mimeType mime type of data to request. + * @return uint32_t Returns the data request id. + */ + uint32_t GetData(const std::string& mimeType); + + /** + * @brief Returns the number of item currently in the clipboard. + * @return size_t number of clipboard items. + */ + size_t NumberOfItems(); /** * Show the clipboard window @@ -96,7 +160,13 @@ public: */ void HideClipboard(); + /** + * @brief Retrieves the clipboard's visibility + * @return bool true if the clipboard is visible. + */ + bool IsVisible() const; + }; } // namespace Dali -#endif // __TOOLKIT_CLIPBOARD_H__ +#endif // TOOLKIT_CLIPBOARD_H