1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "DrawViewShell.hxx"
22 #include "PresentationViewShell.hxx"
23 #include <editeng/outliner.hxx>
24 #include <svx/svxids.hrc>
25 #include <sfx2/request.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <svx/svdpagv.hxx>
28 #include <vcl/scrbar.hxx>
29 #include <tools/poly.hxx>
30 #include <svx/fmshell.hxx>
31 #include <editeng/eeitem.hxx>
32 #include <svtools/colorcfg.hxx>
33 #include "AccessibleDrawDocumentView.hxx"
35 #include <sfx2/viewfrm.hxx>
36 #include "LayerTabBar.hxx"
38 #include "strings.hrc"
39 #include "res_bmp.hrc"
43 #include "optsitem.hxx"
45 #include "FrameView.hxx"
49 #include "stlpool.hxx"
50 #include "prntopts.hxx"
51 #include "sdresid.hxx"
53 #include "drawview.hxx"
54 #include "drawdoc.hxx"
55 #include "DrawDocShell.hxx"
56 #include "Outliner.hxx"
58 #include "slideshow.hxx"
59 #include "unokywds.hxx"
60 #include "SdUnoDrawView.hxx"
61 #include "ViewShellBase.hxx"
62 #include "FormShellManager.hxx"
63 #include "LayerDialogContent.hxx"
64 #include "DrawController.hxx"
68 static const int TABCONTROL_INITIAL_SIZE
= 350;
69 static const int PAPER_SHADOW_EXT_PIXEL
= 2;
73 void DrawViewShell::ModelHasChanged()
76 // that the navigator also gets an up to date state
77 GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE
, sal_True
, sal_False
);
79 SfxBoolItem
aItem( SID_3D_STATE
, sal_True
);
80 GetViewFrame()->GetDispatcher()->Execute(
81 SID_3D_STATE
, SFX_CALLMODE_ASYNCHRON
| SFX_CALLMODE_RECORD
, &aItem
, 0L );
83 // now initialize the TextEditOutliner which was newly created by the draw engine
84 ::Outliner
* pOutliner
= mpDrawView
->GetTextEditOutliner();
87 SfxStyleSheetPool
* pSPool
= (SfxStyleSheetPool
*) GetDocSh()->GetStyleSheetPool();
88 pOutliner
->SetStyleSheetPool(pSPool
);
95 void DrawViewShell::Resize (void)
99 if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
)
101 SetZoomRect( GetDocSh()->GetVisArea(ASPECT_CONTENT
) );
104 rtl::Reference
< sd::SlideShow
> xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
105 if( xSlideshow
.is() && xSlideshow
->isRunning() && !xSlideshow
->isFullScreen() )
107 xSlideshow
->resize(maViewSize
);
114 void DrawViewShell::ArrangeGUIElements (void)
116 // Retrieve the current size (thickness) of the scroll bars. That is
117 // the width of the vertical and the height of the horizontal scroll
120 GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize();
121 maScrBarWH
= Size (nScrollBarSize
, nScrollBarSize
);
123 Point aHPos
= maViewPos
;
124 aHPos
.Y() += maViewSize
.Height();
127 ViewShell::ArrangeGUIElements ();
131 OSL_ASSERT (GetViewShell()!=NULL
);
132 Client
* pIPClient
= static_cast<Client
*>(GetViewShell()->GetIPClient());
133 sal_Bool bClientActive
= sal_False
;
134 if ( pIPClient
&& pIPClient
->IsObjectInPlaceActive() )
135 bClientActive
= sal_True
;
137 sal_Bool bInPlaceActive
= GetViewFrame()->GetFrame().IsInPlace();
139 if ( mbZoomOnPage
&& !bInPlaceActive
&& !bClientActive
)
141 // with split, always resize first window
142 //af pWindow = mpContentWindow.get();
143 SfxRequest
aReq(SID_SIZE_PAGE
, 0, GetDoc()->GetItemPool());
149 * Apply data of the FrameView on the current view
151 void DrawViewShell::ReadFrameViewData(FrameView
* pView
)
153 ModifyGuard
aGuard( GetDoc() );
155 // this option has to be adjust at the model
156 GetDoc()->SetPickThroughTransparentTextFrames(
157 SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType())->IsPickThrough());
159 // initialization of the Character-(Screen-) attribute
160 if (HasRuler() != pView
->HasRuler())
161 SetRuler( pView
->HasRuler() );
163 if (mpDrawView
->GetGridCoarse() != pView
->GetGridCoarse())
164 mpDrawView
->SetGridCoarse( pView
->GetGridCoarse() );
166 if (mpDrawView
->GetGridFine() != pView
->GetGridFine())
167 mpDrawView
->SetGridFine( pView
->GetGridFine() );
169 if (mpDrawView
->GetSnapGridWidthX() != pView
->GetSnapGridWidthX() || mpDrawView
->GetSnapGridWidthY() != pView
->GetSnapGridWidthY())
170 mpDrawView
->SetSnapGridWidth(pView
->GetSnapGridWidthX(), pView
->GetSnapGridWidthY());
172 if (mpDrawView
->IsGridVisible() != pView
->IsGridVisible())
173 mpDrawView
->SetGridVisible( pView
->IsGridVisible() );
175 if (mpDrawView
->IsGridFront() != pView
->IsGridFront())
176 mpDrawView
->SetGridFront( pView
->IsGridFront() );
178 if (mpDrawView
->GetSnapAngle() != pView
->GetSnapAngle())
179 mpDrawView
->SetSnapAngle( pView
->GetSnapAngle() );
181 if (mpDrawView
->IsGridSnap() != pView
->IsGridSnap() )
182 mpDrawView
->SetGridSnap( pView
->IsGridSnap() );
184 if (mpDrawView
->IsBordSnap() != pView
->IsBordSnap() )
185 mpDrawView
->SetBordSnap( pView
->IsBordSnap() );
187 if (mpDrawView
->IsHlplSnap() != pView
->IsHlplSnap() )
188 mpDrawView
->SetHlplSnap( pView
->IsHlplSnap() );
190 if (mpDrawView
->IsOFrmSnap() != pView
->IsOFrmSnap() )
191 mpDrawView
->SetOFrmSnap( pView
->IsOFrmSnap() );
193 if (mpDrawView
->IsOPntSnap() != pView
->IsOPntSnap() )
194 mpDrawView
->SetOPntSnap( pView
->IsOPntSnap() );
196 if (mpDrawView
->IsOConSnap() != pView
->IsOConSnap() )
197 mpDrawView
->SetOConSnap( pView
->IsOConSnap() );
199 if (mpDrawView
->IsHlplVisible() != pView
->IsHlplVisible() )
200 mpDrawView
->SetHlplVisible( pView
->IsHlplVisible() );
202 if (mpDrawView
->IsDragStripes() != pView
->IsDragStripes() )
203 mpDrawView
->SetDragStripes( pView
->IsDragStripes() );
205 if (mpDrawView
->IsPlusHandlesAlwaysVisible() != pView
->IsPlusHandlesAlwaysVisible() )
206 mpDrawView
->SetPlusHandlesAlwaysVisible( pView
->IsPlusHandlesAlwaysVisible() );
208 if (mpDrawView
->GetSnapMagneticPixel() != pView
->GetSnapMagneticPixel() )
209 mpDrawView
->SetSnapMagneticPixel( pView
->GetSnapMagneticPixel() );
211 if (mpDrawView
->IsMarkedHitMovesAlways() != pView
->IsMarkedHitMovesAlways() )
212 mpDrawView
->SetMarkedHitMovesAlways( pView
->IsMarkedHitMovesAlways() );
214 if (mpDrawView
->IsMoveOnlyDragging() != pView
->IsMoveOnlyDragging() )
215 mpDrawView
->SetMoveOnlyDragging( pView
->IsMoveOnlyDragging() );
217 if (mpDrawView
->IsNoDragXorPolys() != pView
->IsNoDragXorPolys() )
218 mpDrawView
->SetNoDragXorPolys( pView
->IsNoDragXorPolys() );
220 if (mpDrawView
->IsCrookNoContortion() != pView
->IsCrookNoContortion() )
221 mpDrawView
->SetCrookNoContortion( pView
->IsCrookNoContortion() );
223 if (mpDrawView
->IsAngleSnapEnabled() != pView
->IsAngleSnapEnabled() )
224 mpDrawView
->SetAngleSnapEnabled( pView
->IsAngleSnapEnabled() );
226 if (mpDrawView
->IsBigOrtho() != pView
->IsBigOrtho() )
227 mpDrawView
->SetBigOrtho( pView
->IsBigOrtho() );
229 if (mpDrawView
->IsOrtho() != pView
->IsOrtho() )
230 mpDrawView
->SetOrtho( pView
->IsOrtho() );
232 if (mpDrawView
->GetEliminatePolyPointLimitAngle() != pView
->GetEliminatePolyPointLimitAngle() )
233 mpDrawView
->SetEliminatePolyPointLimitAngle( pView
->GetEliminatePolyPointLimitAngle() );
235 if (mpDrawView
->IsEliminatePolyPoints() != pView
->IsEliminatePolyPoints() )
236 mpDrawView
->SetEliminatePolyPoints( pView
->IsEliminatePolyPoints() );
238 if (mpDrawView
->IsSolidDragging() != pView
->IsSolidDragging() )
239 mpDrawView
->SetSolidDragging( pView
->IsSolidDragging() );
241 if (mpDrawView
->IsQuickTextEditMode() != pView
->IsQuickEdit())
242 mpDrawView
->SetQuickTextEditMode( pView
->IsQuickEdit() );
245 if (mpDrawView
->IsMasterPagePaintCaching() != pView
->IsMasterPagePaintCaching())
246 mpDrawView
->SetMasterPagePaintCaching( pView
->IsMasterPagePaintCaching() );
248 // handle size: 9 pixels
249 sal_uInt16 nTmp
= mpDrawView
->GetMarkHdlSizePixel();
251 mpDrawView
->SetMarkHdlSizePixel( 9 );
254 SdrPageView
* pPageView
= mpDrawView
->GetSdrPageView();
257 if ( pPageView
->GetVisibleLayers() != pView
->GetVisibleLayers() )
258 pPageView
->SetVisibleLayers( pView
->GetVisibleLayers() );
260 if ( pPageView
->GetPrintableLayers() != pView
->GetPrintableLayers() )
261 pPageView
->SetPrintableLayers( pView
->GetPrintableLayers() );
263 if ( pPageView
->GetLockedLayers() != pView
->GetLockedLayers() )
264 pPageView
->SetLockedLayers( pView
->GetLockedLayers() );
266 if (mePageKind
== PK_NOTES
)
268 if (pPageView
->GetHelpLines() != pView
->GetNotesHelpLines())
269 pPageView
->SetHelpLines( pView
->GetNotesHelpLines() );
271 else if (mePageKind
== PK_HANDOUT
)
273 if (pPageView
->GetHelpLines() != pView
->GetHandoutHelpLines())
274 pPageView
->SetHelpLines( pView
->GetHandoutHelpLines() );
278 if (pPageView
->GetHelpLines() != pView
->GetStandardHelpLines())
279 pPageView
->SetHelpLines( pView
->GetStandardHelpLines() );
283 if ( mpDrawView
->GetActiveLayer() != pView
->GetActiveLayer() )
284 mpDrawView
->SetActiveLayer( pView
->GetActiveLayer() );
286 sal_uInt16 nSelectedPage
= 0;
288 if (mePageKind
!= PK_HANDOUT
)
290 nSelectedPage
= pView
->GetSelectedPage();
293 EditMode eNewEditMode
= pView
->GetViewShEditMode(mePageKind
);
294 sal_Bool bNewLayerMode
= pView
->IsLayerMode();
295 ChangeEditMode(eNewEditMode
, bNewLayerMode
);
296 SwitchPage(nSelectedPage
);
298 // restore DrawMode for 'normal' window
299 if(GetActiveWindow()->GetDrawMode() != pView
->GetDrawMode())
300 GetActiveWindow()->SetDrawMode(pView
->GetDrawMode());
302 if ( mpDrawView
->IsDesignMode() != pView
->IsDesignMode() )
304 SfxBoolItem
aDesignModeItem( SID_FM_DESIGN_MODE
, pView
->IsDesignMode() );
305 GetViewFrame()->GetDispatcher()->Execute( SID_FM_DESIGN_MODE
, SFX_CALLMODE_SYNCHRON
| SFX_CALLMODE_RECORD
, &aDesignModeItem
, 0L );
308 // has to be called in the end, because it executes a WriteFrameViewData()
309 if (mpDrawView
->IsFrameDragSingles() != pView
->IsFrameDragSingles() )
310 mpDrawView
->SetFrameDragSingles( pView
->IsFrameDragSingles() );
315 * Apply data of the current view on the FrameView
317 void DrawViewShell::WriteFrameViewData()
319 // store character-(screen-) attribute of FrameView
320 mpFrameView
->SetRuler( HasRuler() );
321 mpFrameView
->SetGridCoarse( mpDrawView
->GetGridCoarse() );
322 mpFrameView
->SetGridFine( mpDrawView
->GetGridFine() );
323 mpFrameView
->SetSnapGridWidth(mpDrawView
->GetSnapGridWidthX(), mpDrawView
->GetSnapGridWidthY());
324 mpFrameView
->SetGridVisible( mpDrawView
->IsGridVisible() );
325 mpFrameView
->SetGridFront( mpDrawView
->IsGridFront() );
326 mpFrameView
->SetSnapAngle( mpDrawView
->GetSnapAngle() );
327 mpFrameView
->SetGridSnap( mpDrawView
->IsGridSnap() );
328 mpFrameView
->SetBordSnap( mpDrawView
->IsBordSnap() );
329 mpFrameView
->SetHlplSnap( mpDrawView
->IsHlplSnap() );
330 mpFrameView
->SetOFrmSnap( mpDrawView
->IsOFrmSnap() );
331 mpFrameView
->SetOPntSnap( mpDrawView
->IsOPntSnap() );
332 mpFrameView
->SetOConSnap( mpDrawView
->IsOConSnap() );
333 mpFrameView
->SetHlplVisible( mpDrawView
->IsHlplVisible() );
334 mpFrameView
->SetDragStripes( mpDrawView
->IsDragStripes() );
335 mpFrameView
->SetPlusHandlesAlwaysVisible( mpDrawView
->IsPlusHandlesAlwaysVisible() );
336 mpFrameView
->SetFrameDragSingles( mpDrawView
->IsFrameDragSingles() );
337 mpFrameView
->SetMarkedHitMovesAlways( mpDrawView
->IsMarkedHitMovesAlways() );
338 mpFrameView
->SetMoveOnlyDragging( mpDrawView
->IsMoveOnlyDragging() );
339 mpFrameView
->SetNoDragXorPolys( mpDrawView
->IsNoDragXorPolys() );
340 mpFrameView
->SetCrookNoContortion( mpDrawView
->IsCrookNoContortion() );
341 mpFrameView
->SetBigOrtho( mpDrawView
->IsBigOrtho() );
342 mpFrameView
->SetEliminatePolyPointLimitAngle( mpDrawView
->GetEliminatePolyPointLimitAngle() );
343 mpFrameView
->SetEliminatePolyPoints( mpDrawView
->IsEliminatePolyPoints() );
345 mpFrameView
->SetSolidDragging( mpDrawView
->IsSolidDragging() );
346 mpFrameView
->SetQuickEdit( mpDrawView
->IsQuickTextEditMode() );
348 mpFrameView
->SetDesignMode( mpDrawView
->IsDesignMode() );
350 Size aVisSizePixel
= GetActiveWindow()->GetOutputSizePixel();
351 Rectangle aVisArea
= GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel
) );
352 mpFrameView
->SetVisArea(aVisArea
);
354 if( mePageKind
== PK_HANDOUT
)
355 mpFrameView
->SetSelectedPage(0);
358 mpFrameView
->SetSelectedPage( maTabControl
.GetCurPageId() - 1 );
361 mpFrameView
->SetViewShEditMode(meEditMode
, mePageKind
);
362 mpFrameView
->SetLayerMode(IsLayerModeActive());
364 SdrPageView
* pPageView
= mpDrawView
->GetSdrPageView();
368 if ( mpFrameView
->GetVisibleLayers() != pPageView
->GetVisibleLayers() )
369 mpFrameView
->SetVisibleLayers( pPageView
->GetVisibleLayers() );
371 if ( mpFrameView
->GetPrintableLayers() != pPageView
->GetPrintableLayers() )
372 mpFrameView
->SetPrintableLayers( pPageView
->GetPrintableLayers() );
374 if ( mpFrameView
->GetLockedLayers() != pPageView
->GetLockedLayers() )
375 mpFrameView
->SetLockedLayers( pPageView
->GetLockedLayers() );
377 if (mePageKind
== PK_NOTES
)
379 mpFrameView
->SetNotesHelpLines( pPageView
->GetHelpLines() );
381 else if (mePageKind
== PK_HANDOUT
)
383 mpFrameView
->SetHandoutHelpLines( pPageView
->GetHelpLines() );
387 mpFrameView
->SetStandardHelpLines( pPageView
->GetHelpLines() );
391 if ( mpFrameView
->GetActiveLayer() != mpDrawView
->GetActiveLayer() )
392 mpFrameView
->SetActiveLayer( mpDrawView
->GetActiveLayer() );
394 // store DrawMode for 'normal' window
395 if(mpFrameView
->GetDrawMode() != GetActiveWindow()->GetDrawMode())
396 mpFrameView
->SetDrawMode(GetActiveWindow()->GetDrawMode());
401 void DrawViewShell::PrePaint()
403 mpDrawView
->PrePaint();
407 * The event is forwarded to the Viewshell and the current function by the
410 * Remark: pWin==NULL, if Paint() is called from ShowWindow!
412 void DrawViewShell::Paint(const Rectangle
& rRect
, ::sd::Window
* pWin
)
414 // Fill var FillColor here to have it available on later call
415 svtools::ColorConfig aColorConfig
;
418 aFillColor
= Color( aColorConfig
.GetColorValue( svtools::APPBACKGROUND
).nColor
);
420 /* This is done before each text edit, so why not do it before every paint.
421 The default language is only used if the outliner only contains one
422 character in a symbol font */
423 GetDoc()->GetDrawOutliner( NULL
).SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE
) );
425 // Set Application Background color for usage in SdrPaintView(s)
426 mpDrawView
->SetApplicationBackgroundColor(aFillColor
);
428 /* This is done before each text edit, so why not do it before every paint.
429 The default language is only used if the outliner only contains one
430 character in a symbol font */
431 GetDoc()->GetDrawOutliner( NULL
).SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
433 mpDrawView
->CompleteRedraw( pWin
, Region( rRect
) );
437 if( GetDocSh()->GetDocShellFunction().is() )
438 GetDocSh()->GetDocShellFunction()->Paint( rRect
, pWin
);
440 if( HasCurrentFunction() )
441 GetCurrentFunction()->Paint( rRect
, pWin
);
446 * adjust zoom factor for InPlace
448 void DrawViewShell::SetZoomFactor(const Fraction
& rZoomX
, const Fraction
& rZoomY
)
450 ViewShell::SetZoomFactor(rZoomX
, rZoomY
);
451 mbZoomOnPage
= sal_False
;
452 Point aOrigin
= GetActiveWindow()->GetViewOrigin();
453 GetActiveWindow()->SetWinViewPos(aOrigin
);
457 void DrawViewShell::HidePage()
459 FmFormShell
* pFormShell
= GetViewShellBase().GetFormShellManager()->GetFormShell();
460 if (pFormShell
!= NULL
)
461 pFormShell
->PrepareClose (sal_False
);
466 void DrawViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rSequence
, sal_Bool bBrowse
)
468 WriteFrameViewData();
470 ViewShell::WriteUserDataSequence( rSequence
, bBrowse
);
472 const sal_Int32 nIndex
= rSequence
.getLength();
473 rSequence
.realloc( nIndex
+ 1 );
474 rSequence
[nIndex
].Name
= sUNO_View_ZoomOnPage
;
475 rSequence
[nIndex
].Value
<<= (sal_Bool
)mbZoomOnPage
;
478 void DrawViewShell::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rSequence
, sal_Bool bBrowse
)
480 WriteFrameViewData();
482 ViewShell::ReadUserDataSequence( rSequence
, bBrowse
);
484 const sal_Int32 nLength
= rSequence
.getLength();
485 const com::sun::star::beans::PropertyValue
*pValue
= rSequence
.getConstArray();
486 for (sal_Int16 i
= 0 ; i
< nLength
; i
++, pValue
++ )
488 if ( pValue
->Name
== sUNO_View_ZoomOnPage
)
490 sal_Bool bZoomPage
= sal_False
;
491 if( pValue
->Value
>>= bZoomPage
)
493 mbZoomOnPage
= bZoomPage
;
498 if( mpFrameView
->GetPageKind() != mePageKind
)
500 mePageKind
= mpFrameView
->GetPageKind();
502 if (mePageKind
== PK_NOTES
)
504 SetHelpId( SID_NOTESMODE
);
505 GetActiveWindow()->SetHelpId( CMD_SID_NOTESMODE
);
506 GetActiveWindow()->SetUniqueId( CMD_SID_NOTESMODE
);
508 else if (mePageKind
== PK_HANDOUT
)
510 SetHelpId( SID_HANDOUTMODE
);
511 GetActiveWindow()->SetHelpId( CMD_SID_HANDOUTMODE
);
512 GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUTMODE
);
516 SetHelpId( SD_IF_SDDRAWVIEWSHELL
);
517 GetActiveWindow()->SetHelpId( HID_SDDRAWVIEWSHELL
);
518 GetActiveWindow()->SetUniqueId( HID_SDDRAWVIEWSHELL
);
522 ReadFrameViewData( mpFrameView
);
526 const Rectangle
aVisArea( mpFrameView
->GetVisArea() );
528 if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED
)
530 GetDocSh()->SetVisArea(aVisArea
);
533 VisAreaChanged(aVisArea
);
535 ::sd::View
* pView
= GetView();
539 pView
->VisAreaChanged(GetActiveWindow());
542 SetZoomRect(aVisArea
);
545 ChangeEditMode (meEditMode
, ! IsLayerModeActive());
549 void DrawViewShell::VisAreaChanged(const Rectangle
& rRect
)
551 ViewShell::VisAreaChanged( rRect
);
553 DrawController
& rController
= GetViewShellBase().GetDrawController();
554 rController
.FireVisAreaChanged (rRect
);
560 /** If there is a valid controller then create a new instance of
561 <type>AccessibleDrawDocumentView</type>. Otherwise return an empty
564 ::com::sun::star::uno::Reference
<
565 ::com::sun::star::accessibility::XAccessible
>
566 DrawViewShell::CreateAccessibleDocumentView (::sd::Window
* pWindow
)
568 if (GetViewShellBase().GetController() != NULL
)
570 accessibility::AccessibleDrawDocumentView
* pDocumentView
=
571 new accessibility::AccessibleDrawDocumentView (
574 GetViewShellBase().GetController(),
575 pWindow
->GetAccessibleParentWindow()->GetAccessible());
576 pDocumentView
->Init();
577 return ::com::sun::star::uno::Reference
<
578 ::com::sun::star::accessibility::XAccessible
>
579 (static_cast< ::com::sun::star::uno::XWeak
*>(pDocumentView
),
580 ::com::sun::star::uno::UNO_QUERY
);
583 OSL_TRACE ("DrawViewShell::CreateAccessibleDocumentView: no controller");
584 return ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>();
590 int DrawViewShell::GetActiveTabLayerIndex (void) const
592 const LayerTabBar
* pBar
593 = const_cast<DrawViewShell
*>(this)->GetLayerTabControl ();
595 return pBar
->GetPagePos (pBar
->GetCurPageId());
603 void DrawViewShell::SetActiveTabLayerIndex (int nIndex
)
605 LayerTabBar
* pBar
= GetLayerTabControl ();
608 // Ignore invalid indices silently.
609 if (nIndex
>=0 && nIndex
<pBar
->GetPageCount())
611 // Tell the draw view and the tab control of the new active layer.
612 mpDrawView
->SetActiveLayer (pBar
->GetPageText (pBar
->GetPageId ((sal_uInt16
)nIndex
)));
613 pBar
->SetCurPageId (pBar
->GetPageId ((sal_uInt16
)nIndex
));
621 TabControl
* DrawViewShell::GetPageTabControl (void)
623 return &maTabControl
;
629 LayerTabBar
* DrawViewShell::GetLayerTabControl (void)
631 return mpLayerTabBar
.get();
637 int DrawViewShell::GetTabLayerCount (void) const
639 const LayerTabBar
* pBar
640 = const_cast<DrawViewShell
*>(this)->GetLayerTabControl ();
642 return pBar
->GetPageCount();
648 } // end of namespace sd
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */