1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_EXAMPLES_CUSTOMPANEL_CTP_PANEL_HXX
21 #define INCLUDED_EXAMPLES_CUSTOMPANEL_CTP_PANEL_HXX
23 #include <com/sun/star/ui/XToolPanel.hpp>
24 #include <com/sun/star/uno/XComponentContext.hpp>
25 #include <com/sun/star/awt/XPaintListener.hpp>
26 #include <com/sun/star/awt/XWindow.hpp>
27 #include <com/sun/star/ui/XUIElement.hpp>
29 #include <cppuhelper/compbase2.hxx>
30 #include <cppuhelper/compbase1.hxx>
31 #include <cppuhelper/basemutex.hxx>
34 namespace sd
{ namespace colortoolpanel
37 typedef ::cppu::WeakComponentImplHelper2
< ::com::sun::star::ui::XToolPanel
38 , ::com::sun::star::awt::XPaintListener
39 > SingleColorPanel_Base
;
40 class SingleColorPanel
:public ::cppu::BaseMutex
41 ,public SingleColorPanel_Base
45 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& i_rContext
,
46 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
>& i_rParentWindow
,
47 const ::sal_Int32 i_nPanelColor
51 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> SAL_CALL
getWindow();
52 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
>& i_rParentAccessible
);
55 virtual void SAL_CALL
windowPaint( const ::com::sun::star::awt::PaintEvent
& e
);
58 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
);
60 // XComponent equivalents
61 virtual void SAL_CALL
disposing();
67 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> m_xWindow
;
68 const sal_Int32 m_nPanelColor
;
71 typedef ::cppu::WeakComponentImplHelper1
< ::com::sun::star::ui::XUIElement
72 > PanelUIElement_Base
;
73 class PanelUIElement
:public ::cppu::BaseMutex
74 ,public PanelUIElement_Base
78 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& i_rContext
,
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
>& i_rParentWindow
,
80 const OUString
& i_rResourceURL
,
81 const ::sal_Int32 i_nPanelColor
85 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> SAL_CALL
getFrame();
86 virtual OUString SAL_CALL
getResourceURL();
87 virtual ::sal_Int16 SAL_CALL
getType();
88 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getRealInterface( );
91 virtual void SAL_CALL
disposing();
97 const OUString m_sResourceURL
;
98 ::com::sun::star::uno::Reference
< ::com::sun::star::ui::XToolPanel
>
103 } } // namespace sd::colortoolpanel
106 #endif // INCLUDED_EXAMPLES_CUSTOMPANEL_CTP_PANEL_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */