1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PresenterPaneBase.hxx,v $
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 SD_PRESENTER_PRESENTER_PANE_BASE_HXX
33 #define SD_PRESENTER_PRESENTER_PANE_BASE_HXX
35 #include "PresenterTheme.hxx"
36 #include <cppuhelper/basemutex.hxx>
37 #include <cppuhelper/compbase4.hxx>
38 #include <com/sun/star/awt/Point.hpp>
39 #include <com/sun/star/awt/XMouseListener.hpp>
40 #include <com/sun/star/awt/XMouseMotionListener.hpp>
41 #include <com/sun/star/awt/XWindowListener.hpp>
42 #include <com/sun/star/container/XChild.hpp>
43 #include <com/sun/star/drawing/XPresenterHelper.hpp>
44 #include <com/sun/star/drawing/framework/XPane.hpp>
45 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
46 #include <com/sun/star/lang/XInitialization.hpp>
47 #include <com/sun/star/uno/XComponentContext.hpp>
48 #include <com/sun/star/util/Color.hpp>
49 #include <com/sun/star/rendering/XCanvas.hpp>
50 #include <rtl/ref.hxx>
51 #include <boost/noncopyable.hpp>
53 namespace css
= ::com::sun::star
;
54 namespace cssu
= ::com::sun::star::uno
;
57 namespace sdext
{ namespace presenter
{
59 class PresenterController
;
60 class PresenterTextView
;
63 typedef ::cppu::WeakComponentImplHelper4
<
64 css::drawing::framework::XPane
,
65 css::lang::XInitialization
,
66 css::awt::XWindowListener
,
67 css::awt::XPaintListener
68 > PresenterPaneBaseInterfaceBase
;
72 /** Base class of the panes used by the presenter screen. Pane objects are
73 stored in the PresenterPaneContainer. Sizes and positions are
74 controlled by the PresenterWindowManager. Interactive positioning and
75 resizing is managed by the PresenterPaneBorderManager. Borders around
76 panes are painted by the PresenterPaneBorderPainter.
78 class PresenterPaneBase
79 : protected ::cppu::BaseMutex
,
80 private ::boost::noncopyable
,
81 public PresenterPaneBaseInterfaceBase
85 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
86 const ::rtl::Reference
<PresenterController
>& rpPresenterController
);
87 virtual ~PresenterPaneBase (void);
89 virtual void SAL_CALL
disposing (void);
91 css::uno::Reference
<css::awt::XWindow
> GetBorderWindow (void) const;
92 void SetBackground (const SharedBitmapDescriptor
& rpBackground
);
93 void SetTitle (const ::rtl::OUString
& rsTitle
);
94 ::rtl::OUString
GetTitle (void) const;
95 css::uno::Reference
<css::drawing::framework::XPaneBorderPainter
> GetPaneBorderPainter (void) const;
96 void SetCalloutAnchor (const css::awt::Point
& rAnchorPosition
);
97 css::awt::Point
GetCalloutAnchor (void) const;
99 ::boost::shared_ptr
<PresenterTextView
> GetTextViewForTitle (void);
103 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
)
104 throw (css::uno::Exception
, css::uno::RuntimeException
);
109 virtual css::uno::Reference
<css::drawing::framework::XResourceId
> SAL_CALL
getResourceId (void)
110 throw (css::uno::RuntimeException
);
112 virtual sal_Bool SAL_CALL
isAnchorOnly (void)
113 throw (com::sun::star::uno::RuntimeException
);
118 virtual void SAL_CALL
windowResized (const css::awt::WindowEvent
& rEvent
)
119 throw (css::uno::RuntimeException
);
121 virtual void SAL_CALL
windowMoved (const css::awt::WindowEvent
& rEvent
)
122 throw (css::uno::RuntimeException
);
124 virtual void SAL_CALL
windowShown (const css::lang::EventObject
& rEvent
)
125 throw (css::uno::RuntimeException
);
127 virtual void SAL_CALL
windowHidden (const css::lang::EventObject
& rEvent
)
128 throw (css::uno::RuntimeException
);
131 // lang::XEventListener
133 virtual void SAL_CALL
disposing (const css::lang::EventObject
& rEvent
)
134 throw (css::uno::RuntimeException
);
138 ::rtl::Reference
<PresenterController
> mpPresenterController
;
139 css::uno::Reference
<css::awt::XWindow
> mxParentWindow
;
140 css::uno::Reference
<css::awt::XWindow
> mxBorderWindow
;
141 css::uno::Reference
<css::rendering::XCanvas
> mxBorderCanvas
;
142 css::uno::Reference
<css::awt::XWindow
> mxContentWindow
;
143 css::uno::Reference
<css::rendering::XCanvas
> mxContentCanvas
;
144 css::uno::Reference
<css::drawing::framework::XResourceId
> mxPaneId
;
145 css::uno::Reference
<css::drawing::framework::XPaneBorderPainter
> mxBorderPainter
;
146 css::uno::Reference
<css::drawing::XPresenterHelper
> mxPresenterHelper
;
147 ::rtl::OUString msTitle
;
148 css::uno::Reference
<css::uno::XComponentContext
> mxComponentContext
;
149 SharedBitmapDescriptor mpViewBackground
;
151 css::awt::Point maCalloutAnchor
;
153 virtual void CreateCanvases (
154 const css::uno::Reference
<css::awt::XWindow
>& rxParentWindow
,
155 const css::uno::Reference
<css::rendering::XSpriteCanvas
>& rxParentCanvas
) = 0;
158 const css::uno::Reference
<css::awt::XWindow
>& rxParentWindow
,
159 const bool bIsWindowVisibleOnCreation
);
160 void PaintBorderBackground (
161 const css::awt::Rectangle
& rCenterBox
,
162 const css::awt::Rectangle
& rUpdateBox
);
163 void PaintBorder (const css::awt::Rectangle
& rUpdateRectangle
);
165 void LayoutContextWindow (void);
166 bool IsVisible (void) const;
168 /** This method throws a DisposedException when the object has already been
171 void ThrowIfDisposed (void)
172 throw (css::lang::DisposedException
);
175 } } // end of namespace ::sd::presenter