Copyright © 1995-2012 Opera Software AS. All rights reserved. This file is part of the Opera web browser. It may not be distributed under any circumstances.
The dragdrop module contains classes such as:
DragDropManager,
DragDrop_Data_Utils,
DragDropEventsManager,
PrivateDragData,
DragScroller,
DragDropVisualFeedback,
ClipboardManager
The class
DragDropManager
is the drag'n'drop interface for CORE. Whenever CORE needs something done with regards to d'n'd
it should call DragDropManager's methods.
Internally DragDropManager takes care of:
The class
DragDrop_Data_Utils
is the utility class wrapping some operations on the data store represented by PI's OpDragObject class.
It essentially encloses operations which would have to be repeated in various code parts into proper methods.
It makes operations on the data easier as well.
The class
DragDropEventsManager
has a role of the drag'n'drop events queue. It's responsible for queuing events which come
when some other event is being handled and for replaying them when the current event is handled.
It also tries to make sure no important event is lost in various situations (e.g. a document unload).
The class
PrivateDragData,
as it's name suggests, stores some private d'n'd data. The private data is the data DragDropManager needs in order to drive the drag'n'drop operation correctly
e.g. the flag indicating that the dragged data comes from a text selection on a page.
The class
DragScroller
is responsible for scrolling scrollable containers during d'n'd when the drag gets close to the scroll margin.
The scrolling functionality is configurable via: TWEAK_DND_SCROLL_MARGIN, TWEAK_DND_SCROLL_MARGIN_MIN_PX, TWEAK_DND_SCROLL_DELTA_MIN,
TWEAK_DND_SCROLL_DELTA_MAX and TWEAK_DND_SCROLL_INTERVAL tweaks. See module.tweaks for more details.
Note that this functionality uses the OpTimer to do its job.
The class
DragDropVisualFeedback
allows to create the d'n'd visual feedback bitmap out of elements or a text selection being dragged.
The class
ClipboardManager
is the clipboard interface for CORE. Core objects should call it when they want to put/get anything to/from
the clipboard or copying/cutting/pasting takes place. Internally it takes care of:
Majority of functions which may fail due to OOM either return failure status or raise OOM situation in MemoryManager.
May allocate big objects on the heap mainly when starting the drag'n'drop opertation e.g. when creating the visual feedback bitmap.
Temporary objects and recursive functions: e.g. getting the microdata from dragged elements in DragDropManager::OnDragStart() and scrolling scrollables: DragDropManager::ScrollIfNeededInternal().
All is freed.
Uses temp buffers passed in by callers or created on the stack.
Selftests and the d'n'd testsuite and the clipboard events testsuite
Multi-drag , the visual feedback bitmap generation, the text/html data generation out of a text selection and updating the feedback bitmap when e.g. the video element is being dragged.