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 .
20 #ifndef INCLUDED_SFX2_TITLEDOCKWIN_HXX
21 #define INCLUDED_SFX2_TITLEDOCKWIN_HXX
23 #include <sfx2/dllapi.h>
24 #include <sfx2/dockwin.hxx>
26 #include <vcl/toolbox.hxx>
27 #include <vcl/vclptr.hxx>
28 #include <tools/svborder.hxx>
32 class SFX2_DLLPUBLIC TitledDockingWindow
: public SfxDockingWindow
36 SfxBindings
* i_pBindings
, SfxChildWindow
* i_pChildWindow
,
37 vcl::Window
* i_pParent
40 virtual ~TitledDockingWindow() override
;
41 virtual void dispose() override
;
43 /** sets a title to be displayed in the docking window
45 void SetTitle( const OUString
& i_rTitle
);
47 /** returns the content window, which is to be used as parent window for any content to be displayed
48 in the docking window.
50 vcl::Window
& GetContentWindow() { return *m_aContentWindow
.get(); }
51 const vcl::Window
& GetContentWindow() const { return *m_aContentWindow
.get(); }
53 /** Return the border that is painted around the inner window as
56 const SvBorder
& GetDecorationBorder() const { return m_aBorder
; }
59 // Window overridables
60 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& i_rArea
) override
;
61 virtual void Resize() override
;
62 virtual void StateChanged( StateChangedType i_nType
) override
;
63 virtual void DataChanged( const DataChangedEvent
& i_rDataChangedEvent
) override
;
64 virtual void SetText( const OUString
& i_rText
) override
;
66 virtual void ApplySettings(vcl::RenderContext
& rRenderContext
) override
;
68 /** internal version of ResetToolBox
70 void impl_resetToolBox();
73 DECL_LINK( OnToolboxItemSelected
, ToolBox
*, void );
75 void impl_construct();
77 void impl_scheduleLayout();
81 VclPtr
<ToolBox
> m_aToolbox
;
82 VclPtr
<Window
> m_aContentWindow
;
84 /** The border that is painted around the inner window. The bevel
85 shadow lines are part of the border, so where the border is 0 no
90 /** Remember that a layout is pending, i.e. Resize() has been called
91 since the last Paint().
93 bool m_bLayoutPending
;
95 /** Height of the title bar. Calculated in impl_layout().
97 int m_nTitleBarHeight
;
105 #endif // INCLUDED_SFX2_TITLEDOCKWIN_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */