Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <com/sun/star/presentation/XSlideShowController.hpp>
31 : :
32 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 : : #include <com/sun/star/beans/XPropertySet.hpp>
34 : : #include <comphelper/processfactory.hxx>
35 : :
36 : : #include "PresentationViewShell.hxx"
37 : : #include "optsitem.hxx"
38 : : #include "sddll.hxx"
39 : : #include <sfx2/request.hxx>
40 : : #include <sfx2/dispatch.hxx>
41 : :
42 : : #include <sfx2/objface.hxx>
43 : :
44 : : #include <svx/svxids.hrc>
45 : : #ifndef SD_FRAME_VIEW
46 : : #include "FrameView.hxx"
47 : : #endif
48 : : #include "sdresid.hxx"
49 : : #include "DrawDocShell.hxx"
50 : : #include "slideshow.hxx"
51 : : #include "sdattr.hxx"
52 : : #include "sdpage.hxx"
53 : : #include "drawdoc.hxx"
54 : : #include "drawview.hxx"
55 : : #include "app.hrc"
56 : : #include "strings.hrc"
57 : : #include "glob.hrc"
58 : : #include "ViewShellBase.hxx"
59 : : #include "FactoryIds.hxx"
60 : :
61 : : #include "fupoor.hxx"
62 : : #include "Window.hxx"
63 : :
64 : : #define PresentationViewShell
65 : : using namespace sd;
66 : : #include "sdslots.hxx"
67 : :
68 : : using ::rtl::OUString;
69 : : using namespace ::com::sun::star::uno;
70 : : using namespace ::com::sun::star::lang;
71 : : using namespace ::com::sun::star::beans;
72 : : using namespace ::com::sun::star::presentation;
73 : :
74 : : namespace sd {
75 : :
76 : : // -------------------
77 : : // - PresentationViewShell -
78 : : // -------------------
79 : :
80 [ + + ][ + - ]: 150 : SFX_IMPL_INTERFACE( PresentationViewShell, DrawViewShell, SdResId( STR_PRESVIEWSHELL ) )
[ + - ][ + - ]
81 : : {
82 [ + - ]: 25 : SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD |
83 : : SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
84 [ + - ]: 25 : SdResId(RID_DRAW_TOOLBOX));
85 [ + - ]: 25 : SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER | SFX_VISIBILITY_READONLYDOC,
86 [ + - ]: 25 : SdResId(RID_DRAW_VIEWER_TOOLBOX) );
87 [ + - ]: 25 : SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OPTIONS | SFX_VISIBILITY_STANDARD |
88 : : SFX_VISIBILITY_SERVER,
89 [ + - ]: 25 : SdResId(RID_DRAW_OPTIONS_TOOLBOX));
90 [ + - ]: 25 : SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_COMMONTASK | SFX_VISIBILITY_STANDARD |
91 : : SFX_VISIBILITY_SERVER,
92 [ + - ]: 25 : SdResId(RID_DRAW_COMMONTASK_TOOLBOX));
93 : 25 : }
94 : :
95 : :
96 [ # # ][ # # ]: 125 : TYPEINIT1( PresentationViewShell, DrawViewShell );
97 : :
98 : 0 : PresentationViewShell::PresentationViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, ::Window* pParentWindow, FrameView* pFrameView)
99 [ # # ]: 0 : : DrawViewShell( pFrame, rViewShellBase, pParentWindow, PK_STANDARD, pFrameView)
100 : : {
101 [ # # ][ # # ]: 0 : if( GetDocSh() && GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
[ # # ][ # # ]
[ # # ]
102 [ # # ][ # # ]: 0 : maOldVisArea = GetDocSh()->GetVisArea( ASPECT_CONTENT );
103 : 0 : meShellType = ST_PRESENTATION;
104 : 0 : }
105 : :
106 : 0 : PresentationViewShell::~PresentationViewShell (void)
107 : : {
108 [ # # ][ # # ]: 0 : if( GetDocSh() && GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !maOldVisArea.IsEmpty() )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
109 [ # # ][ # # ]: 0 : GetDocSh()->SetVisArea( maOldVisArea );
110 [ # # ]: 0 : }
111 : :
112 : 0 : void PresentationViewShell::FinishInitialization( FrameView* pFrameView )
113 : : {
114 : 0 : DrawViewShell::Init(true);
115 : :
116 : : // Use the frame view that comes form the view shell that initiated our
117 : : // creation.
118 [ # # ]: 0 : if (pFrameView != NULL)
119 : : {
120 : 0 : GetFrameView()->Disconnect();
121 : 0 : SetFrameView (pFrameView);
122 : 0 : pFrameView->Connect();
123 : : }
124 : 0 : SetRuler(false);
125 : 0 : WriteFrameViewData();
126 : :
127 : 0 : GetActiveWindow()->GrabFocus();
128 : 0 : }
129 : :
130 : :
131 : 0 : SvxRuler* PresentationViewShell::CreateHRuler(::sd::Window*, sal_Bool)
132 : : {
133 : 0 : return NULL;
134 : : }
135 : :
136 : 0 : SvxRuler* PresentationViewShell::CreateVRuler(::sd::Window*)
137 : : {
138 : 0 : return NULL;
139 : : }
140 : :
141 : :
142 : 0 : void PresentationViewShell::Activate( sal_Bool bIsMDIActivate )
143 : : {
144 : 0 : DrawViewShell::Activate( bIsMDIActivate );
145 : :
146 [ # # ]: 0 : if( bIsMDIActivate )
147 : : {
148 [ # # ]: 0 : SfxBoolItem aItem( SID_NAVIGATOR_INIT, sal_True );
149 : :
150 [ # # ][ # # ]: 0 : GetViewFrame()->GetDispatcher()->Execute( SID_NAVIGATOR_INIT, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
151 : :
152 [ # # ][ # # ]: 0 : rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
153 [ # # ]: 0 : if( xSlideShow.is() )
154 [ # # ][ # # ]: 0 : xSlideShow->activate(GetViewShellBase());
155 : :
156 [ # # ][ # # ]: 0 : if( HasCurrentFunction() )
157 [ # # ][ # # ]: 0 : GetCurrentFunction()->Activate();
[ # # ][ # # ]
158 : : }
159 : :
160 [ # # ]: 0 : if( bIsMDIActivate )
161 : 0 : ReadFrameViewData( mpFrameView );
162 : 0 : GetDocSh()->Connect( this );
163 : 0 : }
164 : :
165 : 0 : void PresentationViewShell::Paint( const Rectangle& rRect, ::sd::Window* )
166 : : {
167 [ # # ][ # # ]: 0 : rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );
168 [ # # ]: 0 : if( xSlideShow.is() )
169 [ # # ]: 0 : xSlideShow->paint(rRect);
170 : 0 : }
171 : :
172 : 0 : void PresentationViewShell::Resize (void)
173 : : {
174 [ # # ]: 0 : ViewShell::Resize(); // do not call DrawViewShell here!
175 : :
176 [ # # ][ # # ]: 0 : rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
177 [ # # ]: 0 : if( xSlideshow.is() )
178 [ # # ]: 0 : xSlideshow->resize(maViewSize);
179 : 0 : }
180 : :
181 : : } // end of namespace sd
182 : :
183 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|