2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
18 * @file FUiCtrl_EditCopyPasteManager.h
19 * @brief This is the header file for _EditCopyPasteManager class.
21 * This header file contains declaration of _EditCopyPasteManager class.
24 #ifndef _FUI_CTRL_INTERNAL_EDIT_COPY_PASTE_MANAGER_H_
25 #define _FUI_CTRL_INTERNAL_EDIT_COPY_PASTE_MANAGER_H_
27 #include <FGrpPoint.h>
28 #include <FGrpRectangle.h>
29 #include "FUi_Control.h"
30 #include "FUiCtrl_ContextMenu.h"
31 #include "FUiCtrl_Edit.h"
32 #include "FUiCtrl_IActionEventListener.h"
33 #include "FUiCtrl_IEditCopyPasteEventListener.h"
35 namespace Tizen {namespace Ui {namespace Controls
39 class _EditCopyPasteHandler;
40 class _EditCopyPasteEvent;
43 * @class _EditCopyPasteManager
44 * @brief This class handles CopyPastePopup and Handler Windows.
47 class _EditCopyPasteManager
48 : virtual public Tizen::Base::Runtime::IEventListener
49 , virtual public Tizen::Ui::_IUiEventListener
50 , virtual public Tizen::Ui::_IUiEventPreviewer
51 , public _IActionEventListener
56 HANDLER_TYPE_LEFT = 0,
63 HANDLER_MOVE_TYPE_LEFT = 0,
65 HANDLER_MOVE_TYPE_DOWN,
66 HANDLER_MOVE_TYPE_RIGHT
72 * This is the default class constructor.
75 _EditCopyPasteManager(_Edit& parenEdit);
78 * This is the default class destructor.
81 virtual ~_EditCopyPasteManager(void);
85 void CreateCopyPastePopup(void);
86 void CreateHandle(void);
88 bool CheckHandleBounds(const Tizen::Graphics::Point& point);
89 bool CheckHandlePosition(bool leftHandle, int cursorPosition);
90 void CheckVisibleState(bool leftHandle);
91 void HideHandle(void);
92 void RefreshBlock(bool changeVisibleState, bool isLeftHandle = false);
93 Tizen::Graphics::Rectangle GetCursorBounds(bool isAbsRect) const;
94 int GetCursorPositionAt(const Tizen::Graphics::Point& touchPoint) const;
95 result SetCursorPosition(int position);
96 int GetCursorPosition(void) const;
97 int GetHandlerCursorPosition(bool rightHandler) const;
98 void SendTextBlockEvent(void);
100 void ReleaseCopyPastePopup(void);
101 void SwitchHandle(void);
102 bool IsCopyPastePopup(const _Control& control) const;
103 void AdjustBounds(void);
105 result AddCopyPasteEventListener(const _IEditCopyPasteEventListener& listener);
106 result SendCopyPasteEvent(Tizen::Ui::Controls::CoreCopyPasteStatus status, Tizen::Ui::Controls::CoreCopyPasteAction action);
107 void PrintLog(const Tizen::Graphics::Point& point);
108 bool GetTextBlockReleaseFlag(void) const;
109 void SetTextBlockReleaseFlag(bool enabled);
112 virtual void OnActionPerformed(const Tizen::Ui::_Control& source, int actionId);
113 void ScrollText(int distance);
114 _Edit* GetEdit(void) const;
115 void MoveHandler(HandlerMoveType moveType);
116 bool IsHandlerMovingEnabled(void) const;
117 void SetHandlerMovingEnabled(bool enabled);
118 Tizen::Graphics::Rectangle GetEditVisibleArea(void) const;
120 _EditCopyPasteManager(const _EditCopyPasteManager& value);
121 _EditCopyPasteManager& operator =(const _EditCopyPasteManager& value);
124 _ContextMenu* __pCopyPastePopup;
125 ContextMenuCoreAlign __contextMenuAlign;
126 _EditCopyPasteHandler* __pHandle[HANDLER_TYPE_MAX];
127 _EditCopyPasteEvent* __pCoreCopyPasteEvent;
129 int __contextMenuHeight;
130 bool __needToReleaseBlock;
131 bool __isHandlerMoving;
132 Tizen::Graphics::Rectangle __editVisibleArea;
133 }; // _EditCopyPasteManager
135 }}} // Tizen::Ui::Controls
137 #endif // _FUI_CTRL_INTERNAL_EDIT_COPY_PASTE_MANAGER_H_