7f0fd048a05a67b86dd3d9ca87818801891d766d
[platform/core/uifw/dali-adaptor.git] / adaptors / tizen / internal / common / clipboard-impl.h
1 #ifndef __DALI_INTERNAL_CLIPBOARD_H__
2 #define __DALI_INTERNAL_CLIPBOARD_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // EXTERNAL INCLUDES
21 #include <dali/public-api/adaptor-framework/common/clipboard.h>
22 #include <dali/public-api/object/base-object.h>
23 #include <Ecore_X.h>
24
25
26
27 namespace Dali
28 {
29
30 namespace Internal
31 {
32
33 namespace Adaptor
34 {
35
36 /**
37  * Implementation of the Clip Board
38  */
39
40 class Clipboard :  public Dali::BaseObject
41 {
42 public:
43
44   /**
45    * @copydoc Dali::ClipboardEventNotifier::Get()
46    */
47   static Dali::Clipboard Get();
48
49   /**
50    * Constructor
51    * @param[in] ecoreXwin, The window is created by application.
52    */
53
54   Clipboard(Ecore_X_Window ecoreXwin);
55   virtual ~Clipboard();
56
57   /**
58    * @copydoc Dali::Clipboard::SetItem()
59    */
60   bool SetItem(const std::string &itemData);
61
62   /**
63    * @copydoc Dali::Clipboard::GetItem()
64    */
65   std::string GetItem( unsigned int index );
66
67   /**
68    * @copydoc Dali::Clipboard::NumberOfClipboardItems()
69    */
70   unsigned int NumberOfItems();
71
72   /**
73    * @copydoc Dali::Clipboard::ShowClipboard()
74    */
75   void ShowClipboard();
76
77   /**
78    * @copydoc Dali::Clipboard::HideClipboard()
79    */
80   void HideClipboard();
81
82   
83 private:
84   Ecore_X_Window mApplicationWindow;
85   Clipboard( const Clipboard& );
86   Clipboard& operator=( Clipboard& );
87
88 }; // class clipboard
89
90
91 } // namespace Adaptor
92
93 } // namespace Internal
94
95   inline static Internal::Adaptor::Clipboard& GetImplementation(Dali::Clipboard& clipboard)
96   {
97     DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
98     BaseObject& handle = clipboard.GetBaseObject();
99     return static_cast<Internal::Adaptor::Clipboard&>(handle);
100   }
101
102   inline static const  Internal::Adaptor::Clipboard& GetImplementation(const Dali::Clipboard& clipboard)
103   {
104     DALI_ASSERT_ALWAYS( clipboard && "Clipboard handle is empty" );
105     const BaseObject& handle = clipboard.GetBaseObject();
106     return static_cast<const Internal::Adaptor::Clipboard&>(handle);
107   }
108
109 } // namespace Dali
110
111 #endif // __DALI_INTERNAL_CLIPBOARD_H__