LibreOffice Module sd (master) 1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sd::slidesorter::controller::SelectionFunction Class Referencefinal

#include <SlsSelectionFunction.hxx>

Inheritance diagram for sd::slidesorter::controller::SelectionFunction:
[legend]
Collaboration diagram for sd::slidesorter::controller::SelectionFunction:
[legend]

Classes

class  EventDescriptor
 
class  ModeHandler
 

Public Types

enum  Mode {
  NormalMode ,
  MultiSelectionMode ,
  DragAndDropMode
}
 

Public Member Functions

 SelectionFunction (const SelectionFunction &)=delete
 
SelectionFunctionoperator= (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
 
DrawDocShellGetDocSh ()
 
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< SdrObjectCreateDefaultObject (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< FuPoorCreate (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

SlideSortermrSlideSorter
 
SlideSorterControllermrController
 
sal_Int32 mnShiftKeySelectionAnchor
 Remember the slide where the shift key was pressed and started a multiselection via keyboard. More...
 
std::shared_ptr< ModeHandlermpModeHandler
 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::ViewmpView
 
ViewShellmpViewShell
 
VclPtr< ::sd::WindowmpWindow
 
DrawDocShellmpDocSh
 
SdDrawDocumentmpDoc
 
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
 

Detailed Description

Definition at line 37 of file SlsSelectionFunction.hxx.

Member Enumeration Documentation

◆ Mode

Enumerator
NormalMode 
MultiSelectionMode 
DragAndDropMode 

Definition at line 78 of file SlsSelectionFunction.hxx.

Constructor & Destructor Documentation

◆ SelectionFunction() [1/2]

sd::slidesorter::controller::SelectionFunction::SelectionFunction ( const SelectionFunction )
delete

Referenced by Create().

◆ SelectionFunction() [2/2]

sd::slidesorter::controller::SelectionFunction::SelectionFunction ( SlideSorter rSlideSorter,
SfxRequest rRequest 
)
private

Definition at line 291 of file SlsSelectionFunction.cxx.

References GetController(), and make_shared().

◆ ~SelectionFunction()

sd::slidesorter::controller::SelectionFunction::~SelectionFunction ( )
overrideprivatevirtual

Definition at line 307 of file SlsSelectionFunction.cxx.

References mpModeHandler.

Member Function Documentation

◆ cancel()

bool sd::slidesorter::controller::SelectionFunction::cancel ( )
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.

Returns
true if an active function was aborted

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().

◆ Create()

rtl::Reference< FuPoor > sd::slidesorter::controller::SelectionFunction::Create ( SlideSorter rSlideSorter,
SfxRequest rRequest 
)
static

◆ DoCopy()

void sd::slidesorter::controller::SelectionFunction::DoCopy ( )
overridevirtual

◆ DoCut()

void sd::slidesorter::controller::SelectionFunction::DoCut ( )
overridevirtual

◆ DoPaste()

void sd::slidesorter::controller::SelectionFunction::DoPaste ( )
overridevirtual

◆ GotoNextPage()

void sd::slidesorter::controller::SelectionFunction::GotoNextPage ( int  nOffset)
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.

Parameters
nOffsetWhen 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().

◆ GotoPage()

void sd::slidesorter::controller::SelectionFunction::GotoPage ( int  nIndex)
private

Make the slide with the given index the new current slide.

Parameters
nIndexIndex 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().

◆ KeyInput()

bool sd::slidesorter::controller::SelectionFunction::KeyInput ( const KeyEvent rKEvt)
overridevirtual

handle keyboard events

Returns
sal_True if the event was handled, sal_False otherwise

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.

◆ MouseButtonDown()

bool sd::slidesorter::controller::SelectionFunction::MouseButtonDown ( const MouseEvent rMEvt)
overridevirtual

◆ MouseButtonUp()

bool sd::slidesorter::controller::SelectionFunction::MouseButtonUp ( const MouseEvent rMEvt)
overridevirtual

◆ MouseDragged()

void sd::slidesorter::controller::SelectionFunction::MouseDragged ( const AcceptDropEvent rEvent,
const sal_Int8  nDragAction 
)

◆ MouseMove()

bool sd::slidesorter::controller::SelectionFunction::MouseMove ( const MouseEvent rMEvt)
overridevirtual

Reimplemented from sd::FuPoor.

Definition at line 333 of file SlsSelectionFunction.cxx.

References ProcessMouseEvent().

◆ MoveFocus()

void sd::slidesorter::controller::SelectionFunction::MoveFocus ( const FocusManager::FocusMoveDirection  eDirection,
const bool  bIsShiftDown,
const bool  bIsControlDown 
)
private

◆ NotifyDragFinished()

void sd::slidesorter::controller::SelectionFunction::NotifyDragFinished ( )

Turn of substitution display and insertion indicator.

Definition at line 348 of file SlsSelectionFunction.cxx.

References SwitchToNormalMode().

◆ operator=()

SelectionFunction & sd::slidesorter::controller::SelectionFunction::operator= ( const SelectionFunction )
delete

◆ ProcessEvent()

void sd::slidesorter::controller::SelectionFunction::ProcessEvent ( EventDescriptor rEvent)
private

Definition at line 631 of file SlsSelectionFunction.cxx.

References mpModeHandler.

Referenced by MouseDragged(), and ProcessMouseEvent().

◆ ProcessMouseEvent()

void sd::slidesorter::controller::SelectionFunction::ProcessMouseEvent ( sal_uInt32  nEventType,
const MouseEvent rEvent 
)
private

◆ ResetMouseAnchor()

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.

◆ ResetShiftKeySelectionAnchor()

void sd::slidesorter::controller::SelectionFunction::ResetShiftKeySelectionAnchor ( )

Definition at line 685 of file SlsSelectionFunction.cxx.

References mnShiftKeySelectionAnchor.

Referenced by GotoNextPage(), GotoPage(), and MoveFocus().

◆ SwitchMode()

void sd::slidesorter::controller::SelectionFunction::SwitchMode ( const std::shared_ptr< ModeHandler > &  rpHandler)
private

◆ SwitchToDragAndDropMode()

void sd::slidesorter::controller::SelectionFunction::SwitchToDragAndDropMode ( const Point rMousePosition)

◆ SwitchToMultiSelectionMode()

void sd::slidesorter::controller::SelectionFunction::SwitchToMultiSelectionMode ( const Point rMousePosition,
const sal_uInt32  nEventCode 
)

◆ SwitchToNormalMode()

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().

Friends And Related Function Documentation

◆ ModeHandler

friend class ModeHandler
friend

Definition at line 77 of file SlsSelectionFunction.hxx.

Member Data Documentation

◆ mnShiftKeySelectionAnchor

sal_Int32 sd::slidesorter::controller::SelectionFunction::mnShiftKeySelectionAnchor
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().

◆ mpModeHandler

std::shared_ptr<ModeHandler> sd::slidesorter::controller::SelectionFunction::mpModeHandler
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().

◆ mrController

SlideSorterController& sd::slidesorter::controller::SelectionFunction::mrController
private

◆ mrSlideSorter

SlideSorter& sd::slidesorter::controller::SelectionFunction::mrSlideSorter
private

The documentation for this class was generated from the following files: