1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_WORKBENCH_CTP_PANEL_HXX
25 #define SD_WORKBENCH_CTP_PANEL_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/drawing/framework/XView.hpp>
29 #include <com/sun/star/ui/XToolPanel.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
32 #include <com/sun/star/drawing/framework/XResourceId.hpp>
33 #include <com/sun/star/awt/XPaintListener.hpp>
34 /** === end UNO includes === **/
35 
36 #include <cppuhelper/compbase3.hxx>
37 #include <cppuhelper/basemutex.hxx>
38 
39 #include <boost/scoped_ptr.hpp>
40 
41 //......................................................................................................................
42 namespace sd { namespace colortoolpanel
43 {
44 //......................................................................................................................
45 
46 	//==================================================================================================================
47 	//= class SingleColorPanel
48 	//==================================================================================================================
49     typedef ::cppu::WeakComponentImplHelper3    <   ::com::sun::star::drawing::framework::XView
50                                                 ,   ::com::sun::star::ui::XToolPanel
51                                                 ,   ::com::sun::star::awt::XPaintListener
52                                                 >   SingleColorPanel_Base;
53     class SingleColorPanel  :public ::cppu::BaseMutex
54                             ,public SingleColorPanel_Base
55 	{
56     public:
57         SingleColorPanel(
58             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
59             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XConfigurationController >& i_rConfigController,
60             const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& i_rResourceId
61         );
62 
63         // XToolPanel
64         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow(  ) throw (::com::sun::star::uno::RuntimeException);
65         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);
66 
67         // XView
68         // (no methods)
69 
70         // XResource
71         virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId > SAL_CALL getResourceId(  ) throw (::com::sun::star::uno::RuntimeException);
72         virtual ::sal_Bool SAL_CALL isAnchorOnly(  ) throw (::com::sun::star::uno::RuntimeException);
73 
74         // XPaintListener
75         virtual void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw (::com::sun::star::uno::RuntimeException);
76 
77         // XEventListener
78         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
79 
80         // XComponent equivalents
81         virtual void SAL_CALL disposing();
82 
83     protected:
84         ~SingleColorPanel();
85 
86     private:
87         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >            m_xContext;
88         ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >   m_xResourceId;
89         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >                      m_xWindow;
90 	};
91 
92 //......................................................................................................................
93 } } // namespace sd::colortoolpanel
94 //......................................................................................................................
95 
96 #endif // SD_WORKBENCH_CTP_PANEL_HXX
97