update dev300-m58
[ooovba.git] / sdext / source / presenter / PresenterNotesView.hxx
blob4fd2d6feadb25c155b99e21b69e3a411b6b80de5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PresenterNotesView.hxx,v $
11 * $Revision: 1.5 $
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 SDEXT_PRESENTER_NOTES_VIEW2_HXX
33 #define SDEXT_PRESENTER_NOTES_VIEW2_HXX
35 #include "PresenterController.hxx"
36 #include "PresenterToolBar.hxx"
37 #include "PresenterViewFactory.hxx"
38 #include <cppuhelper/basemutex.hxx>
39 #include <cppuhelper/compbase5.hxx>
40 #include <com/sun/star/awt/ActionEvent.hpp>
41 #include <com/sun/star/awt/XActionListener.hpp>
42 #include <com/sun/star/awt/XButton.hpp>
43 #include <com/sun/star/awt/XControl.hpp>
44 #include <com/sun/star/awt/XTextComponent.hpp>
45 #include <com/sun/star/awt/XWindowListener.hpp>
46 #include <com/sun/star/drawing/XDrawPage.hpp>
47 #include <com/sun/star/drawing/XDrawView.hpp>
48 #include <com/sun/star/drawing/framework/XView.hpp>
49 #include <com/sun/star/drawing/framework/XResourceId.hpp>
50 #include <com/sun/star/frame/XController.hpp>
51 #include <rtl/ref.hxx>
52 #include <boost/scoped_ptr.hpp>
54 namespace css = ::com::sun::star;
56 namespace {
57 typedef cppu::WeakComponentImplHelper5<
58 css::awt::XWindowListener,
59 css::awt::XPaintListener,
60 css::drawing::framework::XView,
61 css::drawing::XDrawView,
62 css::awt::XKeyListener
63 > PresenterNotesViewInterfaceBase;
66 namespace sdext { namespace presenter {
68 class PresenterButton;
69 class PresenterScrollBar;
71 /** A drawing framework view of the notes of a slide. At the moment this is
72 a simple text view that does not show the original formatting of the
73 notes text.
75 class PresenterNotesView
76 : private ::cppu::BaseMutex,
77 public PresenterNotesViewInterfaceBase,
78 public CachablePresenterView
80 public:
81 explicit PresenterNotesView (
82 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
83 const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
84 const css::uno::Reference<css::frame::XController>& rxController,
85 const ::rtl::Reference<PresenterController>& rpPresenterController);
86 virtual ~PresenterNotesView (void);
88 virtual void SAL_CALL disposing (void);
90 /** Typically called from setCurrentSlide() with the notes page that is
91 associed with the slide given to setCurrentSlide().
93 Iterates over all text shapes on the given notes page and diplays
94 the concatenated text of these.
96 void SetSlide (
97 const css::uno::Reference<css::drawing::XDrawPage>& rxNotesPage);
99 void ChangeFontSize (const sal_Int32 nSizeChange);
101 // lang::XEventListener
103 virtual void SAL_CALL
104 disposing (const css::lang::EventObject& rEventObject)
105 throw (css::uno::RuntimeException);
108 // XWindowListener
110 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
111 throw (css::uno::RuntimeException);
113 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
114 throw (css::uno::RuntimeException);
116 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
117 throw (css::uno::RuntimeException);
119 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
120 throw (css::uno::RuntimeException);
123 // XPaintListener
125 virtual void SAL_CALL windowPaint (const css::awt::PaintEvent& rEvent)
126 throw (css::uno::RuntimeException);
129 // XResourceId
131 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId (void)
132 throw (css::uno::RuntimeException);
134 virtual sal_Bool SAL_CALL isAnchorOnly (void)
135 throw (com::sun::star::uno::RuntimeException);
138 // XDrawView
140 virtual void SAL_CALL setCurrentPage (
141 const css::uno::Reference<css::drawing::XDrawPage>& rxSlide)
142 throw (css::uno::RuntimeException);
144 virtual css::uno::Reference<css::drawing::XDrawPage> SAL_CALL getCurrentPage (void)
145 throw (css::uno::RuntimeException);
148 // XKeyListener
150 virtual void SAL_CALL keyPressed (const css::awt::KeyEvent& rEvent)
151 throw (css::uno::RuntimeException);
152 virtual void SAL_CALL keyReleased (const css::awt::KeyEvent& rEvent)
153 throw (css::uno::RuntimeException);
155 class BitmapContainer;
156 class BitmapFactory;
158 private:
159 css::uno::Reference<css::drawing::framework::XResourceId> mxViewId;
160 ::rtl::Reference<PresenterController> mpPresenterController;
161 css::uno::Reference<css::awt::XWindow> mxParentWindow;
162 css::uno::Reference<css::rendering::XCanvas> mxCanvas;
163 ::boost::scoped_ptr<BitmapContainer> mpBitmapContainer;
164 ::boost::shared_ptr<BitmapFactory> mpBitmapFactory;
165 css::uno::Reference<css::drawing::XDrawPage> mxCurrentNotesPage;
166 ::rtl::Reference<PresenterScrollBar> mpScrollBar;
167 css::uno::Reference<css::awt::XWindow> mxToolBarWindow;
168 css::uno::Reference<css::rendering::XCanvas> mxToolBarCanvas;
169 ::rtl::Reference<PresenterToolBar> mpToolBar;
170 ::rtl::Reference<PresenterButton> mpCloseButton;
171 css::util::Color maSeparatorColor;
172 sal_Int32 mnSeparatorYLocation;
173 css::geometry::RealRectangle2D maTextBoundingBox;
174 SharedBitmapDescriptor mpBackground;
175 double mnTop;
176 sal_Int32 mnFontSize;
178 void CreateToolBar (
179 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
180 const ::rtl::Reference<PresenterController>& rpPresenterController);
181 void Layout (void);
182 void Paint (const css::awt::Rectangle& rUpdateBox);
183 void PaintToolBar (const css::awt::Rectangle& rUpdateBox);
184 void PaintText (const css::awt::Rectangle& rUpdateBox);
185 void Invalidate (void);
186 void Scroll (const double nDistance);
187 void SetTop (const double nTop);
188 void UpdateScrollBar (void);
190 /** This method throws a DisposedException when the object has already been
191 disposed.
193 void ThrowIfDisposed (void)
194 throw (css::lang::DisposedException);
197 } } // end of namespace ::sdext::presenter
199 #endif