bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / inc / framework / TaskPanelResource.hxx
blob36eecf6b1c9b8897d4e33edc4e432729c0f0026b
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #include <cppuhelper/compbase1.hxx>
19 #include <cppuhelper/basemutex.hxx>
21 #include "SidebarPanelId.hxx"
23 #include <com/sun/star/drawing/framework/XResource.hpp>
24 #include <boost/scoped_ptr.hpp>
27 namespace css = ::com::sun::star;
28 namespace cssu = ::com::sun::star::uno;
29 namespace cssdf = ::com::sun::star::drawing::framework;
31 class Window;
33 namespace sd { namespace sidebar {
34 class SidebarViewShell;
35 } }
38 namespace sd { namespace framework {
40 typedef ::cppu::WeakComponentImplHelper1 <
41 cssdf::XResource
42 > TaskPanelResourceInterfaceBase;
45 /** A simple wrapper around a legacy task pane control that gives
46 access to that control (via GetControl()).
48 class TaskPanelResource
49 : private ::cppu::BaseMutex,
50 public TaskPanelResourceInterfaceBase
52 public:
53 /** Create a resource object that represents the legacy taskpane
54 panel.
55 @param rxResourceId
56 drawing framework resource id
57 @param pControl
58 The new TaskPanelResource object takes ownership for this control.
60 TaskPanelResource (
61 sidebar::SidebarViewShell& rSidebarViewShell,
62 sidebar::PanelId ePanelId,
63 const cssu::Reference<cssdf::XResourceId>& rxResourceId);
64 virtual ~TaskPanelResource (void);
65 virtual void SAL_CALL disposing (void);
67 // XResource
68 virtual cssu::Reference<cssdf::XResourceId> SAL_CALL getResourceId (void) throw (cssu::RuntimeException);
69 virtual sal_Bool SAL_CALL isAnchorOnly () throw (cssu::RuntimeException);
71 ::Window* GetControl (void) const;
73 private:
74 const cssu::Reference<cssdf::XResourceId> mxResourceId;
75 // Using auto_ptr because it has release(), what scoped_ptr doesn't.
76 ::std::auto_ptr< ::Window> mpControl;
78 DECL_LINK(WindowEventHandler,VclWindowEvent*);
81 } } // end of namespace sd::framework