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_DECK_HXX
20 : #define INCLUDED_SFX2_SOURCE_SIDEBAR_DECK_HXX
21 :
22 : #include "Panel.hxx"
23 :
24 : #include <vcl/window.hxx>
25 : #include <vcl/image.hxx>
26 : #include <com/sun/star/ui/LayoutSize.hpp>
27 :
28 : #include <boost/function.hpp>
29 : #include <boost/scoped_ptr.hpp>
30 :
31 : class ScrollBar;
32 :
33 : namespace sfx2 { namespace sidebar {
34 :
35 : class DeckDescriptor;
36 : class DeckTitleBar;
37 :
38 :
39 : /** This is the parent window of the panels.
40 : It displays the deck title.
41 : */
42 : class Deck
43 : : public vcl::Window
44 : {
45 : public:
46 : Deck (
47 : const DeckDescriptor& rDeckDescriptor,
48 : vcl::Window* pParentWindow,
49 : const ::boost::function<void(void)>& rCloserAction);
50 : virtual ~Deck (void);
51 :
52 : void Dispose (void);
53 :
54 5494 : const ::rtl::OUString& GetId (void) const { return msId;}
55 : DeckTitleBar* GetTitleBar (void) const;
56 : Rectangle GetContentArea (void) const;
57 : void SetPanels (const SharedPanelContainer& rPanels);
58 10980 : const SharedPanelContainer& GetPanels (void) const { return maPanels;}
59 : void RequestLayout (void);
60 : vcl::Window* GetPanelParentWindow (void);
61 :
62 : /** Try to make the panel completely visible.
63 : When the whole panel does not fit then make its top visible
64 : and it off at the bottom.
65 : */
66 : void ShowPanel (const Panel& rPanel);
67 :
68 : virtual void Paint (const Rectangle& rUpdateArea) SAL_OVERRIDE;
69 : virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
70 : virtual bool Notify (NotifyEvent& rEvent) SAL_OVERRIDE;
71 :
72 : void PrintWindowTree();
73 : static void PrintWindowSubTree (vcl::Window* pRoot, int nIndentation);
74 :
75 24996 : sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
76 :
77 : class ScrollContainerWindow : public vcl::Window
78 : {
79 : public:
80 : ScrollContainerWindow (vcl::Window* pParentWindow);
81 : virtual ~ScrollContainerWindow (void);
82 : virtual void Paint (const Rectangle& rUpdateArea) SAL_OVERRIDE;
83 : void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
84 : private:
85 : ::std::vector<sal_Int32> maSeparators;
86 : };
87 :
88 : private:
89 : const ::rtl::OUString msId;
90 : Image maIcon;
91 : sal_Int32 mnMinimalWidth;
92 : SharedPanelContainer maPanels;
93 : ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
94 : ::boost::scoped_ptr<vcl::Window> mpScrollClipWindow;
95 : ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
96 : ::boost::scoped_ptr<vcl::Window> mpFiller;
97 : ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
98 :
99 : DECL_LINK(HandleVerticalScrollBarChange,void*);
100 : bool ProcessWheelEvent(CommandEvent* pCommandEvent);
101 : };
102 :
103 : } } // end of namespace sfx2::sidebar
104 :
105 : #endif
106 :
107 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|