CWS-TOOLING: integrate CWS os150
[LibreOffice.git] / sd / source / ui / inc / SlideSorterViewShell.hxx
blob2f0ebbcfd18e527d8bc1608a9a5850bff2fb2945
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SD_SLIDESORTER_SLIDE_SORTER_VIEW_SHELL_HXX
29 #define SD_SLIDESORTER_SLIDE_SORTER_VIEW_SHELL_HXX
31 #include "ViewShell.hxx"
32 #include "glob.hxx"
33 #include <sfx2/shell.hxx>
34 #include <sfx2/viewfac.hxx>
35 #include <boost/shared_ptr.hpp>
36 #include <vector>
38 namespace sd { namespace slidesorter { namespace controller {
39 class SlotManager;
40 } } }
43 namespace sd { namespace slidesorter {
45 class SlideSorter;
47 class SlideSorterViewShell
48 : public ViewShell
50 friend class controller::SlotManager;
52 public:
53 TYPEINFO();
54 SFX_DECL_INTERFACE(SD_IF_SDSLIDESORTERVIEWSHELL)
56 static ::boost::shared_ptr<SlideSorterViewShell> Create(
57 SfxViewFrame* pFrame,
58 ViewShellBase& rViewShellBase,
59 ::Window* pParentWindow,
60 FrameView* pFrameView,
61 const bool bIsCenterPane);
63 virtual ~SlideSorterViewShell (void);
65 /** Late initialization that has to be called after a new instance has
66 completed its construction.
68 virtual void Init (bool bIsMainViewShell);
70 /** Return a slide sorter that is currently displayed in one of the
71 panes that belong to the given ViewShellBase object.
72 When there is only one slide sorter visible then that one is
73 returned. When two (or more) are visible then the one in the center
74 pane is returned. When no slidesorter is visible then NULL is
75 returned.
77 static SlideSorterViewShell* GetSlideSorter (ViewShellBase& rBase);
79 virtual void GetFocus (void);
80 virtual void LoseFocus (void);
81 virtual SdPage* GetActualPage (void);
83 /// inherited from sd::ViewShell
84 virtual SdPage* getCurrentPage() const;
86 void ExecCtrl (SfxRequest& rRequest);
87 virtual void GetCtrlState (SfxItemSet &rSet);
88 virtual void FuSupport (SfxRequest& rRequest);
89 virtual void FuTemporary (SfxRequest& rRequest);
90 virtual void GetStatusBarState (SfxItemSet& rSet);
91 virtual void FuPermanent (SfxRequest& rRequest);
92 void GetAttrState (SfxItemSet& rSet);
93 void ExecStatusBar (SfxRequest& rRequest);
94 virtual void Command (const CommandEvent& rEvent, ::sd::Window* pWindow);
95 virtual void GetMenuState (SfxItemSet &rSet);
96 virtual void GetClipboardState (SfxItemSet &rSet);
98 virtual void ReadFrameViewData (FrameView* pView);
99 virtual void WriteFrameViewData (void);
101 /** Set the zoom factor. The given value is clipped against an upper
102 bound.
103 @param nZoom
104 An integer percent value, i.e. nZoom/100 is the actual zoom
105 factor.
107 virtual void SetZoom (long int nZoom);
108 virtual void SetZoomRect (const Rectangle& rZoomRect);
110 /** This is a callback method used by the active window to delegate its
111 Paint() call to. This view shell itself delegates it to the view.
113 virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
115 /** Place and size the controls and windows. You may want to call this
116 method when something has changed that for instance affects the
117 visibility state of the scroll bars.
119 virtual void ArrangeGUIElements (void);
121 virtual void Activate (sal_Bool IsMDIActivate);
123 //===== Drag and Drop =====================================================
125 virtual void StartDrag (
126 const Point& rDragPt,
127 ::Window* pWindow );
128 virtual void DragFinished (
129 sal_Int8 nDropAction);
130 virtual sal_Int8 AcceptDrop (
131 const AcceptDropEvent& rEvt,
132 DropTargetHelper& rTargetHelper,
133 ::sd::Window* pTargetWindow = NULL,
134 sal_uInt16 nPage = SDRPAGE_NOTFOUND,
135 sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
136 virtual sal_Int8 ExecuteDrop (
137 const ExecuteDropEvent& rEvt,
138 DropTargetHelper& rTargetHelper,
139 ::sd::Window* pTargetWindow = NULL,
140 sal_uInt16 nPage = SDRPAGE_NOTFOUND,
141 sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
143 typedef ::std::vector<SdPage*> PageSelection;
145 /** Return the set of selected pages.
147 ::boost::shared_ptr<PageSelection> GetPageSelection (void) const;
149 void SetPageSelection (const ::boost::shared_ptr<PageSelection>& rSelection);
151 /** Add a listener that is called when the selection of the slide sorter
152 changes.
153 @param rListener
154 When this method is called multiple times for the same listener
155 the second and all following calls are ignored. Each listener
156 is added only once.
158 void AddSelectionChangeListener (const Link& rListener);
160 /** Remove a listener that was called when the selection of the slide
161 sorter changes.
162 @param rListener
163 It is save to pass a listener that was not added are has been
164 removed previously. Such calls are ignored.
166 void RemoveSelectionChangeListener (const Link& rListener);
168 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
170 /** Create an accessible object representing the specified window.
171 @param pWindow
172 The returned object makes the document displayed in this window
173 accessible.
174 @return
175 Returns an <type>AccessibleSlideSorterView</type> object.
177 virtual ::com::sun::star::uno::Reference<
178 ::com::sun::star::accessibility::XAccessible>
179 CreateAccessibleDocumentView (::sd::Window* pWindow);
181 SlideSorter& GetSlideSorter (void) const;
183 /** Try to relocate all toplevel window elements to the given parent
184 window.
186 virtual bool RelocateToParentWindow (::Window* pParentWindow);
188 protected:
190 virtual SvBorder GetBorder (bool bOuterResize);
192 /** This method is overloaded to handle a missing tool bar correctly.
193 This is the case when the slide sorter is not the main view shell.
195 virtual ::svl::IUndoManager* ImpGetUndoManager (void) const;
197 private:
198 ::boost::shared_ptr<SlideSorter> mpSlideSorter;
199 bool mbIsArrangeGUIElementsPending;
201 SlideSorterViewShell (
202 SfxViewFrame* pFrame,
203 ViewShellBase& rViewShellBase,
204 ::Window* pParentWindow,
205 FrameView* pFrameView);
206 void Initialize (void);
208 /** This method overwrites the one from our base class: We do our own
209 scroll bar and the base class call is thus unnecessary. It simply
210 calls UpdateScrollBars(false).
212 virtual void UpdateScrollBars (void);
215 typedef ::boost::shared_ptr<SlideSorterViewShell::PageSelection> SharedPageSelection;
217 } } // end of namespace ::sd::slidesorter
219 #endif