bump product version to 4.2.0.1
[LibreOffice.git] / include / sfx2 / sidebar / SidebarPanelBase.hxx
blob688e1b357b78665f15d820bf2d998e7b7bde38fc
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 .
19 #ifndef INCLUDED_SFX2_SIDEBAR_SIDEBARPANELBASE_HXX
20 #define INCLUDED_SFX2_SIDEBAR_SIDEBARPANELBASE_HXX
22 #include <sfx2/sidebar/EnumContext.hxx>
23 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
25 #include <cppuhelper/compbase4.hxx>
26 #include <cppuhelper/basemutex.hxx>
28 #include <com/sun/star/frame/XController.hpp>
29 #include <com/sun/star/ui/XContextChangeEventListener.hpp>
30 #include <com/sun/star/ui/XUIElement.hpp>
31 #include <com/sun/star/ui/XToolPanel.hpp>
32 #include <com/sun/star/ui/XSidebarPanel.hpp>
34 #include <boost/noncopyable.hpp>
35 #include <boost/function.hpp>
37 namespace cssu = ::com::sun::star::uno;
40 class Window;
42 namespace sfx2 { namespace sidebar {
44 namespace
46 typedef ::cppu::WeakComponentImplHelper4 <
47 css::ui::XContextChangeEventListener,
48 css::ui::XUIElement,
49 css::ui::XToolPanel,
50 css::ui::XSidebarPanel
51 > SidebarPanelBaseInterfaceBase;
54 /** Base class for sidebar panels that provides some convenience
55 functionality.
57 class SFX2_DLLPUBLIC SidebarPanelBase
58 : private ::boost::noncopyable,
59 private ::cppu::BaseMutex,
60 public SidebarPanelBaseInterfaceBase
62 public:
63 static cssu::Reference<css::ui::XUIElement> Create (
64 const ::rtl::OUString& rsResourceURL,
65 const cssu::Reference<css::frame::XFrame>& rxFrame,
66 Window* pControl,
67 const css::ui::LayoutSize& rLayoutSize);
69 // XContextChangeEventListener
70 virtual void SAL_CALL notifyContextChangeEvent (
71 const css::ui::ContextChangeEventObject& rEvent)
72 throw (cssu::RuntimeException);
74 // XEventListener
75 virtual void SAL_CALL disposing (
76 const css::lang::EventObject& rEvent)
77 throw (cssu::RuntimeException);
79 // XUIElement
80 virtual cssu::Reference<css::frame::XFrame> SAL_CALL getFrame (void)
81 throw(cssu::RuntimeException);
82 virtual ::rtl::OUString SAL_CALL getResourceURL (void)
83 throw(cssu::RuntimeException);
84 virtual sal_Int16 SAL_CALL getType (void)
85 throw(cssu::RuntimeException);
86 virtual cssu::Reference<cssu::XInterface> SAL_CALL getRealInterface (void)
87 throw(cssu::RuntimeException);
89 // XToolPanel
90 virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL createAccessible (
91 const cssu::Reference<css::accessibility::XAccessible>& rxParentAccessible)
92 throw(cssu::RuntimeException);
93 virtual cssu::Reference<css::awt::XWindow> SAL_CALL getWindow (void)
94 throw(cssu::RuntimeException);
96 // XSidebarPanel
97 virtual css::ui::LayoutSize SAL_CALL getHeightForWidth (sal_Int32 nWidth)
98 throw(cssu::RuntimeException);
99 virtual sal_Int32 SAL_CALL getMinimalWidth ()
100 throw(cssu::RuntimeException);
102 protected:
103 cssu::Reference<css::frame::XFrame> mxFrame;
105 SidebarPanelBase (
106 const ::rtl::OUString& rsResourceURL,
107 const cssu::Reference<css::frame::XFrame>& rxFrame,
108 Window* pWindow,
109 const css::ui::LayoutSize& rLayoutSize);
110 virtual ~SidebarPanelBase (void);
112 virtual void SAL_CALL disposing (void)
113 throw (cssu::RuntimeException);
115 private:
116 Window* mpControl;
117 const ::rtl::OUString msResourceURL;
118 const css::ui::LayoutSize maLayoutSize;
121 } } // end of namespace sfx2::sidebar
123 #endif
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */