Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_PANEL_HXX
20 : #define INCLUDED_SFX2_SOURCE_SIDEBAR_PANEL_HXX
21 :
22 : #include "Context.hxx"
23 : #include <vcl/window.hxx>
24 :
25 : #include <com/sun/star/ui/XUIElement.hpp>
26 : #include <com/sun/star/ui/XSidebarPanel.hpp>
27 :
28 : #include <boost/scoped_ptr.hpp>
29 : #include <boost/shared_ptr.hpp>
30 : #include <vector>
31 :
32 : namespace sfx2 { namespace sidebar {
33 :
34 : class PanelDescriptor;
35 : class TitleBar;
36 : class PanelTitleBar;
37 :
38 : class Panel : public vcl::Window
39 : {
40 : public:
41 : Panel(const PanelDescriptor& rPanelDescriptor, vcl::Window* pParentWindow,
42 : const bool bIsInitiallyExpanded, const std::function<void()>& rDeckLayoutTrigger,
43 : const std::function<Context()>& rContextAccess);
44 : virtual ~Panel();
45 : virtual void dispose() SAL_OVERRIDE;
46 :
47 : PanelTitleBar* GetTitleBar() const;
48 2208 : bool IsTitleBarOptional() const { return mbIsTitleBarOptional;}
49 : void SetUIElement (const css::uno::Reference<css::ui::XUIElement>& rxElement);
50 4636 : css::uno::Reference<css::ui::XSidebarPanel> GetPanelComponent() const { return mxPanelComponent;}
51 : css::uno::Reference<css::awt::XWindow> GetElementWindow();
52 : void SetExpanded (const bool bIsExpanded);
53 8981 : bool IsExpanded() const { return mbIsExpanded;}
54 : bool HasIdPredicate (const OUString& rsId) const;
55 4373 : const OUString& GetId() const { return msPanelId;}
56 :
57 : virtual void Paint (vcl::RenderContext& rRenderContext, const Rectangle& rUpdateArea) SAL_OVERRIDE;
58 : virtual void Resize() SAL_OVERRIDE;
59 : virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
60 : virtual void Activate() SAL_OVERRIDE;
61 : virtual void ApplySettings(vcl::RenderContext& rRenderContext) SAL_OVERRIDE;
62 :
63 : private:
64 : const OUString msPanelId;
65 : VclPtr<PanelTitleBar> mpTitleBar;
66 : const bool mbIsTitleBarOptional;
67 : css::uno::Reference<css::ui::XUIElement> mxElement;
68 : css::uno::Reference<css::ui::XSidebarPanel> mxPanelComponent;
69 : bool mbIsExpanded;
70 : const std::function<void()> maDeckLayoutTrigger;
71 : const std::function<Context()> maContextAccess;
72 : };
73 : typedef std::vector<VclPtr<Panel> > SharedPanelContainer;
74 :
75 : } } // end of namespace sfx2::sidebar
76 :
77 : #endif
78 :
79 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|