1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sfx2/dockwin.hxx>
23 #include <tools/svborder.hxx>
24 #include <vcl/vclptr.hxx>
30 class TitledDockingWindow final
: public SfxDockingWindow
33 /** Create a new docking window.
35 Used, among others, to determine the ViewShellBase and
36 PaneManager that manage the new docking window.
38 This child window is the logical container for the new docking
41 The parent window of the new docking window.
46 SfxBindings
* i_pBindings
,
47 SfxChildWindow
* i_pChildWindow
,
48 vcl::Window
* i_pParent
,
49 const OUString
& rsTitle
52 virtual ~TitledDockingWindow() override
;
53 virtual void dispose() override
;
55 /** returns the content window, which is to be used as parent window for any content to be displayed
56 in the docking window.
58 vcl::Window
& GetContentWindow() { return *m_aContentWindow
; }
59 const vcl::Window
& GetContentWindow() const { return *m_aContentWindow
; }
61 /** Return the border that is painted around the inner window as
64 const SvBorder
& GetDecorationBorder() const { return m_aBorder
; }
66 /** When docked the given range is passed to the parent SplitWindow.
68 void SetValidSizeRange (const Range
& rValidSizeRange
);
70 enum Orientation
{ HorizontalOrientation
, VerticalOrientation
, UnknownOrientation
};
71 /** When the TitledDockingWindow is docked and managed by a split window
72 it can derive its orientation from the orientation of the split
73 window and return either HorizontalOrientation or
75 Otherwise UnknownOrientation is returned.
77 Orientation
GetOrientation() const;
79 void SetTitle(const OUString
& i_rText
);
82 // Window overridables
83 virtual void Paint(vcl::RenderContext
& rRenderContext
, const ::tools::Rectangle
& i_rArea
) override
;
84 virtual void Resize() override
;
85 virtual void StateChanged( StateChangedType i_nType
) override
;
86 virtual void DataChanged( const DataChangedEvent
& i_rDataChangedEvent
) override
;
87 virtual void SetText( const OUString
& i_rText
) override
;
88 virtual void MouseButtonDown (const MouseEvent
& rEvent
) override
;
89 virtual void ApplySettings(vcl::RenderContext
& rRenderContext
) override
;
90 /** internal version of ResetToolBox
92 void impl_resetToolBox();
94 DECL_LINK(OnToolboxItemSelected
, ToolBox
*, void);
99 VclPtr
<ToolBox
> m_aToolbox
;
100 VclPtr
<Window
> m_aContentWindow
;
102 /** The border that is painted around the inner window. The bevel
103 shadow lines are part of the border, so where the border is 0 no
104 such line is painted.
108 /** Height of the title bar. Calculated in impl_layout().
110 int m_nTitleBarHeight
;
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */