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/function.hpp>
29 : #include <boost/scoped_ptr.hpp>
30 : #include <boost/shared_ptr.hpp>
31 : #include <vector>
32 :
33 :
34 : namespace sfx2 { namespace sidebar {
35 :
36 : class PanelDescriptor;
37 : class TitleBar;
38 : class PanelTitleBar;
39 :
40 :
41 : class Panel
42 : : public vcl::Window
43 : {
44 : public:
45 : Panel (
46 : const PanelDescriptor& rPanelDescriptor,
47 : vcl::Window* pParentWindow,
48 : const bool bIsInitiallyExpanded,
49 : const ::boost::function<void(void)>& rDeckLayoutTrigger,
50 : const ::boost::function<Context(void)>& rContextAccess);
51 : virtual ~Panel (void);
52 :
53 : void Dispose (void);
54 :
55 : PanelTitleBar* GetTitleBar (void) const;
56 14969 : bool IsTitleBarOptional (void) const { return mbIsTitleBarOptional;}
57 : void SetUIElement (const css::uno::Reference<css::ui::XUIElement>& rxElement);
58 19219 : css::uno::Reference<css::ui::XSidebarPanel> GetPanelComponent (void) const { return mxPanelComponent;}
59 : css::uno::Reference<css::awt::XWindow> GetElementWindow (void);
60 : void SetExpanded (const bool bIsExpanded);
61 50050 : bool IsExpanded (void) const { return mbIsExpanded;}
62 : bool HasIdPredicate (const ::rtl::OUString& rsId) const;
63 5972 : const ::rtl::OUString& GetId (void) const { return msPanelId;}
64 :
65 : virtual void Paint (const Rectangle& rUpdateArea) SAL_OVERRIDE;
66 : virtual void Resize (void) SAL_OVERRIDE;
67 : virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
68 : virtual void Activate (void) SAL_OVERRIDE;
69 :
70 : private:
71 : const ::rtl::OUString msPanelId;
72 : ::boost::scoped_ptr<PanelTitleBar> mpTitleBar;
73 : const bool mbIsTitleBarOptional;
74 : css::uno::Reference<css::ui::XUIElement> mxElement;
75 : css::uno::Reference<css::ui::XSidebarPanel> mxPanelComponent;
76 : bool mbIsExpanded;
77 : const ::boost::function<void(void)> maDeckLayoutTrigger;
78 : const ::boost::function<Context(void)> maContextAccess;
79 : };
80 : typedef ::boost::shared_ptr<Panel> SharedPanel;
81 : typedef ::std::vector<SharedPanel> SharedPanelContainer;
82 :
83 :
84 : } } // end of namespace sfx2::sidebar
85 :
86 : #endif
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|