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 SD_TASKPANE_CONTROL_CONTAINER_DESCRIPTOR_HXX
21 #define SD_TASKPANE_CONTROL_CONTAINER_DESCRIPTOR_HXX
23 #include "taskpane/ILayoutableWindow.hxx"
24 #include "taskpane/TitleBar.hxx"
25 #include <tools/string.hxx>
26 #include <tools/gen.hxx>
27 #include <vcl/window.hxx>
32 namespace sd
{ namespace toolpanel
{
34 class ControlContainer
;
36 /** Collection of information the describes entries of the tool
37 panel. A descriptor owns the control it is associated with.
39 class ControlContainerDescriptor
41 public virtual ILayoutableWindow
44 /** Create a new descriptor for the given control.
46 The container to inform about selection (caused by mouse
49 The parent window of the new descriptor.
51 The control that is shown when being in the expanded
54 String that is shown as title in the title area above the
57 Type of the title bar. This specifies how the title bar
58 will be formated. For more information see TitleBar.
61 ControlContainerDescriptor (
62 ControlContainer
& rContainer
,
64 ::std::auto_ptr
<ILayoutableWindow
> pControl
,
66 TitleBar::TitleBarType eType
);
68 virtual ~ControlContainerDescriptor (void);
71 virtual Size
GetPreferredSize (void);
72 virtual int GetPreferredWidth (int nHeight
);
73 virtual int GetPreferredHeight (int nWidth
);
74 virtual bool IsResizable (void);
75 virtual ::Window
* GetWindow (void);
77 virtual void Resize (void);
78 virtual void GetFocus (void);
79 virtual void LoseFocus (void);
80 virtual void MouseButtonUp (const MouseEvent
& rMouseEvent
);
81 virtual void KeyInput (const KeyEvent
& rEvent
);
83 void Select (bool bExpansionState
);
85 // const Rectangle& GetTitleBarBox (void) const;
87 Window
* GetControl (void) const;
88 const String
& GetTitle (void) const;
90 void Expand (bool bExpanded
= true);
92 bool IsExpanded (void) const;
94 /** Ownership of the given data remains with the caller. The data
95 is thus not destroyed when the destructor of this class is
98 void SetUserData (void* pUserData
);
99 void* GetUserData (void) const;
101 bool IsVisible (void) const;
102 void SetVisible (bool bVisible
);
104 using Window::GetWindow
;
105 using sd::toolpanel::ILayoutableWindow::GetPreferredWidth
;
106 using sd::toolpanel::ILayoutableWindow::GetPreferredHeight
;
109 ControlContainer
& mrContainer
;
110 ::std::auto_ptr
<TitleBar
> mpTitleBar
;
111 ::std::auto_ptr
<ILayoutableWindow
> mpControl
;
118 /// Do not use! Assignment operator is not supported.
119 const ControlContainerDescriptor
& operator= (
120 const ControlContainerDescriptor
& aDescriptor
);
122 void UpdateStates (void);
124 DECL_LINK(WindowEventListener
, VclSimpleEvent
*);
127 } } // end of namespace ::sd::toolpanel
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */