1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SlsCurrentSlideManager.hxx,v $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SD_SLIDESORTER_CURRENT_SLIDE_MANAGER_HXX
33 #define SD_SLIDESORTER_CURRENT_SLIDE_MANAGER_HXX
35 #include "model/SlsSharedPageDescriptor.hxx"
36 #include <com/sun/star/drawing/XDrawPage.hpp>
40 namespace sd
{ namespace slidesorter
{
45 namespace sd
{ namespace slidesorter
{ namespace controller
{
47 /** Manage the current slide. This includes setting the according flags at
48 the PageDescriptor objects and setting the current slide at the main
51 class CurrentSlideManager
54 /** Create a new CurrentSlideManager object that manages the current
55 slide for the given SlideSorter.
57 CurrentSlideManager (SlideSorter
& rSlideSorter
);
59 ~CurrentSlideManager (void);
61 /** Call this when the current page of the main view shell has been
62 switched. Use SwitchCurrentSlide() to initiate such a switch.
64 void CurrentSlideHasChanged (const sal_Int32 nSlideIndex
);
66 /** Call this method to switch the current page of the main view shell
67 to the given slide. Use CurrentSlideHasChanged() when the current
68 slide change has been initiated by someone else.
70 void SwitchCurrentSlide (const sal_Int32 nSlideIndex
);
71 void SwitchCurrentSlide (const model::SharedPageDescriptor
& rpSlide
);
73 /** Return the page descriptor for the current slide. Note, that when
74 there is no current slide then the returned pointer is empty.
76 model::SharedPageDescriptor
GetCurrentSlide (void);
78 /** Release all references to model data.
80 void PrepareModelChange (void);
82 /** Modify inner state in reaction to a change of the SlideSorterModel.
84 void HandleModelChange (void);
87 SlideSorter
& mrSlideSorter
;
88 sal_Int32 mnCurrentSlideIndex
;
89 model::SharedPageDescriptor mpCurrentSlide
;
91 bool IsCurrentSlideIsValid (void);
92 void SetCurrentSlideAtViewShellBase (const model::SharedPageDescriptor
& rpSlide
);
93 void SetCurrentSlideAtXController (const model::SharedPageDescriptor
& rpSlide
);
95 /** When switching from one slide to a new current slide then this
96 method releases all ties to the old slide.
98 void ReleaseCurrentSlide (void);
100 /** When switching from one slide to a new current slide then this
101 method connects to the new current slide.
103 void AcquireCurrentSlide (const sal_Int32 nSlideIndex
);
107 } } } // end of namespace ::sd::slidesorter::controller