Line data Source code
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 : #ifndef INCLUDED_SD_SOURCE_UI_INC_OUTLINEVIEWSHELL_HXX
21 : #define INCLUDED_SD_SOURCE_UI_INC_OUTLINEVIEWSHELL_HXX
22 :
23 : #include "DrawDocShell.hxx"
24 : #include "ViewShell.hxx"
25 : #include "OutlineView.hxx"
26 :
27 : class SdPage;
28 : class TransferableDataHelper;
29 : class TransferableClipboardListener;
30 :
31 : namespace sd {
32 :
33 : /** Show a textual overview of the text contents of all slides.
34 : */
35 : class OutlineViewShell
36 : : public ViewShell
37 : {
38 : public:
39 : TYPEINFO_OVERRIDE();
40 :
41 : SFX_DECL_VIEWFACTORY(OutlineViewShell);
42 36 : SFX_DECL_INTERFACE(SD_IF_SDOUTLINEVIEWSHELL)
43 :
44 : private:
45 : /// SfxInterface initializer.
46 : static void InitInterface_Impl();
47 :
48 : public:
49 : /** Create a new view shell for the outline mode.
50 : @param rViewShellBase
51 : The new object will be stacked on this view shell base.
52 : @param pFrameView
53 : The frame view that makes it possible to pass information from
54 : one view shell to the next.
55 : */
56 : OutlineViewShell (
57 : SfxViewFrame* pFrame,
58 : ViewShellBase& rViewShellBase,
59 : ::vcl::Window* pParentWindow,
60 : FrameView* pFrameView = NULL);
61 :
62 : virtual ~OutlineViewShell (void);
63 :
64 : virtual void Shutdown (void) SAL_OVERRIDE;
65 :
66 : virtual void Paint(const Rectangle& rRect, ::sd::Window* pWin) SAL_OVERRIDE;
67 :
68 : /** Arrange and resize the GUI elements like rulers, sliders, and
69 : buttons as well as the actual document view according to the size of
70 : the enclosing window and current sizes of buttons, rulers, and
71 : sliders.
72 : */
73 : virtual void ArrangeGUIElements (void) SAL_OVERRIDE;
74 :
75 : virtual bool PrepareClose( bool bUI = true ) SAL_OVERRIDE;
76 :
77 : virtual long VirtHScrollHdl(ScrollBar* pHScroll) SAL_OVERRIDE;
78 : virtual long VirtVScrollHdl(ScrollBar* pVHScroll) SAL_OVERRIDE;
79 :
80 : virtual void AddWindow(::sd::Window* pWin);
81 : virtual void RemoveWindow(::sd::Window* pWin);
82 :
83 : virtual void Activate( bool IsMDIActivate ) SAL_OVERRIDE;
84 : virtual void Deactivate( bool IsMDIActivate ) SAL_OVERRIDE;
85 :
86 : virtual SdPage* GetActualPage() SAL_OVERRIDE;
87 :
88 : /// inherited from sd::ViewShell
89 : virtual SdPage* getCurrentPage() const SAL_OVERRIDE;
90 :
91 : void ExecCtrl(SfxRequest &rReq);
92 : void GetCtrlState(SfxItemSet &rSet);
93 : void GetMenuState(SfxItemSet &rSet);
94 : void GetAttrState(SfxItemSet &rSet);
95 : void GetState (SfxItemSet& rSet);
96 :
97 : void ExecStatusBar(SfxRequest& rReq);
98 : void GetStatusBarState(SfxItemSet& rSet);
99 :
100 : void FuTemporary(SfxRequest &rReq);
101 : void FuTemporaryModify(SfxRequest &rReq);
102 : void FuPermanent(SfxRequest &rReq);
103 : void FuSupport(SfxRequest &rReq);
104 :
105 : virtual void SetZoom(long nZoom) SAL_OVERRIDE;
106 : virtual void SetZoomRect(const Rectangle& rZoomRect) SAL_OVERRIDE;
107 : virtual OUString GetSelectionText( bool bCompleteWords = false );
108 : virtual bool HasSelection( bool bText = true ) const;
109 :
110 : void Execute(SfxRequest& rReq);
111 :
112 : virtual void ReadFrameViewData(FrameView* pView) SAL_OVERRIDE;
113 : virtual void WriteFrameViewData() SAL_OVERRIDE;
114 :
115 : virtual void Command( const CommandEvent& rCEvt, ::sd::Window* pWin ) SAL_OVERRIDE;
116 : virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) SAL_OVERRIDE;
117 : virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) SAL_OVERRIDE;
118 :
119 : sal_uLong Read(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat);
120 :
121 : virtual void WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, bool bBrowse = false ) SAL_OVERRIDE;
122 : virtual void ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, bool bBrowse = false ) SAL_OVERRIDE;
123 :
124 : /** this method is called when the visible area of the view from this viewshell is changed */
125 : virtual void VisAreaChanged(const Rectangle& rRect) SAL_OVERRIDE;
126 :
127 : /** Create an accessible object representing the specified window.
128 : @param pWindow
129 : The returned object makes the document displayed in this window
130 : accessible.
131 : @return
132 : Returns an <type>AccessibleDrawDocumentView</type> object.
133 : */
134 : virtual ::com::sun::star::uno::Reference<
135 : ::com::sun::star::accessibility::XAccessible>
136 : CreateAccessibleDocumentView (::sd::Window* pWindow) SAL_OVERRIDE;
137 :
138 : OUString m_StrOldPageName;
139 :
140 : /** Update the preview to show the specified page.
141 : */
142 : virtual void UpdatePreview (SdPage* pPage, bool bInit = false) SAL_OVERRIDE;
143 :
144 : virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void) SAL_OVERRIDE;
145 :
146 : /** Make the given page the new current page. This method
147 : notifies the controller and adapts the selection of the
148 : model.
149 : @param pPage
150 : The new current page. Pass NULL when there is no current page.
151 : */
152 : void SetCurrentPage (SdPage* pPage);
153 :
154 : bool UpdateTitleObject( SdPage* pPage, Paragraph* pPara );
155 : bool UpdateOutlineObject( SdPage* pPage, Paragraph* pPara );
156 :
157 : private:
158 : void ShowSlideShow(SfxRequest& rReq);
159 : OutlineView* pOlView;
160 : SdPage* pLastPage; // For efficient processing of the preview
161 : TransferableClipboardListener* pClipEvtLstnr;
162 : bool bPastePossible;
163 : bool mbInitialized;
164 :
165 : void Construct (DrawDocShell* pDocSh);
166 : DECL_LINK( ClipboardChanged, TransferableDataHelper* );
167 : };
168 :
169 : } // end of namespace sd
170 :
171 : #endif
172 :
173 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|