20#include <com/sun/star/lang/DisposedException.hpp>
21#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
27#include <osl/diagnose.h>
38#include <unomodel.hxx>
39#include <unoprnms.hxx>
40#include <com/sun/star/lang/NoSupportException.hpp>
55#define WID_LAYER_LOCKED 1
56#define WID_LAYER_PRINTABLE 2
57#define WID_LAYER_VISIBLE 3
58#define WID_LAYER_NAME 4
59#define WID_LAYER_TITLE 5
60#define WID_LAYER_DESC 6
74 return &aSDLayerPropertySet_Impl;
78: mxLayerManager(pLayerManager_)
104 return {
"com.sun.star.drawing.Layer" };
119 throw lang::DisposedException();
123 switch( pEntry ? pEntry->
nWID : -1 )
146 if(!(aValue >>=
aName))
147 throw lang::IllegalArgumentException();
157 if(!(aValue >>= sTitle))
158 throw lang::IllegalArgumentException();
166 OUString sDescription;
167 if(!(aValue >>= sDescription))
168 throw lang::IllegalArgumentException();
175 throw beans::UnknownPropertyException( aPropertyName,
static_cast<cppu::OWeakObject*
>(
this));
187 throw lang::DisposedException();
193 switch( pEntry ? pEntry->
nWID : -1 )
217 throw beans::UnknownPropertyException( PropertyName,
static_cast<cppu::OWeakObject*
>(
this));
230 if(pLayer && mxLayerManager.is())
233 ::sd::View *pView = mxLayerManager->GetView();
240 OUString aLayerName = pLayer->GetName();
250 if(mxLayerManager->GetDocShell())
252 ::sd::FrameView *pFrameView = mxLayerManager->GetDocShell()->GetFrameView();
267 case LOCKED:
return false;
276 if(!(pLayer && mxLayerManager.is()))
280 ::sd::View *pView = mxLayerManager->GetView();
287 OUString aLayerName(pLayer->GetName());
300 if(!mxLayerManager->GetDocShell())
303 ::sd::FrameView *pFrameView = mxLayerManager->GetDocShell()->GetFrameView();
319 aNewLayers.
Set(pLayer->GetID(),flag);
340 throw lang::DisposedException();
347 throw lang::NoSupportException ();
359 OSL_FAIL(
"not implemented!");
364 OSL_FAIL(
"not implemented!");
392 OSL_FAIL(
"not implemented!");
397 OSL_FAIL(
"not implemented!");
403 return "SdUnoLayerManager";
413 return {
"com.sun.star.drawing.LayerManager"};
422 throw lang::DisposedException();
424 uno::Reference< drawing::XLayer > xLayer;
430 sal_Int32 nLayer = nLayerCnt - 2 + 1;
434 while( aLayerName.isEmpty() || rLayerAdmin.
GetLayer( aLayerName ) )
436 aLayerName =
SdResId(STR_LAYER) + OUString::number(nLayer);
454 throw lang::DisposedException();
474 throw lang::DisposedException();
477 if(pSdLayer==
nullptr)
480 if(pSdrLayer==
nullptr)
496 throw lang::DisposedException();
498 uno::Reference< drawing::XLayer > xLayer;
519 throw lang::DisposedException();
535 throw lang::DisposedException();
537 if( nLayer >=
getCount() || nLayer < 0 )
538 throw lang::IndexOutOfBoundsException();
545 uno::Reference<drawing::XLayer> xLayer (
GetLayer (rLayerAdmin.
GetLayer(
static_cast<sal_uInt16
>(nLayer))));
557 throw lang::DisposedException();
561 if( pLayer ==
nullptr )
562 throw container::NoSuchElementException();
572 throw lang::DisposedException();
577 uno::Sequence< OUString >
aSeq( nLayerCount );
579 OUString* pStrings =
aSeq.getArray();
581 for( sal_uInt16 nLayer = 0; nLayer < nLayerCount; nLayer++ )
585 *pStrings++ = pLayer->
GetName();
596 throw lang::DisposedException();
659bool compare_layers (
const uno::WeakReference<uno::XInterface>& xRef,
void const * pSearchData)
661 uno::Reference<uno::XInterface> xLayer (xRef);
665 if (pSdLayer !=
nullptr)
668 if (pSdrLayer ==
static_cast<SdrLayer const *
>(pSearchData))
682 uno::WeakReference<uno::XInterface> xRef;
683 uno::Reference<drawing::XLayer> xLayer;
686 if (
mpLayers->findRef (xRef,
static_cast<void*
>(pLayer), compare_layers))
687 xLayer.set(xRef, uno::UNO_QUERY);
692 xLayer =
new SdLayer (
this, pLayer);
695 uno::WeakReference<uno::XInterface> wRef(xLayer);
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
SdXImpressDocument * mpModel
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
SdLayerManager(SdXImpressDocument &rMyModel) noexcept
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XLayer > &xLayer) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL hasElements() override
std::unique_ptr< SvUnoWeakContainer > mpLayers
virtual css::uno::Reference< css::drawing::XLayer > SAL_CALL getLayerForShape(const css::uno::Reference< css::drawing::XShape > &xShape) override
virtual css::uno::Reference< css::drawing::XLayer > SAL_CALL insertNewByIndex(sal_Int32 nIndex) override
virtual void SAL_CALL dispose() override
virtual void SAL_CALL attachShapeToLayer(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::drawing::XLayer > &xLayer) override
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.
virtual ~SdLayerManager() noexcept override
void UpdateLayerView() const noexcept
If something was changed at the layers, this methods takes care that the changes are made visible in ...
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual css::uno::Type SAL_CALL getElementType() override
::sd::View * GetView() const noexcept
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual sal_Int32 SAL_CALL getCount() override
bool get(LayerAttribute what) noexcept
rtl::Reference< SdLayerManager > mxLayerManager
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Not implemented.
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual OUString SAL_CALL getImplementationName() override
void set(LayerAttribute what, bool flag) noexcept
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Returns the layer manager that manages this layer.
virtual void SAL_CALL dispose() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
SdrLayer * GetSdrLayer() const noexcept
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual ~SdLayer() noexcept override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
const SvxItemPropertySet * pPropSet
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
SdLayer(SdLayerManager *pLayerManager_, SdrLayer *pSdrLayer_)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
::sd::DrawDocShell * mpDocShell
void SetModified() noexcept
void DeleteLayer(const OUString &rName)
SdrLayer * NewLayer(const OUString &rName, sal_uInt16 nPos=0xFFFF)
sal_uInt16 GetLayerCount() const
SdrLayer * GetLayerPerID(SdrLayerID nID)
SdrLayer * GetLayer(sal_uInt16 i)
bool IsSet(SdrLayerID a) const
const OUString & GetTitle() const
void SetPrintableODF(bool bPrintableODF)
const OUString & GetName() const
void SetVisibleODF(bool bVisibleODF)
const OUString & GetDescription() const
void SetDescription(const OUString &rDesc)
void SetTitle(const OUString &rTitle)
void SetName(const OUString &rNewName)
void SetLockedODF(bool bLockedODF)
const SdrLayerAdmin & GetLayerAdmin() const
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
static SdrItemPool & GetGlobalDrawObjectItemPool()
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
bool IsLayerVisible(const OUString &rName) const
void SetLayerVisible(const OUString &rName, bool bShow)
void SetLayerLocked(const OUString &rName, bool bLock)
void SetLayerPrintable(const OUString &rName, bool bPrn)
bool IsLayerLocked(const OUString &rName) const
bool IsLayerPrintable(const OUString &rName) const
SdrPageView * GetSdrPageView() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
const SfxItemPropertyMapEntry * getPropertyMapEntry(std::u16string_view rName) const
css::uno::Type const & get()
sd::ViewShell * GetViewShell()
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 ChangeEditMode(EditMode eMode, bool bIsLayerModeActive)
Set status (enabled/disabled) of menu SfxSlots.
void SetLockedLayers(const SdrLayerIDSet &rLockedLayers)
void SetPrintableLayers(const SdrLayerIDSet &rPrintableLayers)
const SdrLayerIDSet & GetLockedLayers() const
const SdrLayerIDSet & GetVisibleLayers() const
void SetVisibleLayers(const SdrLayerIDSet &rVisibleLayers)
const SdrLayerIDSet & GetPrintableLayers() const
Base class of the stacked shell hierarchy.
::sd::View * GetView() const
Sequence< sal_Int8 > aSeq
bool any2bool(const css::uno::Any &rAny)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
OUString SdResId(TranslateId aId)
#define WID_LAYER_VISIBLE
#define WID_LAYER_PRINTABLE
static const SvxItemPropertySet * ImplGetSdLayerPropertySet()
#define UNO_NAME_LAYER_PRINTABLE
#define UNO_NAME_LAYER_LOCKED
#define UNO_NAME_LAYER_VISIBLE
#define UNO_NAME_LAYER_NAME