fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / inc / SlideSorterViewShell.hxx
blob32c3cc068d316af0b0798a43d2abdf8eeab54195
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef SD_SLIDESORTER_SLIDE_SORTER_VIEW_SHELL_HXX
21 #define SD_SLIDESORTER_SLIDE_SORTER_VIEW_SHELL_HXX
23 #include "ViewShell.hxx"
24 #include "glob.hxx"
25 #include <sfx2/shell.hxx>
26 #include <sfx2/viewfac.hxx>
27 #include <boost/shared_ptr.hpp>
28 #include <vector>
30 namespace sd { namespace slidesorter { namespace controller {
31 class SlotManager;
32 } } }
35 namespace sd { namespace slidesorter {
37 class SlideSorter;
39 class SlideSorterViewShell
40 : public ViewShell
42 friend class controller::SlotManager;
44 public:
45 TYPEINFO();
46 SFX_DECL_INTERFACE(SD_IF_SDSLIDESORTERVIEWSHELL)
48 static ::boost::shared_ptr<SlideSorterViewShell> Create(
49 SfxViewFrame* pFrame,
50 ViewShellBase& rViewShellBase,
51 ::Window* pParentWindow,
52 FrameView* pFrameView,
53 const bool bIsCenterPane);
55 virtual ~SlideSorterViewShell (void);
57 /** Late initialization that has to be called after a new instance has
58 completed its construction.
60 virtual void Init (bool bIsMainViewShell);
62 /** Return a slide sorter that is currently displayed in one of the
63 panes that belong to the given ViewShellBase object.
64 When there is only one slide sorter visible then that one is
65 returned. When two (or more) are visible then the one in the center
66 pane is returned. When no slidesorter is visible then NULL is
67 returned.
69 static SlideSorterViewShell* GetSlideSorter (ViewShellBase& rBase);
71 virtual void GetFocus (void);
72 virtual void LoseFocus (void);
73 virtual SdPage* GetActualPage (void);
75 /// inherited from sd::ViewShell
76 virtual SdPage* getCurrentPage() const;
78 void ExecCtrl (SfxRequest& rRequest);
79 virtual void GetCtrlState (SfxItemSet &rSet);
80 virtual void FuSupport (SfxRequest& rRequest);
81 virtual void FuTemporary (SfxRequest& rRequest);
82 virtual void GetStatusBarState (SfxItemSet& rSet);
83 virtual void FuPermanent (SfxRequest& rRequest);
84 void GetAttrState (SfxItemSet& rSet);
85 void ExecStatusBar (SfxRequest& rRequest);
86 virtual void Command (const CommandEvent& rEvent, ::sd::Window* pWindow);
87 virtual void GetMenuState (SfxItemSet &rSet);
88 virtual void GetClipboardState (SfxItemSet &rSet);
90 virtual void ReadFrameViewData (FrameView* pView);
91 virtual void WriteFrameViewData (void);
93 /** Set the zoom factor. The given value is clipped against an upper
94 bound.
95 @param nZoom
96 An integer percent value, i.e. nZoom/100 is the actual zoom
97 factor.
99 virtual void SetZoom (long int nZoom);
100 virtual void SetZoomRect (const Rectangle& rZoomRect);
102 /** This is a callback method used by the active window to delegate its
103 Paint() call to. This view shell itself delegates it to the view.
105 virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin);
107 /** Place and size the controls and windows. You may want to call this
108 method when something has changed that for instance affects the
109 visibility state of the scroll bars.
111 virtual void ArrangeGUIElements (void);
113 virtual void Activate (sal_Bool IsMDIActivate);
114 virtual void Deactivate (sal_Bool IsMDIActivate);
116 //===== Drag and Drop =====================================================
118 virtual void StartDrag (
119 const Point& rDragPt,
120 ::Window* pWindow );
121 virtual void DragFinished (
122 sal_Int8 nDropAction);
123 virtual sal_Int8 AcceptDrop (
124 const AcceptDropEvent& rEvt,
125 DropTargetHelper& rTargetHelper,
126 ::sd::Window* pTargetWindow = NULL,
127 sal_uInt16 nPage = SDRPAGE_NOTFOUND,
128 sal_uInt16 nLayer = SDRPAGE_NOTFOUND );
129 virtual sal_Int8 ExecuteDrop (
130 const ExecuteDropEvent& rEvt,
131 DropTargetHelper& rTargetHelper,
132 ::sd::Window* pTargetWindow = NULL,
133 sal_uInt16 nPage = SDRPAGE_NOTFOUND,
134 sal_uInt16 nLayer = SDRPAGE_NOTFOUND);
136 typedef ::std::vector<SdPage*> PageSelection;
138 /** Return the set of selected pages.
140 ::boost::shared_ptr<PageSelection> GetPageSelection (void) const;
142 void SetPageSelection (const ::boost::shared_ptr<PageSelection>& rSelection);
144 /** Add a listener that is called when the selection of the slide sorter
145 changes.
146 @param rListener
147 When this method is called multiple times for the same listener
148 the second and all following calls are ignored. Each listener
149 is added only once.
151 void AddSelectionChangeListener (const Link& rListener);
153 /** Remove a listener that was called when the selection of the slide
154 sorter changes.
155 @param rListener
156 It is save to pass a listener that was not added are has been
157 removed previously. Such calls are ignored.
159 void RemoveSelectionChangeListener (const Link& rListener);
161 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
163 /** Create an accessible object representing the specified window.
164 @param pWindow
165 The returned object makes the document displayed in this window
166 accessible.
167 @return
168 Returns an <type>AccessibleSlideSorterView</type> object.
170 virtual ::com::sun::star::uno::Reference<
171 ::com::sun::star::accessibility::XAccessible>
172 CreateAccessibleDocumentView (::sd::Window* pWindow);
174 SlideSorter& GetSlideSorter (void) const;
176 /** Try to relocate all toplevel window elements to the given parent
177 window.
179 virtual bool RelocateToParentWindow (::Window* pParentWindow);
181 protected:
183 virtual SvBorder GetBorder (bool bOuterResize);
185 /** This method is overloaded to handle a missing tool bar correctly.
186 This is the case when the slide sorter is not the main view shell.
188 virtual ::svl::IUndoManager* ImpGetUndoManager (void) const;
190 private:
191 ::boost::shared_ptr<SlideSorter> mpSlideSorter;
192 bool mbIsArrangeGUIElementsPending;
194 SlideSorterViewShell (
195 SfxViewFrame* pFrame,
196 ViewShellBase& rViewShellBase,
197 ::Window* pParentWindow,
198 FrameView* pFrameView);
199 void Initialize (void);
201 /** This method overwrites the one from our base class: We do our own
202 scroll bar and the base class call is thus unnecessary. It simply
203 calls UpdateScrollBars(false).
205 virtual void UpdateScrollBars (void);
208 typedef ::boost::shared_ptr<SlideSorterViewShell::PageSelection> SharedPageSelection;
210 } } // end of namespace ::sd::slidesorter
212 #endif
214 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */