1 /*************************************************************************
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * Copyright 2000, 2010 Oracle and/or its affiliates.
5  *
6  * OpenOffice.org - a multi-platform office productivity suite
7  *
8  * This file is part of OpenOffice.org.
9  *
10  * OpenOffice.org is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License version 3
12  * only, as published by the Free Software Foundation.
13  *
14  * OpenOffice.org is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License version 3 for more details
18  * (a copy is included in the LICENSE file that accompanied this code).
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with OpenOffice.org.  If not, see
22  * <http://www.openoffice.org/license.html>
23  * for a copy of the LGPLv3 License.
24  *
25 ************************************************************************/
26 
27 #ifndef SD_WORKBENCH_CTP_PANEL_HXX
28 #define SD_WORKBENCH_CTP_PANEL_HXX
29 
30 /** === begin UNO includes === **/
31 #include <com/sun/star/drawing/framework/XView.hpp>
32 #include <com/sun/star/ui/XToolPanel.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
35 #include <com/sun/star/drawing/framework/XResourceId.hpp>
36 #include <com/sun/star/awt/XPaintListener.hpp>
37 /** === end UNO includes === **/
38 
39 #include <cppuhelper/compbase3.hxx>
40 #include <cppuhelper/basemutex.hxx>
41 
42 #include <boost/scoped_ptr.hpp>
43 
44 //......................................................................................................................
45 namespace sd { namespace colortoolpanel
46 {
47 //......................................................................................................................
48 
49 	//==================================================================================================================
50 	//= class SingleColorPanel
51 	//==================================================================================================================
52     typedef ::cppu::WeakComponentImplHelper3    <   ::com::sun::star::drawing::framework::XView
53                                                 ,   ::com::sun::star::ui::XToolPanel
54                                                 ,   ::com::sun::star::awt::XPaintListener
55                                                 >   SingleColorPanel_Base;
56     class SingleColorPanel  :public ::cppu::BaseMutex
57                             ,public SingleColorPanel_Base
58 	{
59     public:
60         SingleColorPanel(
61             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
62             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XConfigurationController >& i_rConfigController,
63             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& i_rResourceId
64         );
65 
66         // XToolPanel
67         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow(  ) throw (::com::sun::star::uno::RuntimeException);
68         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL createAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& ParentAccessible ) throw (::com::sun::star::uno::RuntimeException);
69 
70         // XView
71         // (no methods)
72 
73         // XResource
74         virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId > SAL_CALL getResourceId(  ) throw (::com::sun::star::uno::RuntimeException);
75         virtual ::sal_Bool SAL_CALL isAnchorOnly(  ) throw (::com::sun::star::uno::RuntimeException);
76 
77         // XPaintListener
78         virtual void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw (::com::sun::star::uno::RuntimeException);
79 
80         // XEventListener
81         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
82 
83         // XComponent equivalents
84         virtual void SAL_CALL disposing();
85 
86     protected:
87         ~SingleColorPanel();
88 
89     private:
90         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >            m_xContext;
91         ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >   m_xResourceId;
92         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >                      m_xWindow;
93 	};
94 
95 //......................................................................................................................
96 } } // namespace sd::colortoolpanel
97 //......................................................................................................................
98 
99 #endif // SD_WORKBENCH_CTP_PANEL_HXX
100