LibreOffice Module sd (master) 1
|
#include <SlsSelectionFunction.hxx>
Classes | |
class | EventDescriptor |
class | ModeHandler |
Public Types | |
enum | Mode { NormalMode , MultiSelectionMode , DragAndDropMode } |
Public Member Functions | |
SelectionFunction (const SelectionFunction &)=delete | |
SelectionFunction & | operator= (const SelectionFunction &)=delete |
virtual bool | KeyInput (const KeyEvent &rKEvt) override |
handle keyboard events More... | |
virtual bool | MouseMove (const MouseEvent &rMEvt) override |
virtual bool | MouseButtonUp (const MouseEvent &rMEvt) override |
virtual bool | MouseButtonDown (const MouseEvent &rMEvt) override |
virtual void | DoCut () override |
Forward to the clipboard manager. More... | |
virtual void | DoCopy () override |
Forward to the clipboard manager. More... | |
virtual void | DoPaste () override |
Forward to the clipboard manager. More... | |
virtual bool | cancel () override |
is called when the current function should be aborted. More... | |
void | MouseDragged (const AcceptDropEvent &rEvent, const sal_Int8 nDragAction) |
void | NotifyDragFinished () |
Turn of substitution display and insertion indicator. More... | |
void | SwitchToNormalMode () |
void | SwitchToDragAndDropMode (const Point &rMousePosition) |
void | SwitchToMultiSelectionMode (const Point &rMousePosition, const sal_uInt32 nEventCode) |
void | ResetShiftKeySelectionAnchor () |
void | ResetMouseAnchor () |
Special case handling for when the context menu is hidden. More... | |
Public Member Functions inherited from sd::FuPoor | |
virtual void | DoExecute (SfxRequest &rReq) |
void | SetMouseButtonCode (sal_uInt16 nNew) |
sal_uInt16 | GetMouseButtonCode () const |
DrawDocShell * | GetDocSh () |
virtual void | DoCut () |
Cut object to clipboard. More... | |
virtual void | DoCopy () |
Copy object to clipboard. More... | |
virtual void | DoPaste () |
Paste object from clipboard. More... | |
virtual void | DoPasteUnformatted () |
Paste unformatted text from clipboard. More... | |
virtual bool | KeyInput (const KeyEvent &rKEvt) |
handle keyboard events More... | |
virtual bool | MouseMove (const MouseEvent &) |
virtual bool | MouseButtonUp (const MouseEvent &rMEvt) |
virtual bool | MouseButtonDown (const MouseEvent &rMEvt) |
virtual bool | Command (const CommandEvent &rCEvt) |
virtual bool | RequestHelp (const HelpEvent &rHEvt) |
virtual void | ReceiveRequest (SfxRequest &rReq) |
virtual void | Activate () |
activates the function More... | |
virtual void | Deactivate () |
deactivates the function More... | |
void | SetWindow (::sd::Window *pWin) |
virtual void | SelectionHasChanged () |
sal_uInt16 | GetSlotID () const |
void | StartDelayToScrollTimer () |
virtual rtl::Reference< SdrObject > | CreateDefaultObject (const sal_uInt16 nID, const ::tools::Rectangle &rRectangle) |
virtual bool | cancel () |
is called when the current function should be aborted. More... | |
virtual bool | doConstructOrthogonal () const |
Decide if the object to be created should be created orthogonal. More... | |
Public Member Functions inherited from sd::SimpleReferenceComponent | |
SimpleReferenceComponent () | |
void | acquire () |
@ATTENTION The results are undefined if, for any individual instance of SimpleReferenceComponent, the total number of calls to acquire() exceeds the total number of calls to release() by a platform dependent amount (which, hopefully, is quite large). More... | |
void | release () |
void | Dispose () |
bool | isDisposed () const |
Static Public Member Functions | |
static rtl::Reference< FuPoor > | Create (SlideSorter &rSlideSorter, SfxRequest &rRequest) |
Private Member Functions | |
SelectionFunction (SlideSorter &rSlideSorter, SfxRequest &rRequest) | |
virtual | ~SelectionFunction () override |
void | GotoNextPage (int nOffset) |
Make the slide nOffset slides away of the current one the new current slide. More... | |
void | GotoPage (int nIndex) |
Make the slide with the given index the new current slide. More... | |
void | ProcessMouseEvent (sal_uInt32 nEventType, const MouseEvent &rEvent) |
void | ProcessEvent (EventDescriptor &rEvent) |
void | MoveFocus (const FocusManager::FocusMoveDirection eDirection, const bool bIsShiftDown, const bool bIsControlDown) |
void | SwitchMode (const std::shared_ptr< ModeHandler > &rpHandler) |
Private Attributes | |
SlideSorter & | mrSlideSorter |
SlideSorterController & | mrController |
sal_Int32 | mnShiftKeySelectionAnchor |
Remember the slide where the shift key was pressed and started a multiselection via keyboard. More... | |
std::shared_ptr< ModeHandler > | mpModeHandler |
The selection function can be in one of several mutually exclusive modes. More... | |
Friends | |
class | ModeHandler |
Additional Inherited Members | |
Static Public Attributes inherited from sd::FuPoor | |
static const int | HITPIX = 2 |
static const int | HITLOG = 53 |
static const int | DRGLOG = 53 |
Protected Member Functions inherited from sd::FuPoor | |
FuPoor (ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq) | |
virtual | ~FuPoor () override |
DECL_LINK (DelayHdl, Timer *, void) | |
void | SwitchLayer (sal_Int32 nOffset) |
Switch to another layer. More... | |
DECL_LINK (ScrollHdl, Timer *, void) | |
void | ForceScroll (const Point &aPixPos) |
scroll when approached the border of the window; is called by MouseMove More... | |
DECL_LINK (DragHdl, Timer *, void) | |
Protected Member Functions inherited from sd::SimpleReferenceComponent | |
virtual void | disposing () |
virtual | ~SimpleReferenceComponent () |
Static Protected Member Functions inherited from sd::FuPoor | |
static void | ImpForceQuadratic (::tools::Rectangle &rRect) |
Protected Attributes inherited from sd::FuPoor | |
::sd::View * | mpView |
ViewShell * | mpViewShell |
VclPtr< ::sd::Window > | mpWindow |
DrawDocShell * | mpDocSh |
SdDrawDocument * | mpDoc |
sal_uInt16 | nSlotId |
Timer | aScrollTimer |
for auto-scrolling More... | |
Timer | aDragTimer |
for Drag&Drop More... | |
bool | bIsInDragMode |
Point | aMDPos |
position of MouseButtonDown More... | |
bool | bNoScrollUntilInside |
Flag to prevent auto-scrolling until one drags from outside into the window. More... | |
Timer | aDelayToScrollTimer |
timer to delay scrolling (~ 1 sec) when dragging out of the window More... | |
bool | bScrollable |
bool | bDelayActive |
bool | bFirstMouseMove |
Definition at line 37 of file SlsSelectionFunction.hxx.
Enumerator | |
---|---|
NormalMode | |
MultiSelectionMode | |
DragAndDropMode |
Definition at line 78 of file SlsSelectionFunction.hxx.
|
delete |
Referenced by Create().
|
private |
Definition at line 291 of file SlsSelectionFunction.cxx.
References GetController(), and make_shared().
|
overrideprivatevirtual |
Definition at line 307 of file SlsSelectionFunction.cxx.
References mpModeHandler.
|
overridevirtual |
is called when the current function should be aborted.
This is used when a function gets a KEY_ESCAPE but can also be called directly.
Reimplemented from sd::FuPoor.
Definition at line 573 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::SlideSorterController::GetFocusManager(), mrController, and sd::slidesorter::controller::FocusManager::ToggleFocus().
|
static |
Definition at line 312 of file SlsSelectionFunction.cxx.
References SelectionFunction().
Referenced by sd::slidesorter::controller::SlideSorterController::CreateSelectionFunction(), and sd::slidesorter::controller::SlotManager::FuPermanent().
|
overridevirtual |
Forward to the clipboard manager.
Reimplemented from sd::FuPoor.
Definition at line 563 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::Clipboard::DoCopy(), sd::slidesorter::controller::SlideSorterController::GetClipboard(), and mrController.
|
overridevirtual |
Forward to the clipboard manager.
Reimplemented from sd::FuPoor.
Definition at line 558 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::Clipboard::DoCut(), sd::slidesorter::controller::SlideSorterController::GetClipboard(), and mrController.
|
overridevirtual |
Forward to the clipboard manager.
Reimplemented from sd::FuPoor.
Definition at line 568 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::Clipboard::DoPaste(), sd::slidesorter::controller::SlideSorterController::GetClipboard(), and mrController.
|
private |
Make the slide nOffset slides away of the current one the new current slide.
When the new index is outside the range of valid page numbers it is clipped to that range.
nOffset | When nOffset is negative then go back. When nOffset if positive go forward. When it is zero then ignore the call. |
Definition at line 579 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::SlideSorterController::GetCurrentSlideManager(), SdrPage::GetPageNum(), GotoPage(), mrController, nIndex, and ResetShiftKeySelectionAnchor().
Referenced by KeyInput().
|
private |
Make the slide with the given index the new current slide.
nIndex | Index of the new current slide. When the new index is outside the range of valid page numbers it is clipped to that range. |
Definition at line 593 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::SlideSorterController::GetFocusManager(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageCount(), sd::slidesorter::model::SlideSorterModel::GetPageDescriptor(), mpModeHandler, mrController, mrSlideSorter, nIndex, ResetShiftKeySelectionAnchor(), and sd::slidesorter::controller::FocusManager::SetFocusedPage().
Referenced by GotoNextPage(), and KeyInput().
|
overridevirtual |
handle keyboard events
Reimplemented from sd::FuPoor.
Definition at line 353 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::PageSelector::DeselectPage(), sd::slidesorter::controller::FocusManager::Down, SfxDispatcher::Execute(), vcl::KeyCode::GetCode(), sd::slidesorter::SlideSorter::GetController(), SfxShell::GetDispatcher(), sd::slidesorter::controller::FocusManager::GetFocusedPageDescriptor(), sd::slidesorter::controller::SlideSorterController::GetFocusManager(), KeyEvent::GetKeyCode(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageCount(), sd::slidesorter::controller::SlideSorterController::GetPageSelector(), sd::slidesorter::controller::SlideSorterController::GetSelectionManager(), sd::slidesorter::SlideSorter::GetViewShell(), GotoNextPage(), GotoPage(), sd::slidesorter::controller::FocusManager::HasFocus(), sd::slidesorter::controller::FocusManager::IsFocusShowing(), sd::ViewShell::IsMainViewShell(), vcl::KeyCode::IsMod1(), vcl::KeyCode::IsShift(), KEY_BACKSPACE, KEY_DELETE, KEY_DOWN, KEY_END, KEY_ESCAPE, KEY_F10, KEY_HOME, KEY_LEFT, KEY_PAGEDOWN, KEY_PAGEUP, KEY_RETURN, KEY_RIGHT, KEY_SPACE, KEY_TAB, KEY_UP, sd::FuPoor::KeyInput(), sd::slidesorter::controller::FocusManager::Left, mnShiftKeySelectionAnchor, MoveFocus(), mpModeHandler, mrController, mrSlideSorter, sd::slidesorter::controller::FocusManager::Right, sd::slidesorter::controller::PageSelector::SelectPage(), sd::slidesorter::controller::FocusManager::ShowFocus(), sd::slidesorter::model::PageDescriptor::ST_Selected, SwitchToNormalMode(), and sd::slidesorter::controller::FocusManager::Up.
|
overridevirtual |
Reimplemented from sd::FuPoor.
Definition at line 320 of file SlsSelectionFunction.cxx.
References sd::FuPoor::aMDPos, MouseEvent::GetButtons(), MouseEvent::GetPosPixel(), ProcessMouseEvent(), and sd::FuPoor::SetMouseButtonCode().
|
overridevirtual |
Reimplemented from sd::FuPoor.
Definition at line 339 of file SlsSelectionFunction.cxx.
References sd::slidesorter::controller::SlideSorterController::GetScrollBarManager(), mrController, ProcessMouseEvent(), and sd::slidesorter::controller::ScrollBarManager::StopAutoScroll().
void sd::slidesorter::controller::SelectionFunction::MouseDragged | ( | const AcceptDropEvent & | rEvent, |
const sal_Int8 | nDragAction | ||
) |
Definition at line 623 of file SlsSelectionFunction.cxx.
References mrSlideSorter, and ProcessEvent().
Referenced by sd::slidesorter::controller::Clipboard::AcceptDrop().
|
overridevirtual |
Reimplemented from sd::FuPoor.
Definition at line 333 of file SlsSelectionFunction.cxx.
References ProcessMouseEvent().
|
private |
Definition at line 494 of file SlsSelectionFunction.cxx.
References sd::slidesorter::model::PageEnumerationProvider::CreateAllPagesEnumeration(), sd::slidesorter::controller::PageSelector::DeselectPage(), sd::slidesorter::controller::FocusManager::GetFocusedPageDescriptor(), sd::slidesorter::controller::SlideSorterController::GetFocusManager(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::PageEnumeration::GetNextElement(), sd::slidesorter::controller::SlideSorterController::GetPageSelector(), sd::slidesorter::model::PageEnumeration::HasMoreElements(), mnShiftKeySelectionAnchor, sd::slidesorter::controller::FocusManager::MoveFocus(), mpModeHandler, mrController, mrSlideSorter, ResetShiftKeySelectionAnchor(), and sd::slidesorter::controller::PageSelector::SelectPage().
Referenced by KeyInput().
void sd::slidesorter::controller::SelectionFunction::NotifyDragFinished | ( | ) |
Turn of substitution display and insertion indicator.
Definition at line 348 of file SlsSelectionFunction.cxx.
References SwitchToNormalMode().
|
delete |
|
private |
Definition at line 631 of file SlsSelectionFunction.cxx.
References mpModeHandler.
Referenced by MouseDragged(), and ProcessMouseEvent().
|
private |
Definition at line 614 of file SlsSelectionFunction.cxx.
References MouseEvent::GetButtons(), mrSlideSorter, ProcessEvent(), and sd::FuPoor::SetMouseButtonCode().
Referenced by MouseButtonDown(), MouseButtonUp(), and MouseMove().
void sd::slidesorter::controller::SelectionFunction::ResetMouseAnchor | ( | ) |
Special case handling for when the context menu is hidden.
This method will reinitialize the current mouse position to prevent the mouse motion during the time the context menu is displayed from being interpreted as drag-and-drop start.
Definition at line 690 of file SlsSelectionFunction.cxx.
References mpModeHandler, and NormalMode.
void sd::slidesorter::controller::SelectionFunction::ResetShiftKeySelectionAnchor | ( | ) |
Definition at line 685 of file SlsSelectionFunction.cxx.
References mnShiftKeySelectionAnchor.
Referenced by GotoNextPage(), GotoPage(), and MoveFocus().
|
private |
Definition at line 669 of file SlsSelectionFunction.cxx.
References sd::slidesorter::SlideSorter::GetView(), mpModeHandler, mrSlideSorter, sd::slidesorter::view::SlideSorterView::SetPageUnderMouse(), and sd::slidesorter::view::SlideSorterView::UpdatePageUnderMouse().
Referenced by SwitchToDragAndDropMode(), SwitchToMultiSelectionMode(), and SwitchToNormalMode().
void sd::slidesorter::controller::SelectionFunction::SwitchToDragAndDropMode | ( | const Point & | rMousePosition | ) |
Definition at line 653 of file SlsSelectionFunction.cxx.
References DragAndDropMode, mpModeHandler, sd::FuPoor::mpWindow, mrSlideSorter, and SwitchMode().
void sd::slidesorter::controller::SelectionFunction::SwitchToMultiSelectionMode | ( | const Point & | rMousePosition, |
const sal_uInt32 | nEventCode | ||
) |
Definition at line 661 of file SlsSelectionFunction.cxx.
References mpModeHandler, mrSlideSorter, MultiSelectionMode, and SwitchMode().
void sd::slidesorter::controller::SelectionFunction::SwitchToNormalMode | ( | ) |
Definition at line 647 of file SlsSelectionFunction.cxx.
References mpModeHandler, mrSlideSorter, NormalMode, and SwitchMode().
Referenced by KeyInput(), and NotifyDragFinished().
|
friend |
Definition at line 77 of file SlsSelectionFunction.hxx.
|
private |
Remember the slide where the shift key was pressed and started a multiselection via keyboard.
Definition at line 107 of file SlsSelectionFunction.hxx.
Referenced by KeyInput(), MoveFocus(), and ResetShiftKeySelectionAnchor().
|
private |
The selection function can be in one of several mutually exclusive modes.
Definition at line 112 of file SlsSelectionFunction.hxx.
Referenced by GotoPage(), KeyInput(), MoveFocus(), ProcessEvent(), ResetMouseAnchor(), SwitchMode(), SwitchToDragAndDropMode(), SwitchToMultiSelectionMode(), SwitchToNormalMode(), and ~SelectionFunction().
|
private |
Definition at line 98 of file SlsSelectionFunction.hxx.
Referenced by cancel(), DoCopy(), DoCut(), DoPaste(), GotoNextPage(), GotoPage(), KeyInput(), MouseButtonUp(), and MoveFocus().
|
private |
Definition at line 97 of file SlsSelectionFunction.hxx.
Referenced by sd::slidesorter::controller::SelectionFunction::ModeHandler::DeselectAllPages(), GotoPage(), KeyInput(), MouseDragged(), MoveFocus(), sd::slidesorter::controller::SelectionFunction::ModeHandler::ProcessEvent(), sd::slidesorter::controller::SelectionFunction::ModeHandler::ProcessMotionEvent(), ProcessMouseEvent(), sd::slidesorter::controller::SelectionFunction::ModeHandler::SelectOnePage(), sd::slidesorter::controller::SelectionFunction::ModeHandler::SetCurrentPage(), SwitchMode(), SwitchToDragAndDropMode(), SwitchToMultiSelectionMode(), SwitchToNormalMode(), and sd::slidesorter::controller::SelectionFunction::ModeHandler::SwitchView().