Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / FUi_Clipboard.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                FUi_Clipboard.h
19  * @brief               This is the header file for the _Clipboard class.
20  *
21  * This header file contains the declarations of the %_Clipboard class.
22  */
23 #ifndef _FUI_INTERNAL_CLIPBOARD_H_
24 #define _FUI_INTERNAL_CLIPBOARD_H_
25
26 #include <FBaseObject.h>
27 #include <FUiClipboardTypes.h>
28 #include "FUi_Types.h"
29 #include "FUi_EcoreEvas.h"
30
31 namespace Tizen { namespace Base { namespace Collection {
32 class IList;
33 }}} // Tizen::Base::Collection
34
35 namespace Tizen { namespace Ui { namespace Controls {
36 class _PublicClipboardPopupEvent;
37 }}} // Tizen::Ui::Controls
38
39 namespace Tizen { namespace Graphics {
40 class Bitmap;
41 }} // Tizen::Graphics
42
43 namespace Tizen { namespace Ui
44 {
45 class _ClipboardItem;
46 class IClipboardPopupEventListener;
47
48 class _Clipboard
49         : public Tizen::Base::Object
50 {
51 public:
52         static _Clipboard* GetInstance(void);
53         static void ReleaseInstance(void);
54
55         result CopyItem(const _ClipboardItem& item);
56
57         Tizen::Base::Collection::IList* RetrieveItemsN(unsigned long dataTypes);
58         const _ClipboardItem* RetrieveLatestItemN(unsigned long dataTypes);
59
60         result ShowPopup(unsigned long dataTypes, const IClipboardPopupEventListener &listener);
61         result HidePopup(void);
62         bool IsPopupVisible(void);
63
64         void FireEvent(int format, char* pData);
65
66 private:
67         _ClipFormat ConvertToClipFormat(ClipboardDataType type);
68         ClipboardDataType ConvertToDataType(int format, const char* pData);
69
70         char* EncodeToCharN(const Tizen::Base::String& string);
71
72         char* CreateImageFileN(const Tizen::Graphics::Bitmap& bitmap);
73         Tizen::Graphics::Bitmap* LoadBitmapN(const Tizen::Base::String& path);
74
75         Tizen::Base::String CreateImageFilePath(void);
76         result RemoveUnnecessaryImageFiles(void);
77         result RemoveAllImageFiles(void);
78
79         bool IsValidDataType(unsigned long dataTypes);
80         bool IsVideoDataType(const char* pChar);
81         bool IsAudioDataType(const char* pChar);
82
83         _Clipboard(void);
84         virtual ~_Clipboard(void);
85
86         _Clipboard(const _Clipboard& rhs);
87         _Clipboard& operator =(const _Clipboard& rhs);
88
89 private:
90         Tizen::Ui::Controls::_PublicClipboardPopupEvent* __pPublicEvent;
91
92         static _Clipboard* __pInstance;
93 }; // _Clipboard
94
95 }} // Tizen::Ui
96
97 #endif  // _FUI_INTERNAL_CLIPBOARD_H_