21#include <com/sun/star/scanner/ScannerManager.hpp>
61#include <drawview.hxx>
82class ScannerEventListener :
public ::cppu::WeakImplHelper< lang::XEventListener >
90 explicit ScannerEventListener( DrawViewShell* pParent ) :
mpParent( pParent ) {}
93 virtual void SAL_CALL disposing(
const lang::EventObject& rEventObject )
override;
95 void ParentDestroyed() {
mpParent =
nullptr; }
100void SAL_CALL ScannerEventListener::disposing(
const lang::EventObject& )
107 :
ViewShell (pParentWindow, rViewShellBase)
109 , mbIsLayerModeActive(false)
110 , mbIsInSwitchPage(false)
113 uno::Reference<frame::XController>(rViewShellBase.GetDrawController()),
115 , mbMouseButtonDown(
false)
116 , mbMouseSelecting(
false)
118 if (pFrameViewArgument !=
nullptr)
119 mpFrameView = pFrameViewArgument;
122 Construct(GetDocSh(), ePageKind);
124 mpSelectionChangeHandler->Connect();
126 SetContextName(GetSidebarContextName());
130 ConfigureAppBackgroundColor();
131 SD_MOD()->GetColorConfig().AddListener(
this);
142 SD_MOD()->GetColorConfig().RemoveListener(
this);
152 static_cast< ScannerEventListener*
>(
mxScannerListener.get() )->ParentDestroyed();
156 sal_uInt16
nId = Svx3DChildWindow::GetChildWindowId();
175 for (sal_uInt16
i = 0;
i < aPageCnt;
i++)
256 if ( pDocSh->
GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
310 SfxRequest aReq(SID_OBJECT_SELECT, SfxCallMode::SLOT,
GetDoc()->GetItemPool());
314 if (pDocSh->
GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
329 uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
369 css::uno::Reference<css::drawing::XDrawSubController> xSubController;
377 return xSubController;
411 OSL_FAIL(
"DrawViewShell::CheckLineTo: slots SID_LINETO, SID_BEZIERTO, SID_MOVETO no longer supported.");
434 for (
i = 0;
i < nPageCnt;
i++)
467 for (
i = 0;
i < nPageCnt;
i++)
507 Point aPageOrg(nWidth, nHeight / 2);
508 Size aSize( nWidth * 3, nHeight * 2);
514 if (
GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
530 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
547 std::unique_ptr<SvxZoomItem> pZoomItem;
551 pZoomItem.reset(
new SvxZoomItem( SvxZoomType::WHOLEPAGE, nZoom ));
553 pZoomItem.reset(
new SvxZoomItem( SvxZoomType::PERCENT, nZoom ));
564 pZoomItem->SetValueSet( nZoomValues );
565 rSet.
Put( std::move(pZoomItem) );
583 Point aPagePos(0, 0);
663 sal_Int32 nActivePageCount = sal_Int32(
GetDoc()->GetActiveSdPageCount());
667 aOUString = (nPageCount == nActivePageCount) ?
SdResId(STR_SD_PAGE_COUNT_DRAW) :
SdResId(STR_SD_PAGE_COUNT_CUSTOM_DRAW);
669 aOUString = (nPageCount == nActivePageCount) ?
SdResId(STR_SD_PAGE_COUNT) :
SdResId(STR_SD_PAGE_COUNT_CUSTOM);
671 aOUString = aOUString.replaceFirst(
"%1", OUString::number(
maTabControl->GetCurPagePos() + 1));
672 aOUString = aOUString.replaceFirst(
"%2", OUString::number(nPageCount));
673 if(nPageCount != nActivePageCount)
674 aOUString = aOUString.replaceFirst(
"%3", OUString::number(nActivePageCount));
686 bool bOneLayer =
true;
691 for(
size_t j = 0; j < nMarkCount && bOneLayer && j < 10; ++j )
698 if( j != 0 && nLayer != nOldLayer )
706 if( bOneLayer && nMarkCount )
724 aString = aString.copy(0,
nPos);
731 OUString aString = OUString::number(aUIScale.
GetNumerator()) +
739 if (rHint.
GetId()!=SfxHintId::ModeChanged)
745 SfxRequest aReq(SID_OBJECT_SELECT, SfxCallMode::SLOT,
GetDoc()->GetItemPool());
756 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem });
791 return EnumContext::GetContextName(
806 sal_uInt16 nSdPage = (pPage->
GetPageNum() - 1) / 2;
808 if (nSdPage + 1 >= totalPages)
821 sal_uInt16 nSdPage = (pPage->
GetPageNum() - 1) / 2;
836 sal_uInt16 nSdPage = (pPage->
GetPageNum() - 1) / 2;
850 sal_uInt16 nSdPage = (pPage->
GetPageNum() - 1) / 2;
852 if (nSdPage + 1 >= totalPages)
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void CreateFirstPages(SdDrawDocument const *pRefDocument=nullptr)
if the document does not contain at least one handout, one slide and one notes page with at least one...
sal_uInt16 GetMasterSdPageCount(PageKind ePgKind) const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
void StopWorkStartupDelay()
SdPage * GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind)
SAL_DLLPRIVATE void SetSelected(SdPage *pPage, bool bSelect)
SAL_DLLPRIVATE DocumentType GetDocumentType() const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
PageKind GetPageKind() const
void CreateTitleAndLayout(bool bInit=false, bool bCreate=false)
virtual void SetUpperBorder(sal_Int32 nBorder) override
void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false)
void ScaleObjects(const Size &rNewPageSize, const ::tools::Rectangle &rNewBorderRect, bool bScaleAllObj)
virtual OUString GetLayoutName() const override
virtual void SetRightBorder(sal_Int32 nBorder) override
virtual void SetLowerBorder(sal_Int32 nBorder) override
virtual void SetLeftBorder(sal_Int32 nBorder) override
AutoLayout GetAutoLayout() const
virtual void SetSize(const Size &aSize) override
void SetWorkArea(const tools::Rectangle &rRect)
SdrLayer * GetLayerPerID(SdrLayerID nID)
const OUString & GetName() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
SdrObject * GetMarkedSdrObj() const
void SetMaxObjSize(const Size &rSiz)
const Fraction & GetUIScale() const
const SdrLayerAdmin & GetLayerAdmin() const
size_t GetObjCount() const
virtual SdrLayerID GetLayer() const
SdrObjList * GetObjList() const
void SetPageOrigin(const Point &rOrg)
void LogicToPagePos(Point &rPnt) const
SdrPage * GetPage() const
sal_uInt16 GetPageNum() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetLeftBorder() const
SdrPageView * GetSdrPageView() const
void SetAnimationMode(const SdrAnimationMode eMode)
void Invalidate(sal_uInt16 nId)
vcl::Window * GetWindow() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
bool IsListening(SfxBroadcaster &rBroadcaster) const
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
SfxObjectCreateMode GetCreateMode() const
sal_uInt16 GetSlot() const
SfxItemPool & GetPool() const
SfxViewShell * GetViewShell() const
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void AddSnappingPoint(sal_Int32 nNew)
virtual ::tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
static void CheckLineTo(SfxRequest &rReq)
check if we have to draw a polyline
void GetStatusBarState(SfxItemSet &rSet)
void SetupPage(Size const &rSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bSize, bool bMargin, bool bScaleAll)
Change page parameter if SID_PAGESIZE or SID_PAGEMARGIN.
void FuPermanent(SfxRequest &rReq)
virtual void Shutdown() override
This method is more or less an alias to Deactivate().
css::uno::Reference< css::scanner::XScannerManager2 > mxScannerManager
std::unique_ptr< DrawView > mpDrawView
void GetStateGoToLastPage(SfxItemSet &rSet)
bool IsLayerModeActive() const
rtl::Reference< TransferableClipboardListener > mxClipEvtLstnr
void StopSlideShow()
Stop a running slide show.
css::uno::Reference< css::lang::XEventListener > mxScannerListener
virtual bool RelocateToParentWindow(vcl::Window *pParentWindow) override
Relocation to a new parent window is not supported for DrawViewShell objects so this method always re...
virtual ~DrawViewShell() override
::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager
void ExecuteAnnotation(SfxRequest const &rRequest)
DrawViewShell(ViewShellBase &rViewShellBase, vcl::Window *pParentWindow, PageKind ePageKind, FrameView *pFrameView)
Create a new stackable shell that may take some information (e.g.
void GetStateGoToPreviousPage(SfxItemSet &rSet)
void Construct(DrawDocShell *pDocSh, PageKind ePageKind)
common part of both constructors
VclPtr< TabControl > maTabControl
void ExecGoToFirstPage(SfxRequest &rReq)
void ExecGoToPreviousPage(SfxRequest &rReq)
void ExecGoToNextPage(SfxRequest &rReq)
virtual void Init(bool bIsMainViewShell) override
The Init method has to be called from the outside directly after a new object of this class has been ...
bool mbIsLayerModeActive
This flag controls whether the layer mode is active, i.e.
void GetAnnotationState(SfxItemSet &rItemSet)
virtual SdPage * GetActualPage() override
OUString const & GetSidebarContextName() const
DrawView * GetDrawView() const
void ExecGoToLastPage(SfxRequest &rReq)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
::std::unique_ptr< AnnotationManager > mpAnnotationManager
void GetStateGoToNextPage(SfxItemSet &rSet)
virtual void ReadFrameViewData(FrameView *pView) override
Apply data of the FrameView on the current view.
virtual css::uno::Reference< css::drawing::XDrawSubController > CreateSubController() override
Return a sub controller that implements the view shell specific part of the DrawController.
void GetStateGoToFirstPage(SfxItemSet &rSet)
::rtl::Reference< svx::sidebar::SelectionChangeHandler > mpSelectionChangeHandler
Listen for selection changes and broadcast context changes for the sidebar.
Derivative of sd::View; contains also a pointer to the document.
EditMode GetViewShEditMode() const
Return EditMode (Page or MasterPage) of working mode.
void SetPageKind(PageKind eKind)
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
static OUString convertToLocalizedName(const OUString &rName)
This class implements the DrawViewShell specific part of the controller.
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
Base class of the stacked shell hierarchy.
SD_DLLPUBLIC DrawDocShell * GetDocSh() const
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
const rtl::Reference< FuPoor > & GetCurrentFunction() const
SdDrawDocument * GetDoc() const
virtual void Shutdown()
This method is more or less an alias to Deactivate().
virtual void UpdateScrollBars()
Set internal values of all scroll bars that determine thumb size and position.
void DisposeFunctions()
must be called in the beginning of each subclass d'tor.
ShellType meShellType
The type of the shell. Returned by GetShellType().
virtual void Init(bool bIsMainViewShell)
The Init method has to be called from the outside directly after a new object of this class has been ...
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
vcl::Window * GetParentWindow() const
Return the window that is the parent of all controls of this view shell.
void InitWindows(const Point &rViewOrigin, const Size &rViewSize, const Point &rWinPos, bool bUpdate=false)
Initialize imaging parameters for all split windows.
void SetCurrentFunction(const rtl::Reference< FuPoor > &xFunction)
void Cancel()
this method deactivates the current function.
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
An SdWindow contains the actual working area of ViewShell.
::tools::Long GetMaxZoom() const
::tools::Long GetMinZoom() const
::tools::Long GetZoomForRect(const ::tools::Rectangle &rZoomRect)
::tools::Long GetZoom() const
Point PixelToLogic(const Point &rDevicePt) const
void SetHelpId(const OUString &)
#define suppress_fun_call_w_exception(expr)
#define DBG_UNHANDLED_EXCEPTION(...)
RegionData_Impl * mpParent
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
constexpr OUStringLiteral SD_LT_SEPARATOR
constexpr OUStringLiteral HID_SDDRAWVIEWSHELL
constexpr OUStringLiteral HID_SDGRAPHICVIEWSHELL
#define LINK(Instance, Class, Member)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
constexpr OUStringLiteral CMD_SID_HANDOUT_MASTER_MODE
constexpr OUStringLiteral CMD_SID_NOTES_MODE
OUString SdResId(TranslateId aId)