c462182cc1dcfffcfe25aa4de126cd4ee416bee0
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / clipboard.h
1 #ifndef  DALI_CLIPBOARD_H
2 #define  DALI_CLIPBOARD_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21
22 // EXTERNAL INCLUDES
23 #include <dali/public-api/math/rect.h>
24 #include <dali/public-api/object/base-handle.h>
25
26 // INTERNAL INCLUDES
27 #include <dali/public-api/dali-adaptor-common.h>
28
29 namespace Dali
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34
35 namespace Adaptor
36 {
37 class Clipboard;
38 }
39 }
40
41 /**
42  * @brief Interface to the device's clipboard.
43  *
44  * Clipboard can manage it's item and set show / hide status.
45  */
46
47 class DALI_ADAPTOR_API Clipboard : public BaseHandle
48 {
49 public:
50   /**
51    * @brief Create an uninitialized Clipboard.
52    *
53    * this can be initialized with one of the derived Clipboard' New() methods
54    */
55   Clipboard();
56
57   /**
58    * @brief Destructor
59    *
60    * This is non-virtual since derived Handle types must not contain data or virtual methods.
61    */
62   ~Clipboard();
63
64   /**
65    * @brief This constructor is used by Adaptor::GetClipboard().
66    *
67    * @param[in] clipboard A pointer to the clipboard.
68    */
69   explicit DALI_INTERNAL Clipboard( Internal::Adaptor::Clipboard* clipboard );
70
71   /**
72    * @brief Retrieve a handle to the ClipboardEventNotifier instance.
73    *
74    * @return A handle to the Clipboard
75    */
76   static Clipboard Get();
77
78   /**
79    * @brief Send the given string to the clipboard.
80    *
81    * @param[in] itemData string to send to clip board
82    * @return bool true if the internal clip board sending was successful.
83    */
84   bool SetItem( const std::string& itemData );
85
86   /**
87    * @brief Request clipboard service to retrieve an item
88    *
89    * Calling this method will trigger a signal from the clipboard event notifier.
90    * @see Dali::ClipboardEventNotifier::ContentSelectedSignal()
91    */
92   void RequestItem();
93
94   /**
95    * @brief Returns the number of item currently in the clipboard.
96    *
97    * @return unsigned int number of clipboard items
98    */
99   unsigned int NumberOfItems();
100
101   /**
102    * @brief Show the clipboard window.
103    */
104   void ShowClipboard();
105
106   /**
107    * @brief Hide the clipboard window.
108    */
109   void HideClipboard();
110
111   /**
112   * @brief Retrieves the clipboard's visibility
113   * @return bool true if the clipboard is visible.
114   */
115   bool IsVisible() const;
116
117 };
118 } // namespace Dali
119
120 #endif // DALI_CLIPBOARD_H