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
;
56 namespace sdext
{ namespace presenter
{
58 class PresenterController
;
61 typedef ::cppu::WeakComponentImplHelper4
<
62 css::drawing::framework::XPane
,
63 css::lang::XInitialization
,
64 css::awt::XWindowListener
,
65 css::awt::XPaintListener
66 > PresenterPaneBaseInterfaceBase
;
70 /** Base class of the panes used by the presenter screen. Pane objects are
71 stored in the PresenterPaneContainer. Sizes and positions are
72 controlled by the PresenterWindowManager. Interactive positioning and
73 resizing is managed by the PresenterPaneBorderManager. Borders around
74 panes are painted by the PresenterPaneBorderPainter.
76 class PresenterPaneBase
77 : protected ::cppu::BaseMutex
,
78 private ::boost::noncopyable
,
79 public PresenterPaneBaseInterfaceBase
83 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
84 const ::rtl::Reference
<PresenterController
>& rpPresenterController
);
85 virtual ~PresenterPaneBase (void);
87 virtual void SAL_CALL
disposing (void);
89 css::uno::Reference
<css::awt::XWindow
> GetBorderWindow (void) const;
90 void SetBackground (const SharedBitmapDescriptor
& rpBackground
);
91 void SetTitle (const ::rtl::OUString
& rsTitle
);
92 css::uno::Reference
<css::drawing::framework::XPaneBorderPainter
> GetPaneBorderPainter (void) const;
93 void SetCalloutAnchor (const css::awt::Point
& rAnchorPosition
);
94 css::awt::Point
GetCalloutAnchor (void) const;
98 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
)
99 throw (css::uno::Exception
, css::uno::RuntimeException
);
104 virtual css::uno::Reference
<css::drawing::framework::XResourceId
> SAL_CALL
getResourceId (void)
105 throw (css::uno::RuntimeException
);
107 virtual sal_Bool SAL_CALL
isAnchorOnly (void)
108 throw (com::sun::star::uno::RuntimeException
);
113 virtual void SAL_CALL
windowResized (const css::awt::WindowEvent
& rEvent
)
114 throw (css::uno::RuntimeException
);
116 virtual void SAL_CALL
windowMoved (const css::awt::WindowEvent
& rEvent
)
117 throw (css::uno::RuntimeException
);
119 virtual void SAL_CALL
windowShown (const css::lang::EventObject
& rEvent
)
120 throw (css::uno::RuntimeException
);
122 virtual void SAL_CALL
windowHidden (const css::lang::EventObject
& rEvent
)
123 throw (css::uno::RuntimeException
);
126 // lang::XEventListener
127 virtual void SAL_CALL
disposing (const css::lang::EventObject
& rEvent
)
128 throw (css::uno::RuntimeException
);
131 ::rtl::Reference
<PresenterController
> mpPresenterController
;
132 css::uno::Reference
<css::awt::XWindow
> mxParentWindow
;
133 css::uno::Reference
<css::awt::XWindow
> mxBorderWindow
;
134 css::uno::Reference
<css::rendering::XCanvas
> mxBorderCanvas
;
135 css::uno::Reference
<css::awt::XWindow
> mxContentWindow
;
136 css::uno::Reference
<css::rendering::XCanvas
> mxContentCanvas
;
137 css::uno::Reference
<css::drawing::framework::XResourceId
> mxPaneId
;
138 css::uno::Reference
<css::drawing::framework::XPaneBorderPainter
> mxBorderPainter
;
139 css::uno::Reference
<css::drawing::XPresenterHelper
> mxPresenterHelper
;
140 ::rtl::OUString msTitle
;
141 css::uno::Reference
<css::uno::XComponentContext
> mxComponentContext
;
142 SharedBitmapDescriptor mpViewBackground
;
144 css::awt::Point maCalloutAnchor
;
146 virtual void CreateCanvases (
147 const css::uno::Reference
<css::awt::XWindow
>& rxParentWindow
,
148 const css::uno::Reference
<css::rendering::XSpriteCanvas
>& rxParentCanvas
) = 0;
151 const css::uno::Reference
<css::awt::XWindow
>& rxParentWindow
,
152 const bool bIsWindowVisibleOnCreation
);
153 void PaintBorderBackground (
154 const css::awt::Rectangle
& rCenterBox
,
155 const css::awt::Rectangle
& rUpdateBox
);
156 void PaintBorder (const css::awt::Rectangle
& rUpdateRectangle
);
158 void LayoutContextWindow (void);
159 bool IsVisible (void) const;
161 /** This method throws a DisposedException when the object has already been
164 void ThrowIfDisposed (void)
165 throw (css::lang::DisposedException
);
168 } } // end of namespace ::sd::presenter