bump product version to 4.1.6.2
[LibreOffice.git] / odk / examples / cpp / custompanel / ctp_panel.hxx
blob8ef6aa5fc6e50db40567861aea84a91b4142929e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 SD_WORKBENCH_CTP_PANEL_HXX
21 #define SD_WORKBENCH_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 //......................................................................................................................
35 namespace sd { namespace colortoolpanel
37 //......................................................................................................................
39 //==================================================================================================================
40 //= SingleColorPanel
41 //==================================================================================================================
42 typedef ::cppu::WeakComponentImplHelper2 < ::com::sun::star::ui::XToolPanel
43 , ::com::sun::star::awt::XPaintListener
44 > SingleColorPanel_Base;
45 class SingleColorPanel :public ::cppu::BaseMutex
46 ,public SingleColorPanel_Base
48 public:
49 SingleColorPanel(
50 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
51 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& i_rParentWindow,
52 const ::sal_Int32 i_nPanelColor
55 // XToolPanel
56 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow() throw (::com::sun::star::uno::RuntimeException);
57 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 ) throw (::com::sun::star::uno::RuntimeException);
59 // XPaintListener
60 virtual void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw (::com::sun::star::uno::RuntimeException);
62 // XEventListener
63 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
65 // XComponent equivalents
66 virtual void SAL_CALL disposing();
68 protected:
69 ~SingleColorPanel();
71 private:
72 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWindow;
73 const sal_Int32 m_nPanelColor;
76 //==================================================================================================================
77 //= PanelUIElement
78 //==================================================================================================================
79 typedef ::cppu::WeakComponentImplHelper1 < ::com::sun::star::ui::XUIElement
80 > PanelUIElement_Base;
81 class PanelUIElement :public ::cppu::BaseMutex
82 ,public PanelUIElement_Base
84 public:
85 PanelUIElement(
86 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
87 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& i_rParentWindow,
88 const OUString& i_rResourceURL,
89 const ::sal_Int32 i_nPanelColor
92 // XUIElement
93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException);
94 virtual OUString SAL_CALL getResourceURL() throw (::com::sun::star::uno::RuntimeException);
95 virtual ::sal_Int16 SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
96 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface( ) throw (::com::sun::star::uno::RuntimeException);
98 // OComponentHelper
99 virtual void SAL_CALL disposing();
101 protected:
102 ~PanelUIElement();
104 private:
105 const OUString m_sResourceURL;
106 ::com::sun::star::uno::Reference< ::com::sun::star::ui::XToolPanel >
107 m_xToolPanel;
110 //......................................................................................................................
111 } } // namespace sd::colortoolpanel
112 //......................................................................................................................
114 #endif // SD_WORKBENCH_CTP_PANEL_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */