LibreOffice Module sd (master) 1
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
sd::ViewClipboard Class Reference

Handle clipboard related tasks for the draw view. More...

#include <ViewClipboard.hxx>

Inheritance diagram for sd::ViewClipboard:
[legend]
Collaboration diagram for sd::ViewClipboard:
[legend]

Public Member Functions

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

Protected Member Functions

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

static SdPageGetFirstMasterPage (const SdTransferable &rTransferable)
 Return the first master page of the given transferable. More...
 

Private Attributes

::sd::ViewmrView
 

Detailed Description

Handle clipboard related tasks for the draw view.

Definition at line 33 of file ViewClipboard.hxx.

Constructor & Destructor Documentation

◆ ViewClipboard()

sd::ViewClipboard::ViewClipboard ( ::sd::View rView)

Definition at line 39 of file ViewClipboard.cxx.

◆ ~ViewClipboard()

sd::ViewClipboard::~ViewClipboard ( )
virtual

Definition at line 44 of file ViewClipboard.cxx.

Member Function Documentation

◆ AssignMasterPage()

void sd::ViewClipboard::AssignMasterPage ( const SdTransferable rTransferable,
SdPage const *  pMasterPage 
)
protected

◆ DetermineInsertPosition()

sal_uInt16 sd::ViewClipboard::DetermineInsertPosition ( )
protectedvirtual

Return an index of a page after which the pages of the transferable are to be inserted into the target document.

Reimplemented in sd::slidesorter::controller::Clipboard.

Definition at line 160 of file ViewClipboard.cxx.

References sd::View::GetDoc(), SdDrawDocument::GetSdPage(), SdDrawDocument::GetSdPageCount(), SdPage::IsSelected(), mrView, and Standard.

Referenced by HandlePageDrop().

◆ GetFirstMasterPage()

SdPage * sd::ViewClipboard::GetFirstMasterPage ( const SdTransferable rTransferable)
staticprotected

Return the first master page of the given transferable.

When the bookmark list of the transferable contains at least one non-master page then NULL is returned.

Definition at line 62 of file ViewClipboard.cxx.

References sd::DrawDocShell::GetDoc(), SdrModel::GetMasterPage(), SdTransferable::GetPageBookmarks(), SdDrawDocument::GetPageByName(), SdTransferable::GetPageDocShell(), SdTransferable::HasPageBookmarks(), SDRPAGE_NOTFOUND, and sName.

Referenced by HandlePageDrop().

◆ HandlePageDrop()

void sd::ViewClipboard::HandlePageDrop ( const SdTransferable rTransferable)

Handle the drop of a drag-and-drop action where the transferable contains a set of pages.

Definition at line 48 of file ViewClipboard.cxx.

References AssignMasterPage(), DetermineInsertPosition(), sd::DrawViewShell::GetEditMode(), GetFirstMasterPage(), sd::View::GetViewShell(), InsertSlides(), mrView, and Page.

Referenced by sd::slidesorter::controller::Clipboard::ExecuteDrop().

◆ InsertSlides()

sal_uInt16 sd::ViewClipboard::InsertSlides ( const SdTransferable rTransferable,
sal_uInt16  nInsertPosition 
)
protected

Insert the slides in the given transferable behind the last selected slide or, when the selection is empty, behind the last slide.

Parameters
rTransferableThis transferable defines which pages to insert.
nInsertPositionThe pages of the transferable will be inserted behind the page with this index.
Returns
Returns the number of inserted slides.

Definition at line 179 of file ViewClipboard.cxx.

References vcl::Window::EnterWait(), tools::SvRef< typename T >::get(), sd::ViewShell::GetActiveWindow(), sd::DrawDocShell::GetDoc(), sd::View::GetDoc(), SdTransferable::GetDocShell(), SdTransferable::GetPageBookmarks(), SdTransferable::GetPageDocShell(), SdDrawDocument::GetSdPageCount(), sd::View::GetViewShell(), SdTransferable::HasPageBookmarks(), SdTransferable::HasSourceDoc(), SdDrawDocument::InsertBookmarkAsPage(), vcl::Window::IsWait(), vcl::Window::LeaveWait(), mrView, SD_MOD, and Standard.

Referenced by HandlePageDrop().

Member Data Documentation

◆ mrView

::sd::View& sd::ViewClipboard::mrView
private

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