LibreOffice Module sd (master) 1
|
#include <SlsClipboard.hxx>
Classes | |
class | UndoContext |
Public Member Functions | |
Clipboard (SlideSorter &rSlideSorter) | |
virtual | ~Clipboard () override |
void | HandleSlotCall (SfxRequest &rRequest) |
With the current implementation the forwarded calls to the current function will come back eventually to call the local Do(Cut|Copy|Paste) methods. More... | |
void | DoCut () |
SD_DLLPUBLIC void | DoCopy () |
SD_DLLPUBLIC void | DoPaste () |
void | DoDelete () |
void | StartDrag (const Point &rDragPt, vcl::Window *pWindow) |
void | DragFinished (sal_Int8 nDropAction) |
sal_Int8 | AcceptDrop (const AcceptDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) |
sal_Int8 | ExecuteDrop (const ExecuteDropEvent &rEvt, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) |
void | Abort () |
Public Member Functions inherited from sd::ViewClipboard | |
ViewClipboard (::sd::View &rView) | |
virtual | ~ViewClipboard () |
void | HandlePageDrop (const SdTransferable &rTransferable) |
Handle the drop of a drag-and-drop action where the transferable contains a set of pages. More... | |
Static Public Member Functions | |
static std::shared_ptr< SdTransferable::UserData > | CreateTransferableUserData (SdTransferable *pTransferable) |
Create a slide sorter transferable from the given sd transferable. More... | |
Private Types | |
enum | DropType { DT_PAGE , DT_PAGE_FROM_NAVIGATOR , DT_SHAPE , DT_NONE } |
Return <TRUE> when the current transferable in the current state of the slidesorter is acceptable to be pasted. More... | |
enum | DropCommand { DC_ACCEPT , DC_EXECUTE } |
This method contains the code for AcceptDrop() and ExecuteDrop() shapes. More... | |
typedef ::std::vector< SdPage * > | PageList |
Private Member Functions | |
virtual sal_uInt16 | DetermineInsertPosition () override |
Return an index of a page after which the pages of the transferable are to be inserted into the target document. More... | |
void | CreateSlideTransferable (vcl::Window *pWindow, bool bDrag) |
sal_Int32 | GetInsertionPosition () |
Determine the position of where to insert the pages in the current transferable of the sd module. More... | |
sal_Int32 | PasteTransferable (sal_Int32 nInsertPosition) |
Paste the pages of the transferable of the sd module at the given position. More... | |
void | SelectPageRange (sal_Int32 nFirstIndex, sal_Int32 nPageCount) |
Select a range of pages of the model. More... | |
DropType | IsDropAccepted () const |
sal_Int8 | ExecuteOrAcceptShapeDrop (DropCommand eCommand, const Point &rPosition, const void *pDropEvent, DropTargetHelper &rTargetHelper, ::sd::Window *pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer) |
bool | IsInsertionTrivial (SdTransferable const *pTransferable, const sal_Int8 nDndAction) const |
Return whether the insertion defined by the transferable is trivial, ie would not change either source nor target document. More... | |
DECL_DLLPRIVATE_LINK (ProcessDragFinished, void *, void) | |
Asynchronous part of DragFinished. More... | |
Private Attributes | |
SlideSorter & | mrSlideSorter |
SlideSorterController & | mrController |
PageList | maPagesToRemove |
Remember the pages that are dragged to another document or to another place in the same document so that they can be removed after a move operation. More... | |
std::unique_ptr< UndoContext > | mxUndoContext |
std::unique_ptr< SelectionObserver::Context, o3tl::default_delete< SelectionObserver::Context > > | mxSelectionObserverContext |
ImplSVEvent * | mnDragFinishedUserEventId |
Additional Inherited Members | |
Protected Member Functions inherited from sd::ViewClipboard | |
void | AssignMasterPage (const SdTransferable &rTransferable, SdPage const *pMasterPage) |
Assign the (first) master page of the given transferable to the (...) slide. More... | |
virtual sal_uInt16 | DetermineInsertPosition () |
Return an index of a page after which the pages of the transferable are to be inserted into the target document. More... | |
sal_uInt16 | InsertSlides (const SdTransferable &rTransferable, sal_uInt16 nInsertPosition) |
Insert the slides in the given transferable behind the last selected slide or, when the selection is empty, behind the last slide. More... | |
Static Protected Member Functions inherited from sd::ViewClipboard | |
static SdPage * | GetFirstMasterPage (const SdTransferable &rTransferable) |
Return the first master page of the given transferable. More... | |
Definition at line 52 of file SlsClipboard.hxx.
|
private |
Definition at line 103 of file SlsClipboard.hxx.
|
private |
This method contains the code for AcceptDrop() and ExecuteDrop() shapes.
There are only minor differences for the two cases at this level.
eCommand | This parameter specifies whether to do an AcceptDrop() or ExecuteDrop(). |
rPosition | Since the event is given as void pointer we can not take the mouse position from it. The caller has to supply it in this parameter. |
pDropEvent | Event though the AcceptDropEvent and ExecuteDropEvent are very similar they do not have a common base class. Because of that we have to use a void* to pass these structs. |
nPage | When the page number is given as 0xffff then it is replaced by the number of the page at the mouse position. If the mouse is not over a page then neither AcceptDrop() nor ExecuteDrop() are executed. |
Enumerator | |
---|---|
DC_ACCEPT | |
DC_EXECUTE |
Definition at line 183 of file SlsClipboard.hxx.
|
private |
Return <TRUE> when the current transferable in the current state of the slidesorter is acceptable to be pasted.
For this the transferable has to a) exist, b) contain one or more regular draw pages, no master pages. When master pages are involved, either in the transferable or in the slide sorter (by it displaying master pages) the drop of the transferable is not accepted. The reason is the missing implementation of proper handling master pages copy-and-paste.
Enumerator | |
---|---|
DT_PAGE | |
DT_PAGE_FROM_NAVIGATOR | |
DT_SHAPE | |
DT_NONE |
Definition at line 161 of file SlsClipboard.hxx.
sd::slidesorter::controller::Clipboard::Clipboard | ( | SlideSorter & | rSlideSorter | ) |
Definition at line 135 of file SlsClipboard.cxx.
References GetController().
|
overridevirtual |
Definition at line 143 of file SlsClipboard.cxx.
References mnDragFinishedUserEventId, and Application::RemoveUserEvent().
void sd::slidesorter::controller::Clipboard::Abort | ( | ) |
Definition at line 806 of file SlsClipboard.cxx.
References mxSelectionObserverContext.
sal_Int8 sd::slidesorter::controller::Clipboard::AcceptDrop | ( | const AcceptDropEvent & | rEvt, |
DropTargetHelper & | rTargetHelper, | ||
::sd::Window * | pTargetWindow, | ||
sal_uInt16 | nPage, | ||
SdrLayerID | nLayer | ||
) |
Definition at line 612 of file SlsClipboard.cxx.
References DC_ACCEPT, DND_ACTION_COPY, DND_ACTION_NONE, DT_NONE, DT_PAGE, DT_PAGE_FROM_NAVIGATOR, DT_SHAPE, ExecuteOrAcceptShapeDrop(), sd::ViewShell::GetCurrentFunction(), SdDrawDocument::GetDocSh(), sd::slidesorter::model::SlideSorterModel::GetDocument(), sd::slidesorter::SlideSorter::GetModel(), SdTransferable::GetPageDocShell(), sd::slidesorter::SlideSorter::GetViewShell(), IsDropAccepted(), IsInsertionTrivial(), SdTransferable::IsPageTransferable(), AcceptDropEvent::maDragEvent, AcceptDropEvent::maPosPixel, AcceptDropEvent::mnAction, sd::slidesorter::controller::SelectionFunction::MouseDragged(), mrSlideSorter, and SD_MOD.
|
private |
Definition at line 366 of file SlsClipboard.cxx.
References SdDrawDocument::AllocSdDrawDocument(), SdrCreateView::BrkAction(), sd::slidesorter::model::PageEnumerationProvider::CreateSelectedPagesEnumeration(), sd::slidesorter::controller::TransferableData::CreateTransferable(), SdDrawDocument::CreatingDataObj(), DND_ACTION_COPY, DND_ACTION_MOVE, sd::ViewShell::GetActiveWindow(), SdDrawDocument::GetDocSh(), sd::slidesorter::model::SlideSorterModel::GetDocument(), SfxObjectShell::GetMedium(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::PageEnumeration::GetNextElement(), vcl::Window::GetPointerPosPixel(), sd::slidesorter::view::SlideSorterView::GetPreviewCache(), INetURLObject::GetURLNoPass(), SfxMedium::GetURLObject(), sd::slidesorter::SlideSorter::GetView(), sd::slidesorter::SlideSorter::GetViewShell(), sd::slidesorter::model::PageEnumeration::HasMoreElements(), sd::DrawDocShell::IsNewPageNameValid(), sd::DrawDocShell::IsPageNameUnique(), maPagesToRemove, mrController, mrSlideSorter, vcl::Window::PixelToLogic(), sd::slidesorter::model::PageEnumeration::Rewind(), SD_MOD, and sd::slidesorter::model::PageDescriptor::ST_Excluded.
Referenced by DoCopy(), and StartDrag().
|
static |
Create a slide sorter transferable from the given sd transferable.
The returned transferable is set up with all information necessary so that it can be dropped on a slide sorter.
Definition at line 478 of file SlsClipboard.cxx.
References SdDrawDocument::AllocSdDrawDocument(), SdPageObjsTLV::SdPageObjsTransferable::GetDocShell(), sd::slidesorter::model::SlideSorterModel::GetDocument(), TransferableDataHelper::GetINetBookmark(), sd::slidesorter::SlideSorter::GetModel(), SdDrawDocument::GetPageByName(), sd::slidesorter::model::SlideSorterModel::GetPageDescriptor(), sd::slidesorter::view::SlideSorterView::GetPreviewCache(), sd::slidesorter::SlideSorterViewShell::GetSlideSorter(), SdTransferable::GetSourceDoc(), INetBookmark::GetURL(), sd::slidesorter::SlideSorter::GetView(), sd::ViewShell::GetView(), sd::ViewShell::GetViewShellBase(), SdPageObjsTLV::GetViewShellForDocShell(), maPagesToRemove, nIndex, SDRPAGE_NOTFOUND, SdTransferable::SetPageBookmarks(), SdTransferable::SetView(), SdTransferable::SetWorkDocument(), and sd::slidesorter::model::PageDescriptor::ST_Excluded.
Referenced by sd::slidesorter::controller::DragAndDropContext::DragAndDropContext().
|
private |
Asynchronous part of DragFinished.
The argument is the sal_Int8 nDropAction, disguised as void*.
|
overrideprivatevirtual |
Return an index of a page after which the pages of the transferable are to be inserted into the target document.
Reimplemented from sd::ViewClipboard.
Definition at line 815 of file SlsClipboard.cxx.
References sd::slidesorter::model::SlideSorterModel::GetCoreIndex(), sd::slidesorter::controller::SlideSorterController::GetInsertionIndicatorHandler(), sd::slidesorter::SlideSorter::GetModel(), mrController, and mrSlideSorter.
void sd::slidesorter::controller::Clipboard::DoCopy | ( | ) |
Definition at line 223 of file SlsClipboard.cxx.
References CreateSlideTransferable().
Referenced by sd::slidesorter::controller::SelectionFunction::DoCopy(), DoCut(), and HandleSlotCall().
void sd::slidesorter::controller::Clipboard::DoCut | ( | ) |
Definition at line 206 of file SlsClipboard.cxx.
References DoCopy(), DoDelete(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageCount(), and mrSlideSorter.
Referenced by sd::slidesorter::controller::SelectionFunction::DoCut(), and HandleSlotCall().
void sd::slidesorter::controller::Clipboard::DoDelete | ( | ) |
Definition at line 215 of file SlsClipboard.cxx.
References sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageCount(), sd::slidesorter::controller::SlideSorterController::GetSelectionManager(), mrController, and mrSlideSorter.
Referenced by DoCut(), and HandleSlotCall().
void sd::slidesorter::controller::Clipboard::DoPaste | ( | ) |
Definition at line 228 of file SlsClipboard.cxx.
References sd::slidesorter::SlideSorter::GetContentWindow(), GetInsertionPosition(), SdTransferable::IsPageTransferable(), mrSlideSorter, PasteTransferable(), SD_MOD, and SelectPageRange().
Referenced by sd::slidesorter::controller::SelectionFunction::DoPaste(), and HandleSlotCall().
void sd::slidesorter::controller::Clipboard::DragFinished | ( | sal_Int8 | nDropAction | ) |
Definition at line 574 of file SlsClipboard.cxx.
References LINK, mnDragFinishedUserEventId, and Application::PostUserEvent().
Referenced by sd::slidesorter::view::SlideSorterView::DragFinished(), and ExecuteDrop().
sal_Int8 sd::slidesorter::controller::Clipboard::ExecuteDrop | ( | const ExecuteDropEvent & | rEvt, |
DropTargetHelper & | rTargetHelper, | ||
::sd::Window * | pTargetWindow, | ||
sal_uInt16 | nPage, | ||
SdrLayerID | nLayer | ||
) |
Definition at line 680 of file SlsClipboard.cxx.
References sd::slidesorter::controller::Animator::AM_Immediate, DC_EXECUTE, DND_ACTION_MOVE, DND_ACTION_NONE, SdrModel::DoesMakePageObjectsNamesUnique(), SdrModel::DoMakePageObjectsNamesUnique(), DragFinished(), DT_NONE, DT_PAGE, DT_PAGE_FROM_NAVIGATOR, DT_SHAPE, ExecuteOrAcceptShapeDrop(), sd::slidesorter::controller::SlideSorterController::GetCurrentSelectionFunction(), sd::slidesorter::model::SlideSorterModel::GetDocument(), sd::slidesorter::controller::TransferableData::GetFromTransferable(), sd::slidesorter::controller::SlideSorterController::GetInsertionIndicatorHandler(), sd::ViewShellBase::GetMainViewShell(), sd::slidesorter::SlideSorter::GetModel(), SdTransferable::GetStartPos(), SdTransferable::GetView(), sd::slidesorter::SlideSorter::GetView(), sd::slidesorter::SlideSorter::GetViewShell(), sd::ViewShell::GetViewShellBase(), sd::ViewClipboard::HandlePageDrop(), IsDropAccepted(), IsInsertionTrivial(), ExecuteDropEvent::maPosPixel, ExecuteDropEvent::mnAction, mrController, mrSlideSorter, mxSelectionObserverContext, mxUndoContext, vcl::Window::PixelToLogic(), SD_MOD, Point::X(), and Point::Y().
|
private |
Definition at line 852 of file SlsClipboard.cxx.
References DC_ACCEPT, DC_EXECUTE, sd::ViewShellBase::GetMainViewShell(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageDescriptor(), sd::slidesorter::view::SlideSorterView::GetPageIndexAtPoint(), sd::slidesorter::SlideSorter::GetView(), sd::slidesorter::SlideSorter::GetViewShell(), sd::ViewShell::GetViewShellBase(), mrSlideSorter, SDRPAGE_NOTFOUND, sd::ViewShell::ST_DRAW, and sd::ViewShell::ST_IMPRESS.
Referenced by AcceptDrop(), and ExecuteDrop().
|
private |
Determine the position of where to insert the pages in the current transferable of the sd module.
Definition at line 248 of file SlsClipboard.cxx.
References sd::slidesorter::SlideSorter::GetContentWindow(), sd::slidesorter::controller::FocusManager::GetFocusedPageIndex(), sd::slidesorter::controller::SlideSorterController::GetFocusManager(), vcl::Window::GetFrameWeld(), sd::slidesorter::controller::SlideSorterController::GetInsertionIndicatorHandler(), sd::slidesorter::controller::SlideSorterController::GetSelectionManager(), sd::slidesorter::controller::FocusManager::IsFocusShowing(), SdInsertPasteDlg::IsInsertBefore(), mrController, mrSlideSorter, RET_OK, and weld::DialogController::run().
Referenced by DoPaste().
void sd::slidesorter::controller::Clipboard::HandleSlotCall | ( | SfxRequest & | rRequest | ) |
With the current implementation the forwarded calls to the current function will come back eventually to call the local Do(Cut|Copy|Paste) methods.
A shortcut is possible but would be an unclean hack.
Definition at line 153 of file SlsClipboard.cxx.
References DoCopy(), DoCut(), DoDelete(), SfxRequest::Done(), DoPaste(), sd::ViewShell::GetCurrentFunction(), sd::slidesorter::model::SlideSorterModel::GetEditMode(), sd::slidesorter::SlideSorter::GetModel(), SfxRequest::GetSlot(), sd::slidesorter::SlideSorter::GetViewShell(), MasterPage, and mrSlideSorter.
Referenced by sd::slidesorter::controller::SlotManager::FuSupport().
|
private |
Definition at line 830 of file SlsClipboard.cxx.
References DT_NONE, DT_PAGE, DT_PAGE_FROM_NAVIGATOR, DT_SHAPE, sd::slidesorter::model::SlideSorterModel::GetEditMode(), sd::slidesorter::SlideSorter::GetModel(), SdTransferable::IsPageTransferable(), MasterPage, mrSlideSorter, and SD_MOD.
Referenced by AcceptDrop(), and ExecuteDrop().
|
private |
Return whether the insertion defined by the transferable is trivial, ie would not change either source nor target document.
Definition at line 794 of file SlsClipboard.cxx.
References sd::slidesorter::controller::TransferableData::GetFromTransferable(), sd::slidesorter::controller::SlideSorterController::GetInsertionIndicatorHandler(), sd::slidesorter::SlideSorter::GetViewShell(), mrController, and mrSlideSorter.
Referenced by AcceptDrop(), and ExecuteDrop().
|
private |
Paste the pages of the transferable of the sd module at the given position.
nInsertPosition | The position at which to insert the pages. The valid range is [0,n] (both inclusive) with n the number of pages in the document. |
Definition at line 289 of file SlsClipboard.cxx.
References tools::SvRef< typename T >::get(), sd::slidesorter::model::SlideSorterModel::GetCoreIndex(), sd::DrawDocShell::GetDoc(), SdTransferable::GetDocShell(), sd::slidesorter::model::SlideSorterModel::GetDocument(), sd::slidesorter::SlideSorter::GetModel(), SdTransferable::GetPageBookmarks(), SdTransferable::GetPageDocShell(), SdDrawDocument::GetSdPageCount(), sd::slidesorter::controller::SlideSorterController::HandleModelChange(), SdTransferable::HasPageBookmarks(), SdTransferable::HasSourceDoc(), SdDrawDocument::InsertBookmarkAsPage(), mrController, mrSlideSorter, SD_MOD, and Standard.
Referenced by DoPaste().
|
private |
Select a range of pages of the model.
Typically usage is the selection of newly inserted pages.
nFirstIndex | The index of the first page to select. |
nPageCount | The number of pages to select. |
Definition at line 344 of file SlsClipboard.cxx.
References sd::slidesorter::controller::PageSelector::DeselectAllPages(), sd::slidesorter::controller::SlideSorterController::GetCurrentSlideManager(), sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageDescriptor(), sd::slidesorter::controller::SlideSorterController::GetPageSelector(), i, mrController, mrSlideSorter, and sd::slidesorter::controller::PageSelector::SelectPage().
Referenced by DoPaste().
void sd::slidesorter::controller::Clipboard::StartDrag | ( | const Point & | rDragPt, |
vcl::Window * | pWindow | ||
) |
|
private |
Remember the pages that are dragged to another document or to another place in the same document so that they can be removed after a move operation.
Definition at line 108 of file SlsClipboard.hxx.
Referenced by CreateSlideTransferable(), CreateTransferableUserData(), and StartDrag().
|
private |
Definition at line 117 of file SlsClipboard.hxx.
Referenced by DragFinished(), and ~Clipboard().
|
private |
Definition at line 101 of file SlsClipboard.hxx.
Referenced by CreateSlideTransferable(), DetermineInsertPosition(), DoDelete(), ExecuteDrop(), GetInsertionPosition(), IsInsertionTrivial(), PasteTransferable(), SelectPageRange(), and StartDrag().
|
private |
Definition at line 100 of file SlsClipboard.hxx.
Referenced by AcceptDrop(), CreateSlideTransferable(), DetermineInsertPosition(), DoCut(), DoDelete(), DoPaste(), ExecuteDrop(), ExecuteOrAcceptShapeDrop(), GetInsertionPosition(), HandleSlotCall(), IsDropAccepted(), IsInsertionTrivial(), PasteTransferable(), and SelectPageRange().
|
private |
Definition at line 116 of file SlsClipboard.hxx.
Referenced by Abort(), and ExecuteDrop().
|
private |
Definition at line 114 of file SlsClipboard.hxx.
Referenced by ExecuteDrop().