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 : #ifndef INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_PLCTRL_HXX
29 : #define INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_PLCTRL_HXX
30 :
31 : #include <cppuhelper/weak.hxx>
32 : #include <plugin/multiplx.hxx>
33 : #include <com/sun/star/beans/PropertyValues.hpp>
34 : #include <com/sun/star/beans/XPropertySet.hpp>
35 : #include <com/sun/star/beans/PropertyValue.hpp>
36 : #include <com/sun/star/beans/PropertyState.hpp>
37 : #include <com/sun/star/beans/XPropertySetInfo.hpp>
38 : #include <com/sun/star/beans/XMultiPropertySet.hpp>
39 : #include <com/sun/star/beans/XFastPropertySet.hpp>
40 : #include <com/sun/star/beans/XVetoableChangeListener.hpp>
41 : #include <com/sun/star/beans/XPropertyState.hpp>
42 : #include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
43 : #include <com/sun/star/beans/PropertyAttribute.hpp>
44 : #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
45 : #include <com/sun/star/beans/XPropertyChangeListener.hpp>
46 : #include <com/sun/star/beans/XPropertyAccess.hpp>
47 : #include <com/sun/star/beans/XPropertyContainer.hpp>
48 : #include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
49 : #include <com/sun/star/beans/PropertyChangeEvent.hpp>
50 : #include <com/sun/star/awt/XVclContainerPeer.hpp>
51 : #include <com/sun/star/awt/XVclWindowPeer.hpp>
52 : #include <com/sun/star/awt/XControlModel.hpp>
53 : #include <com/sun/star/awt/XUnoControlContainer.hpp>
54 : #include <com/sun/star/awt/XControlContainer.hpp>
55 : #include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
56 : #include <com/sun/star/awt/XVclContainer.hpp>
57 : #include <com/sun/star/awt/XControl.hpp>
58 : #include <com/sun/star/awt/XTopWindow.hpp>
59 : #include <com/sun/star/awt/XWindow.hpp>
60 : #include <com/sun/star/awt/PosSize.hpp>
61 :
62 : #include <cppuhelper/implbase4.hxx>
63 : #include <vcl/vclptr.hxx>
64 :
65 : #include <list>
66 :
67 : class SystemChildWindow;
68 :
69 :
70 : class PluginControl_Impl : public ::cppu::WeakAggImplHelper4<
71 : ::com::sun::star::awt::XControl,
72 : ::com::sun::star::awt::XWindow,
73 : ::com::sun::star::awt::XFocusListener,
74 : ::com::sun::star::awt::XView >
75 : {
76 : public:
77 : // ::com::sun::star::awt::XControl
78 0 : virtual void SAL_CALL setContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xContext ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
79 0 : { _xContext = xContext; }
80 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getContext() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
81 0 : { return _xContext; }
82 :
83 : virtual sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & Model ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE = 0;
84 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE = 0;
85 :
86 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView > SAL_CALL getView() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
87 0 : { return static_cast<com::sun::star::awt::XView*>(this); }
88 :
89 0 : virtual sal_Bool SAL_CALL isTransparent() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
90 0 : { return sal_False; }
91 :
92 : virtual void SAL_CALL setDesignMode( sal_Bool bOn ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
93 0 : virtual sal_Bool SAL_CALL isDesignMode() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
94 0 : { return _bInDesignMode; }
95 :
96 : virtual void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > & xToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > & Parent) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
97 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getPeer() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
98 0 : { return _xPeer; }
99 :
100 : // ::com::sun::star::awt::XWindow
101 : virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
102 : virtual void SAL_CALL setEnable( sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
103 : virtual void SAL_CALL setFocus() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
104 :
105 : virtual void SAL_CALL setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_, sal_Int32 nHeight_, sal_Int16 nFlags ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
106 : virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
107 :
108 : virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
109 : virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
110 : virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
111 : virtual void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
112 : virtual void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
113 : virtual void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
114 : virtual void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
115 : virtual void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
116 : virtual void SAL_CALL addMouseMotionListener( const Reference< ::com::sun::star::awt::XMouseMotionListener > & l ) throw( RuntimeException, std::exception ) SAL_OVERRIDE;
117 : virtual void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
118 : virtual void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
119 : virtual void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
120 :
121 : // ::com::sun::star::lang::XEventListener
122 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject & rSource ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
123 : // ::com::sun::star::awt::XFocusListener
124 : virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent & rEvt ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
125 : virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent & rEvt ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
126 :
127 : // ::com::sun::star::lang::XComponent
128 : virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
129 : virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & l ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
130 :
131 : virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
132 :
133 : // ::com::sun::star::awt::XView
134 0 : virtual sal_Bool SAL_CALL setGraphics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > & /*aDevice*/ ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
135 0 : { return sal_False; }
136 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
137 0 : { return ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > (); }
138 :
139 0 : virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
140 0 : { return ::com::sun::star::awt::Size(_nWidth, _nHeight); }
141 :
142 : virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
143 : virtual void SAL_CALL setZoom( float ZoomX, float ZoomY ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
144 :
145 : public:
146 : PluginControl_Impl();
147 : virtual ~PluginControl_Impl();
148 :
149 : MRCListenerMultiplexerHelper* getMultiplexer();
150 :
151 : protected:
152 : void releasePeer();
153 :
154 : protected:
155 : ::std::list< Reference< ::com::sun::star::lang::XEventListener > > _aDisposeListeners;
156 : MRCListenerMultiplexerHelper* _pMultiplexer;
157 :
158 : Reference< XInterface > _xContext;
159 :
160 : sal_Int32 _nX;
161 : sal_Int32 _nY;
162 : sal_Int32 _nWidth;
163 : sal_Int32 _nHeight;
164 : sal_Int16 _nFlags;
165 :
166 : bool _bVisible;
167 : bool _bInDesignMode;
168 : bool _bEnable;
169 :
170 : VclPtr<SystemChildWindow> _pSysChild;
171 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xPeer;
172 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xPeerWindow;
173 :
174 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xParentWindow;
175 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xParentPeer;
176 : };
177 :
178 : #endif
179 :
180 :
181 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|