LibreOffice Module sd (master) 1
unolayer.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <com/sun/star/lang/DisposedException.hpp>
21#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
22
23#include "unolayer.hxx"
24
26#include <editeng/unoipset.hxx>
27#include <osl/diagnose.h>
28#include <svl/itemprop.hxx>
29#include <svx/svdpagv.hxx>
30#include <svx/svdobj.hxx>
32
33// following ones for InsertSdPage()
34#include <svx/svdlayer.hxx>
35
36#include <DrawDocShell.hxx>
37#include <drawdoc.hxx>
38#include <unomodel.hxx>
39#include <unoprnms.hxx>
40#include <com/sun/star/lang/NoSupportException.hpp>
41#include <svx/svdpool.hxx>
42#include <FrameView.hxx>
43#include <DrawViewShell.hxx>
44#include <View.hxx>
45#include <ViewShell.hxx>
46#include <strings.hrc>
47#include <sdresid.hxx>
48
49#include "unowcntr.hxx"
50#include <vcl/svapp.hxx>
51
52using namespace ::com::sun::star;
53
54// class SdLayer
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
61
63{
64 static const SfxItemPropertyMapEntry aSdLayerPropertyMap_Impl[] =
65 {
71 { u"Description", WID_LAYER_DESC, ::cppu::UnoType<OUString>::get(), 0, 0 },
72 };
73 static SvxItemPropertySet aSDLayerPropertySet_Impl( aSdLayerPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() );
74 return &aSDLayerPropertySet_Impl;
75}
76
77SdLayer::SdLayer(SdLayerManager* pLayerManager_, SdrLayer* pSdrLayer_)
78: mxLayerManager(pLayerManager_)
79, pLayer(pSdrLayer_)
80, pPropSet(ImplGetSdLayerPropertySet())
81{
82 // no defaults possible yet, a "set" would overwrite existing information
83 // in view, which is currently needed for saving, because pLayer is not updated
84 // from view.
85}
86
88{
89}
90
91// XServiceInfo
93{
94 return "SdUnoLayer";
95}
96
97sal_Bool SAL_CALL SdLayer::supportsService( const OUString& ServiceName )
98{
99 return cppu::supportsService( this, ServiceName );
100}
101
102uno::Sequence< OUString > SAL_CALL SdLayer::getSupportedServiceNames()
103{
104 return { "com.sun.star.drawing.Layer" };
105}
106
107// beans::XPropertySet
108uno::Reference< beans::XPropertySetInfo > SAL_CALL SdLayer::getPropertySetInfo( )
109{
110 SolarMutexGuard aGuard;
112}
113
114void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
115{
116 SolarMutexGuard aGuard;
117
118 if(pLayer == nullptr || mxLayerManager == nullptr)
119 throw lang::DisposedException();
120
121 const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMapEntry(aPropertyName);
122
123 switch( pEntry ? pEntry->nWID : -1 )
124 {
125 case WID_LAYER_LOCKED:
126 {
128 set(LOCKED, cppu::any2bool(aValue)); // changes the View, if any exists
129 break;
130 }
132 {
134 set(PRINTABLE, cppu::any2bool(aValue)); // changes the View, if any exists
135 break;
136 }
138 {
140 set(VISIBLE, cppu::any2bool(aValue)); // changes the View, if any exists
141 break;
142 }
143 case WID_LAYER_NAME:
144 {
145 OUString aName;
146 if(!(aValue >>= aName))
147 throw lang::IllegalArgumentException();
148
150 mxLayerManager->UpdateLayerView();
151 break;
152 }
153
154 case WID_LAYER_TITLE:
155 {
156 OUString sTitle;
157 if(!(aValue >>= sTitle))
158 throw lang::IllegalArgumentException();
159
160 pLayer->SetTitle(sTitle);
161 break;
162 }
163
164 case WID_LAYER_DESC:
165 {
166 OUString sDescription;
167 if(!(aValue >>= sDescription))
168 throw lang::IllegalArgumentException();
169
170 pLayer->SetDescription(sDescription);
171 break;
172 }
173
174 default:
175 throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this));
176 }
177
178 if( mxLayerManager->GetDocShell() )
179 mxLayerManager->GetDocShell()->SetModified();
180}
181
182uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName )
183{
184 SolarMutexGuard aGuard;
185
186 if(pLayer == nullptr || mxLayerManager == nullptr)
187 throw lang::DisposedException();
188
189 const SfxItemPropertyMapEntry* pEntry = pPropSet->getPropertyMapEntry(PropertyName);
190
191 uno::Any aValue;
192
193 switch( pEntry ? pEntry->nWID : -1 )
194 {
195 case WID_LAYER_LOCKED:
196 aValue <<= get( LOCKED );
197 break;
199 aValue <<= get( PRINTABLE );
200 break;
202 aValue <<= get( VISIBLE );
203 break;
204 case WID_LAYER_NAME:
205 {
206 OUString aRet(pLayer->GetName());
207 aValue <<= aRet;
208 break;
209 }
210 case WID_LAYER_TITLE:
211 aValue <<= pLayer->GetTitle();
212 break;
213 case WID_LAYER_DESC:
214 aValue <<= pLayer->GetDescription();
215 break;
216 default:
217 throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this));
218 }
219
220 return aValue;
221}
222
223void SAL_CALL SdLayer::addPropertyChangeListener( const OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) {}
224void SAL_CALL SdLayer::removePropertyChangeListener( const OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) {}
225void SAL_CALL SdLayer::addVetoableChangeListener( const OUString& , const uno::Reference< beans::XVetoableChangeListener >& ) {}
226void SAL_CALL SdLayer::removeVetoableChangeListener( const OUString& , const uno::Reference< beans::XVetoableChangeListener >& ) {}
227
228bool SdLayer::get( LayerAttribute what ) noexcept
229{
230 if(pLayer && mxLayerManager.is())
231 {
232 // Try 1. is an arbitrary page open?
233 ::sd::View *pView = mxLayerManager->GetView();
234 SdrPageView* pSdrPageView = nullptr;
235 if(pView)
236 pSdrPageView = pView->GetSdrPageView();
237
238 if(pSdrPageView)
239 {
240 OUString aLayerName = pLayer->GetName();
241 switch(what)
242 {
243 case VISIBLE: return pSdrPageView->IsLayerVisible(aLayerName);
244 case PRINTABLE: return pSdrPageView->IsLayerPrintable(aLayerName);
245 case LOCKED: return pSdrPageView->IsLayerLocked(aLayerName);
246 }
247 }
248
249 // Try 2. get info from FrameView
250 if(mxLayerManager->GetDocShell())
251 {
252 ::sd::FrameView *pFrameView = mxLayerManager->GetDocShell()->GetFrameView();
253 if(pFrameView)
254 switch(what)
255 {
256 case VISIBLE: return pFrameView->GetVisibleLayers().IsSet(pLayer->GetID());
257 case PRINTABLE: return pFrameView->GetPrintableLayers().IsSet(pLayer->GetID());
258 case LOCKED: return pFrameView->GetLockedLayers().IsSet(pLayer->GetID());
259 }
260 }
261
262 // no view at all, e.g. Draw embedded as OLE in text document, ODF default values
263 switch(what)
264 {
265 case VISIBLE: return true;
266 case PRINTABLE: return true;
267 case LOCKED: return false;
268 }
269
270 }
271 return false; //TODO: uno::Exception?
272}
273
274void SdLayer::set( LayerAttribute what, bool flag ) noexcept
275{
276 if(!(pLayer && mxLayerManager.is()))
277 return;
278
279 // Try 1. is an arbitrary page open?
280 ::sd::View *pView = mxLayerManager->GetView();
281 SdrPageView* pSdrPageView = nullptr;
282 if(pView)
283 pSdrPageView = pView->GetSdrPageView();
284
285 if(pSdrPageView)
286 {
287 OUString aLayerName(pLayer->GetName());
288 switch(what)
289 {
290 case VISIBLE: pSdrPageView->SetLayerVisible(aLayerName,flag);
291 break;
292 case PRINTABLE: pSdrPageView->SetLayerPrintable(aLayerName,flag);
293 break;
294 case LOCKED: pSdrPageView->SetLayerLocked(aLayerName,flag);
295 break;
296 }
297 }
298
299 // Try 2. get info from FrameView
300 if(!mxLayerManager->GetDocShell())
301 return;
302
303 ::sd::FrameView *pFrameView = mxLayerManager->GetDocShell()->GetFrameView();
304
305 if(!pFrameView)
306 return;
307
308 SdrLayerIDSet aNewLayers;
309 switch(what)
310 {
311 case VISIBLE: aNewLayers = pFrameView->GetVisibleLayers();
312 break;
313 case PRINTABLE: aNewLayers = pFrameView->GetPrintableLayers();
314 break;
315 case LOCKED: aNewLayers = pFrameView->GetLockedLayers();
316 break;
317 }
318
319 aNewLayers.Set(pLayer->GetID(),flag);
320
321 switch(what)
322 {
323 case VISIBLE: pFrameView->SetVisibleLayers(aNewLayers);
324 break;
325 case PRINTABLE: pFrameView->SetPrintableLayers(aNewLayers);
326 break;
327 case LOCKED: pFrameView->SetLockedLayers(aNewLayers);
328 break;
329 }
330 return;
331 //TODO: uno::Exception?
332}
333
334// css::container::XChild
335uno::Reference<uno::XInterface> SAL_CALL SdLayer::getParent()
336{
337 SolarMutexGuard aGuard;
338
339 if( !mxLayerManager.is() )
340 throw lang::DisposedException();
341
342 return uno::Reference<uno::XInterface> (static_cast<cppu::OWeakObject*>(mxLayerManager.get()), uno::UNO_QUERY);
343}
344
345void SAL_CALL SdLayer::setParent (const uno::Reference<uno::XInterface >& )
346{
347 throw lang::NoSupportException ();
348}
349
350// XComponent
351void SAL_CALL SdLayer::dispose( )
352{
353 mxLayerManager.clear();
354 pLayer = nullptr;
355}
356
357void SAL_CALL SdLayer::addEventListener( const uno::Reference< lang::XEventListener >& )
358{
359 OSL_FAIL("not implemented!");
360}
361
362void SAL_CALL SdLayer::removeEventListener( const uno::Reference< lang::XEventListener >& )
363{
364 OSL_FAIL("not implemented!");
365}
366
367// class SdLayerManager
369:mpModel( &rMyModel)
370{
371 mpLayers.reset(new SvUnoWeakContainer);
372}
373
375{
376 dispose();
377}
378
379// XComponent
381{
382 mpModel = nullptr;
383 if( mpLayers )
384 {
385 mpLayers->dispose();
386 mpLayers.reset();
387 }
388}
389
390void SAL_CALL SdLayerManager::addEventListener( const uno::Reference< lang::XEventListener >& )
391{
392 OSL_FAIL("not implemented!");
393}
394
395void SAL_CALL SdLayerManager::removeEventListener( const uno::Reference< lang::XEventListener >& )
396{
397 OSL_FAIL("not implemented!");
398}
399
400// XServiceInfo
402{
403 return "SdUnoLayerManager";
404}
405
406sal_Bool SAL_CALL SdLayerManager::supportsService( const OUString& ServiceName )
407{
408 return cppu::supportsService( this, ServiceName );
409}
410
411uno::Sequence< OUString > SAL_CALL SdLayerManager::getSupportedServiceNames()
412{
413 return {"com.sun.star.drawing.LayerManager"};
414}
415
416// XLayerManager
417uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::insertNewByIndex( sal_Int32 nIndex )
418{
419 SolarMutexGuard aGuard;
420
421 if( mpModel == nullptr )
422 throw lang::DisposedException();
423
424 uno::Reference< drawing::XLayer > xLayer;
425
426 if( mpModel->mpDoc )
427 {
428 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
429 sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount();
430 sal_Int32 nLayer = nLayerCnt - 2 + 1;
431 OUString aLayerName;
432
433 // Test for existing names
434 while( aLayerName.isEmpty() || rLayerAdmin.GetLayer( aLayerName ) )
435 {
436 aLayerName = SdResId(STR_LAYER) + OUString::number(nLayer);
437 ++nLayer;
438 }
439
441 const sal_Int32 nMax=rLA.GetLayerCount();
442 if (nIndex>nMax) nIndex=nMax;
443 xLayer = GetLayer (rLA.NewLayer(aLayerName,static_cast<sal_uInt16>(nIndex)));
445 }
446 return xLayer;
447}
448
449void SAL_CALL SdLayerManager::remove( const uno::Reference< drawing::XLayer >& xLayer )
450{
451 SolarMutexGuard aGuard;
452
453 if( mpModel == nullptr )
454 throw lang::DisposedException();
455
456 SdLayer* pSdLayer = dynamic_cast<SdLayer*>(xLayer.get());
457
458 if(pSdLayer && GetView())
459 {
460 const SdrLayer* pSdrLayer = pSdLayer->GetSdrLayer();
461 GetView()->DeleteLayer( pSdrLayer->GetName() );
462
464 }
465
467}
468
469void SAL_CALL SdLayerManager::attachShapeToLayer( const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XLayer >& xLayer )
470{
471 SolarMutexGuard aGuard;
472
473 if( mpModel == nullptr )
474 throw lang::DisposedException();
475
476 SdLayer* pSdLayer = dynamic_cast<SdLayer*>(xLayer.get());
477 if(pSdLayer==nullptr)
478 return;
479 SdrLayer* pSdrLayer = pSdLayer->GetSdrLayer();
480 if(pSdrLayer==nullptr)
481 return;
482
483 SdrObject* pSdrObject = SdrObject::getSdrObjectFromXShape( xShape );
484
485 if(pSdrObject)
486 pSdrObject->SetLayer(pSdrLayer->GetID());
487
489}
490
491uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::getLayerForShape( const uno::Reference< drawing::XShape >& xShape )
492{
493 SolarMutexGuard aGuard;
494
495 if( mpModel == nullptr )
496 throw lang::DisposedException();
497
498 uno::Reference< drawing::XLayer > xLayer;
499
500 if(mpModel->mpDoc)
501 {
503 if(pObj)
504 {
505 SdrLayerID aId = pObj->GetLayer();
506 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
507 xLayer = GetLayer (rLayerAdmin.GetLayerPerID(aId));
508 }
509 }
510 return xLayer;
511}
512
513// XIndexAccess
514sal_Int32 SAL_CALL SdLayerManager::getCount()
515{
516 SolarMutexGuard aGuard;
517
518 if( mpModel == nullptr )
519 throw lang::DisposedException();
520
521 if( mpModel->mpDoc )
522 {
523 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
524 return rLayerAdmin.GetLayerCount();
525 }
526
527 return 0;
528}
529
530uno::Any SAL_CALL SdLayerManager::getByIndex( sal_Int32 nLayer )
531{
532 SolarMutexGuard aGuard;
533
534 if( mpModel == nullptr )
535 throw lang::DisposedException();
536
537 if( nLayer >= getCount() || nLayer < 0 )
538 throw lang::IndexOutOfBoundsException();
539
540 uno::Any aAny;
541
542 if( mpModel->mpDoc )
543 {
544 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
545 uno::Reference<drawing::XLayer> xLayer (GetLayer (rLayerAdmin.GetLayer(static_cast<sal_uInt16>(nLayer))));
546 aAny <<= xLayer;
547 }
548 return aAny;
549}
550
551// XNameAccess
552uno::Any SAL_CALL SdLayerManager::getByName( const OUString& aName )
553{
554 SolarMutexGuard aGuard;
555
556 if( (mpModel == nullptr) || (mpModel->mpDoc == nullptr ) )
557 throw lang::DisposedException();
558
559 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
560 SdrLayer* pLayer = rLayerAdmin.GetLayer(aName);
561 if( pLayer == nullptr )
562 throw container::NoSuchElementException();
563
564 return uno::Any( GetLayer (pLayer) );
565}
566
567uno::Sequence< OUString > SAL_CALL SdLayerManager::getElementNames()
568{
569 SolarMutexGuard aGuard;
570
571 if( mpModel == nullptr )
572 throw lang::DisposedException();
573
574 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
575 const sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount();
576
577 uno::Sequence< OUString > aSeq( nLayerCount );
578
579 OUString* pStrings = aSeq.getArray();
580
581 for( sal_uInt16 nLayer = 0; nLayer < nLayerCount; nLayer++ )
582 {
583 SdrLayer* pLayer = rLayerAdmin.GetLayer( nLayer );
584 if( pLayer )
585 *pStrings++ = pLayer->GetName();
586 }
587
588 return aSeq;
589}
590
591sal_Bool SAL_CALL SdLayerManager::hasByName( const OUString& aName )
592{
593 SolarMutexGuard aGuard;
594
595 if( mpModel == nullptr )
596 throw lang::DisposedException();
597
598 SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetLayerAdmin();
599
600 return nullptr != rLayerAdmin.GetLayer(aName);
601}
602
603// XElementAccess
605{
607}
608
610{
611 return getCount() > 0;
612}
613
619{
620 if(!mpModel->mpDocShell)
621 return;
622
623 ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >( mpModel->mpDocShell->GetViewShell());
624
625 if(pDrViewSh)
626 {
627 bool bLayerMode = pDrViewSh->IsLayerModeActive();
628 pDrViewSh->ChangeEditMode(pDrViewSh->GetEditMode(), !bLayerMode);
629 pDrViewSh->ChangeEditMode(pDrViewSh->GetEditMode(), bLayerMode);
630 }
631
633}
634
637{
638 if( mpModel->mpDocShell )
639 {
641 if(pViewSh)
642 return pViewSh->GetView();
643 }
644 return nullptr;
645}
646
647namespace
648{
659bool compare_layers (const uno::WeakReference<uno::XInterface>& xRef, void const * pSearchData)
660{
661 uno::Reference<uno::XInterface> xLayer (xRef);
662 if (xLayer.is())
663 {
664 SdLayer* pSdLayer = dynamic_cast<SdLayer*> (xLayer.get());
665 if (pSdLayer != nullptr)
666 {
667 SdrLayer* pSdrLayer = pSdLayer->GetSdrLayer ();
668 if (pSdrLayer == static_cast<SdrLayer const *>(pSearchData))
669 return true;
670 }
671 }
672 return false;
673}
674}
675
680uno::Reference<drawing::XLayer> SdLayerManager::GetLayer (SdrLayer* pLayer)
681{
682 uno::WeakReference<uno::XInterface> xRef;
683 uno::Reference<drawing::XLayer> xLayer;
684
685 // Search existing xLayer for the given pLayer.
686 if (mpLayers->findRef (xRef, static_cast<void*>(pLayer), compare_layers))
687 xLayer.set(xRef, uno::UNO_QUERY);
688
689 // Create the xLayer if necessary.
690 if ( ! xLayer.is())
691 {
692 xLayer = new SdLayer (this, pLayer);
693
694 // Remember the new xLayer for future calls.
695 uno::WeakReference<uno::XInterface> wRef(xLayer);
696 mpLayers->insert(wRef);
697 }
698
699 return xLayer;
700}
701
702/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
friend class SdLayer
Definition: unolayer.hxx:103
SdXImpressDocument * mpModel
Definition: unolayer.hxx:153
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unolayer.cxx:390
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: unolayer.cxx:567
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unolayer.cxx:395
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
Definition: unolayer.cxx:530
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unolayer.cxx:406
SdLayerManager(SdXImpressDocument &rMyModel) noexcept
Definition: unolayer.cxx:368
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XLayer > &xLayer) override
Definition: unolayer.cxx:449
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unolayer.cxx:411
virtual sal_Bool SAL_CALL hasElements() override
Definition: unolayer.cxx:609
std::unique_ptr< SvUnoWeakContainer > mpLayers
Definition: unolayer.hxx:154
virtual css::uno::Reference< css::drawing::XLayer > SAL_CALL getLayerForShape(const css::uno::Reference< css::drawing::XShape > &xShape) override
Definition: unolayer.cxx:491
virtual css::uno::Reference< css::drawing::XLayer > SAL_CALL insertNewByIndex(sal_Int32 nIndex) override
Definition: unolayer.cxx:417
virtual void SAL_CALL dispose() override
Definition: unolayer.cxx:380
virtual void SAL_CALL attachShapeToLayer(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Reference< css::drawing::XLayer > &xLayer) override
Definition: unolayer.cxx:469
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.
Definition: unolayer.cxx:680
virtual ~SdLayerManager() noexcept override
Definition: unolayer.cxx:374
void UpdateLayerView() const noexcept
If something was changed at the layers, this methods takes care that the changes are made visible in ...
Definition: unolayer.cxx:618
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: unolayer.cxx:552
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unolayer.cxx:604
::sd::View * GetView() const noexcept
Definition: unolayer.cxx:636
virtual OUString SAL_CALL getImplementationName() override
Definition: unolayer.cxx:401
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: unolayer.cxx:591
virtual sal_Int32 SAL_CALL getCount() override
Definition: unolayer.cxx:514
bool get(LayerAttribute what) noexcept
Definition: unolayer.cxx:228
rtl::Reference< SdLayerManager > mxLayerManager
Definition: unolayer.hxx:85
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Not implemented.
Definition: unolayer.cxx:345
SdrLayer * pLayer
Definition: unolayer.hxx:86
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unolayer.cxx:224
virtual OUString SAL_CALL getImplementationName() override
Definition: unolayer.cxx:92
void set(LayerAttribute what, bool flag) noexcept
Definition: unolayer.cxx:274
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unolayer.cxx:182
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unolayer.cxx:223
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Returns the layer manager that manages this layer.
Definition: unolayer.cxx:335
virtual void SAL_CALL dispose() override
Definition: unolayer.cxx:351
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unolayer.cxx:225
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unolayer.cxx:108
SdrLayer * GetSdrLayer() const noexcept
Definition: unolayer.hxx:52
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unolayer.cxx:97
virtual ~SdLayer() noexcept override
Definition: unolayer.cxx:87
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unolayer.cxx:114
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unolayer.cxx:362
const SvxItemPropertySet * pPropSet
Definition: unolayer.hxx:87
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unolayer.cxx:357
SdLayer(SdLayerManager *pLayerManager_, SdrLayer *pSdrLayer_)
Definition: unolayer.cxx:77
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unolayer.cxx:102
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unolayer.cxx:226
SdDrawDocument * mpDoc
Definition: unomodel.hxx:87
::sd::DrawDocShell * mpDocShell
Definition: unomodel.hxx:86
void SetModified() noexcept
Definition: unomodel.cxx:593
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)
void Set(SdrLayerID a)
bool IsSet(SdrLayerID a) const
SdrLayerID GetID() 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.
Definition: drviews1.cxx:333
View for MDIFrame.
Definition: FrameView.hxx:36
void SetLockedLayers(const SdrLayerIDSet &rLockedLayers)
Definition: FrameView.hxx:61
void SetPrintableLayers(const SdrLayerIDSet &rPrintableLayers)
Definition: FrameView.hxx:65
const SdrLayerIDSet & GetLockedLayers() const
Definition: FrameView.hxx:63
const SdrLayerIDSet & GetVisibleLayers() const
Definition: FrameView.hxx:59
void SetVisibleLayers(const SdrLayerIDSet &rVisibleLayers)
Definition: FrameView.hxx:57
const SdrLayerIDSet & GetPrintableLayers() const
Definition: FrameView.hxx:67
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
::sd::View * GetView() const
Definition: ViewShell.hxx:144
float u
sal_Int32 nIndex
OUString aName
Sequence< sal_Int8 > aSeq
VISIBLE
bool any2bool(const css::uno::Any &rAny)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
unsigned char sal_Bool
#define WID_LAYER_VISIBLE
Definition: unolayer.cxx:57
#define WID_LAYER_TITLE
Definition: unolayer.cxx:59
#define WID_LAYER_PRINTABLE
Definition: unolayer.cxx:56
#define WID_LAYER_LOCKED
Definition: unolayer.cxx:55
#define WID_LAYER_NAME
Definition: unolayer.cxx:58
#define WID_LAYER_DESC
Definition: unolayer.cxx:60
static const SvxItemPropertySet * ImplGetSdLayerPropertySet()
Definition: unolayer.cxx:62
LayerAttribute
Definition: unolayer.hxx:37
@ LOCKED
Definition: unolayer.hxx:37
@ VISIBLE
Definition: unolayer.hxx:37
@ PRINTABLE
Definition: unolayer.hxx:37
#define UNO_NAME_LAYER_PRINTABLE
Definition: unoprnms.hxx:64
#define UNO_NAME_LAYER_LOCKED
Definition: unoprnms.hxx:63
#define UNO_NAME_LAYER_VISIBLE
Definition: unoprnms.hxx:65
#define UNO_NAME_LAYER_NAME
Definition: unoprnms.hxx:66