27#include <unomodel.hxx>
38#include <com/sun/star/drawing/DrawViewMode.hpp>
39#include <com/sun/star/drawing/ShapeCollection.hpp>
40#include <com/sun/star/drawing/XLayerManager.hpp>
41#include <com/sun/star/view/DocumentZoomType.hpp>
54 : mrDrawViewShell(rViewShell),
72 mrDrawViewShell.ChangeEditMode (
74 mrDrawViewShell.IsLayerModeActive());
85 if (mrDrawViewShell.IsLayerModeActive() != bLayerMode)
87 mrDrawViewShell.ChangeEditMode (
88 mrDrawViewShell.GetEditMode(),
95 Reference<drawing::XLayer> xCurrentLayer;
101 if (pModel ==
nullptr)
105 if (pSdModel ==
nullptr)
111 if (pLayer ==
nullptr)
116 Reference<drawing::XLayerManager> xManager (pModel->
getLayerManager(), uno::UNO_QUERY);
118 if (pManager !=
nullptr)
119 xCurrentLayer = pManager->
GetLayer (pLayer);
123 return xCurrentLayer;
133 if (pLayer ==
nullptr)
137 if (pSdrLayer ==
nullptr)
151 ::std::vector<SdrObject*> aObjects;
155 Reference< drawing::XShape > xShape;
156 aSelection >>= xShape;
164 aObjects.push_back( pObj );
173 Reference< drawing::XShapes > xShapes;
174 aSelection >>= xShapes;
177 const sal_uInt32
nCount = xShapes->getCount();
180 xShapes->getByIndex(
i) >>= xShape;
190 if( pSdrPage ==
nullptr )
200 aObjects.push_back( pObj );
243 if( !aAny.hasValue() )
249 Reference< drawing::XShapes > xShapes = drawing::ShapeCollection::create(
251 for(
size_t nNum = 0; nNum <
nCount; ++nNum)
266 SvxDrawPage* pDrawPage = comphelper::getFromUnoTunnel<SvxDrawPage>( xPage );
268 if(pDrawPage==
nullptr)
271 Reference< drawing::XShape > xShape( pObj->
getUnoShape(), UNO_QUERY );
274 xShapes->add(xShape);
284 const css::uno::Reference<css::view::XSelectionChangeListener>&)
288 const css::uno::Reference<css::view::XSelectionChangeListener>&)
299 Reference< drawing::XDrawPage > xPage;
322 Reference<drawing::XLayer> xLayer;
379 aValue <<= sal_Int16(css::view::DocumentZoomType::BY_VALUE);
399 const Reference< drawing::XDrawPage >& xPage )
401 SvxDrawPage* pDrawPage = comphelper::getFromUnoTunnel<SvxDrawPage>( xPage );
418 Reference< drawing::XDrawPage > xPage;
443 SvxZoomItem aZoomItem( SvxZoomType::PERCENT, nZoom );
451 pDispatcher->
ExecuteList(SID_ATTR_ZOOM, SfxCallMode::SYNCHRON,
459 Point aWinPos( rWinPos.X, rWinPos.Y );
469 return awt::Point( aRet.
X(), aRet.
Y() );
485 case css::view::DocumentZoomType::OPTIMAL:
486 eZoomType = SvxZoomType::OPTIMAL;
489 case css::view::DocumentZoomType::PAGE_WIDTH:
490 case css::view::DocumentZoomType::PAGE_WIDTH_EXACT:
491 eZoomType = SvxZoomType::PAGEWIDTH;
494 case css::view::DocumentZoomType::ENTIRE_PAGE:
495 eZoomType = SvxZoomType::WHOLEPAGE;
502 pDispatcher->
ExecuteList(SID_ATTR_ZOOM, SfxCallMode::SYNCHRON,
511 return comphelper::getFromUnoTunnel<SdXImpressDocument>(
xModel);
532 return "com.sun.star.comp.sd.SdUnoDrawView" ;
542 return {
"com.sun.star.drawing.DrawingDocumentDrawView" };
constexpr tools::Long Y() const
constexpr tools::Long X() const
css::uno::Reference< css::drawing::XLayer > GetLayer(SdrLayer *pLayer)
Return the <type>XLayer</type> object that is associated with the given <type>SdrLayer</type> object.
SdrLayer * GetSdrLayer() const noexcept
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getLayerManager() override
SdDrawDocument * GetDoc() const
SdrLayer * GetLayer(sal_uInt16 i)
const OUString & GetName() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
const SdrLayerAdmin & GetLayerAdmin() const
void getTextSelection(css::uno::Any &rSelection)
virtual bool IsTextEdit() const final override
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
SdrPage * getSdrPageFromSdrObject() const
SdrPage * GetPage() const
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
void SetActiveLayer(const OUString &rName)
SdrPageView * GetSdrPageView() const
const OUString & GetActiveLayer() const
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 * >())
css::uno::Reference< css::frame::XModel3 > GetModel() const
SfxDispatcher * GetDispatcher()
SdrPage * GetSdrPage() const
@ PROPERTY_MASTERPAGEMODE
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
EditMode GetEditMode() const
bool IsLayerModeActive() const
virtual void WriteFrameViewData() override
Apply data of the current view on the FrameView.
bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus=true)
Switch to desired page.
PageKind GetPageKind() const
void ResetActualLayer()
Select new refreshed page, in case of a page order change (eg.
DrawViewShell & mrDrawViewShell
css::uno::Any getDrawViewMode() const
virtual sal_Bool SAL_CALL select(const css::uno::Any &aSelection) override
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &rxListener) override
SdXImpressDocument * GetModel() const noexcept
virtual ~SdUnoDrawView() noexcept override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void SetZoom(sal_Int16 nZoom)
sal_Int16 GetZoom() const
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override
bool getLayerMode() const noexcept
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getCurrentPage() override
void setLayerMode(bool LayerMode_) noexcept
virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const css::uno::Any &rValue) override
void SetViewOffset(const css::awt::Point &rWinPos)
void setMasterPageMode(bool MasterPageMode_) noexcept
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Any SAL_CALL getSelection() override
void SetZoomType(sal_Int16 nType)
SdUnoDrawView(DrawViewShell &rViewShell, View &rView) noexcept
css::awt::Point GetViewOffset() const
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &rxListener) override
virtual void SAL_CALL setCurrentPage(const css::uno::Reference< css::drawing::XDrawPage > &xPage) override
css::uno::Reference< css::drawing::XLayer > getActiveLayer() const
Return a reference to the active layer object.
void setActiveLayer(const css::uno::Reference< css::drawing::XLayer > &rxLayer)
Make the specified object the active layer.
bool getMasterPageMode() const noexcept
Point const & GetViewOrigin() const
void SetWinViewPos(const Point &rWinPos)
::sd::Window * GetActiveWindow() const
The active window is usually the mpContentWindow.
::sd::View * GetView() const
Point const & GetWinViewPos() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
DrawDocShell * GetDocSh() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
::tools::Long GetZoom() const
Reference< XComponentContext > getProcessComponentContext()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Reference< XModel > xModel