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/.
10 #ifndef INCLUDED_VCL_LAYOUT_HXX
11 #define INCLUDED_VCL_LAYOUT_HXX
13 #include <vcl/dllapi.h>
14 #include <vcl/button.hxx>
15 #include <vcl/dialog.hxx>
16 #include <vcl/fixed.hxx>
17 #include <vcl/scrbar.hxx>
18 #include <vcl/vclmedit.hxx>
19 #include <vcl/window.hxx>
20 #include <boost/multi_array.hpp>
23 class VCL_DLLPUBLIC VclContainer
: public Window
26 VclContainer(Window
*pParent
, WinBits nStyle
= WB_HIDE
| WB_CLIPCHILDREN
);
28 //These take into account the external margins of the rWindow widget
29 //while GetOptimalSize/get_preferred_size and SetPosSizePixel are
31 static Size
getLayoutRequisition(const Window
&rWindow
);
32 static void setLayoutPosSize(Window
&rWindow
, const Point
&rPos
, const Size
&rSize
);
34 //applies the allocation pos and size onto rWindow via setLayoutPosSize taking into account
35 //the rWindows alignment desires within that allocation
36 static void setLayoutAllocation(Window
&rWindow
, const Point
&rPos
, const Size
&rSize
);
38 void markLayoutDirty()
40 m_bLayoutDirty
= true;
43 virtual void queue_resize() SAL_OVERRIDE
;
45 //these are the two that need to be implemented by
46 //containers, figure out how much space you want...
47 virtual Size
calculateRequisition() const = 0;
48 //..and decide what to do when set to this size
49 virtual void setAllocation(const Size
&rAllocation
) = 0;
51 virtual sal_uInt16
getDefaultAccessibleRole() const SAL_OVERRIDE
;
53 //you don't want to override these
54 virtual Size
GetOptimalSize() const SAL_OVERRIDE
;
55 virtual void SetPosSizePixel(const Point
& rNewPos
, const Size
& rNewSize
) SAL_OVERRIDE
;
56 virtual void SetPosPixel(const Point
& rAllocPos
) SAL_OVERRIDE
;
57 virtual void SetSizePixel(const Size
& rAllocation
) SAL_OVERRIDE
;
62 class VCL_DLLPUBLIC VclBox
: public VclContainer
66 bool m_bVerticalContainer
;
69 VclBox(Window
*pParent
, bool bHomogeneous
, int nSpacing
)
70 : VclContainer(pParent
)
71 , m_bHomogeneous(bHomogeneous
)
72 , m_bVerticalContainer(false)
73 , m_nSpacing(nSpacing
)
76 void set_spacing(int nSpacing
)
78 m_nSpacing
= nSpacing
;
80 int get_spacing() const
84 void set_homogeneous(bool bHomogeneous
)
86 m_bHomogeneous
= bHomogeneous
;
88 bool get_homogeneous() const
90 return m_bHomogeneous
;
92 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
94 virtual sal_uInt16
getDefaultAccessibleRole() const SAL_OVERRIDE
;
95 void accumulateMaxes(const Size
&rChildSize
, Size
&rSize
) const;
96 Size
finalizeMaxes(const Size
&rSize
, sal_uInt16 nVisibleChildren
) const;
98 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
99 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
101 virtual long getPrimaryDimension(const Size
&rSize
) const = 0;
102 virtual void setPrimaryDimension(Size
&rSize
, long) const = 0;
103 virtual long getPrimaryCoordinate(const Point
&rPos
) const = 0;
104 virtual void setPrimaryCoordinate(Point
&rPos
, long) const = 0;
105 virtual long getSecondaryDimension(const Size
&rSize
) const = 0;
106 virtual void setSecondaryDimension(Size
&rSize
, long) const = 0;
107 virtual long getSecondaryCoordinate(const Point
&rPos
) const = 0;
108 virtual void setSecondaryCoordinate(Point
&rPos
, long) const = 0;
110 virtual bool getPrimaryDimensionChildExpand(const Window
&rWindow
) const = 0;
113 class VCL_DLLPUBLIC VclVBox
: public VclBox
116 VclVBox(Window
*pParent
, bool bHomogeneous
= false, int nSpacing
= 0)
117 : VclBox(pParent
, bHomogeneous
, nSpacing
)
119 m_bVerticalContainer
= true;
122 virtual long getPrimaryDimension(const Size
&rSize
) const SAL_OVERRIDE
124 return rSize
.getHeight();
126 virtual void setPrimaryDimension(Size
&rSize
, long nHeight
) const SAL_OVERRIDE
128 rSize
.setHeight(nHeight
);
130 virtual long getPrimaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
134 virtual void setPrimaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
138 virtual long getSecondaryDimension(const Size
&rSize
) const SAL_OVERRIDE
140 return rSize
.getWidth();
142 virtual void setSecondaryDimension(Size
&rSize
, long nWidth
) const SAL_OVERRIDE
144 rSize
.setWidth(nWidth
);
146 virtual long getSecondaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
150 virtual void setSecondaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
154 virtual bool getPrimaryDimensionChildExpand(const Window
&rWindow
) const SAL_OVERRIDE
156 return rWindow
.get_expand() || rWindow
.get_vexpand();
160 class VCL_DLLPUBLIC VclHBox
: public VclBox
163 VclHBox(Window
*pParent
, bool bHomogeneous
= false, int nSpacing
= 0)
164 : VclBox(pParent
, bHomogeneous
, nSpacing
)
166 m_bVerticalContainer
= false;
169 virtual long getPrimaryDimension(const Size
&rSize
) const SAL_OVERRIDE
171 return rSize
.getWidth();
173 virtual void setPrimaryDimension(Size
&rSize
, long nWidth
) const SAL_OVERRIDE
175 rSize
.setWidth(nWidth
);
177 virtual long getPrimaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
181 virtual void setPrimaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
185 virtual long getSecondaryDimension(const Size
&rSize
) const SAL_OVERRIDE
187 return rSize
.getHeight();
189 virtual void setSecondaryDimension(Size
&rSize
, long nHeight
) const SAL_OVERRIDE
191 rSize
.setHeight(nHeight
);
193 virtual long getSecondaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
197 virtual void setSecondaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
201 virtual bool getPrimaryDimensionChildExpand(const Window
&rWindow
) const SAL_OVERRIDE
203 return rWindow
.get_expand() || rWindow
.get_hexpand();
207 enum VclButtonBoxStyle
209 VCL_BUTTONBOX_DEFAULT_STYLE
,
210 VCL_BUTTONBOX_SPREAD
,
217 class VCL_DLLPUBLIC VclButtonBox
: public VclBox
220 VclButtonBox(Window
*pParent
, int nSpacing
)
221 : VclBox(pParent
, false, nSpacing
)
222 , m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE
)
225 void set_layout(VclButtonBoxStyle eStyle
)
227 m_eLayoutStyle
= eStyle
;
229 VclButtonBoxStyle
get_layout() const
231 return m_eLayoutStyle
;
233 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
234 void sort_native_button_order();
236 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
237 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
238 Size
addSpacing(const Size
&rSize
, sal_uInt16 nVisibleChildren
) const;
240 VclButtonBoxStyle m_eLayoutStyle
;
243 std::vector
<long> m_aMainGroupDimensions
;
244 std::vector
<long> m_aSubGroupDimensions
;
245 Size m_aMainGroupSize
;
246 Size m_aSubGroupSize
;
248 Requisition
calculatePrimarySecondaryRequisitions() const;
249 Size
addReqGroups(const VclButtonBox::Requisition
&rReq
) const;
252 class VCL_DLLPUBLIC VclVButtonBox
: public VclButtonBox
255 VclVButtonBox(Window
*pParent
, int nSpacing
= 0)
256 : VclButtonBox(pParent
, nSpacing
)
258 m_bVerticalContainer
= true;
261 virtual long getPrimaryDimension(const Size
&rSize
) const SAL_OVERRIDE
263 return rSize
.getHeight();
265 virtual void setPrimaryDimension(Size
&rSize
, long nHeight
) const SAL_OVERRIDE
267 rSize
.setHeight(nHeight
);
269 virtual long getPrimaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
273 virtual void setPrimaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
277 virtual long getSecondaryDimension(const Size
&rSize
) const SAL_OVERRIDE
279 return rSize
.getWidth();
281 virtual void setSecondaryDimension(Size
&rSize
, long nWidth
) const SAL_OVERRIDE
283 rSize
.setWidth(nWidth
);
285 virtual long getSecondaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
289 virtual void setSecondaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
293 virtual bool getPrimaryDimensionChildExpand(const Window
&rWindow
) const SAL_OVERRIDE
295 return rWindow
.get_expand() || rWindow
.get_vexpand();
299 class VCL_DLLPUBLIC VclHButtonBox
: public VclButtonBox
302 VclHButtonBox(Window
*pParent
, int nSpacing
= 0)
303 : VclButtonBox(pParent
, nSpacing
)
305 m_bVerticalContainer
= false;
308 virtual long getPrimaryDimension(const Size
&rSize
) const SAL_OVERRIDE
310 return rSize
.getWidth();
312 virtual void setPrimaryDimension(Size
&rSize
, long nWidth
) const SAL_OVERRIDE
314 rSize
.setWidth(nWidth
);
316 virtual long getPrimaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
320 virtual void setPrimaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
324 virtual long getSecondaryDimension(const Size
&rSize
) const SAL_OVERRIDE
326 return rSize
.getHeight();
328 virtual void setSecondaryDimension(Size
&rSize
, long nHeight
) const SAL_OVERRIDE
330 rSize
.setHeight(nHeight
);
332 virtual long getSecondaryCoordinate(const Point
&rPos
) const SAL_OVERRIDE
336 virtual void setSecondaryCoordinate(Point
&rPos
, long nPos
) const SAL_OVERRIDE
340 virtual bool getPrimaryDimensionChildExpand(const Window
&rWindow
) const SAL_OVERRIDE
342 return rWindow
.get_expand() || rWindow
.get_hexpand();
346 class VCL_DLLPUBLIC VclGrid
: public VclContainer
349 bool m_bRowHomogeneous
;
350 bool m_bColumnHomogeneous
;
352 int m_nColumnSpacing
;
357 sal_Int32 nSpanWidth
;
358 sal_Int32 nSpanHeight
;
367 typedef boost::multi_array
<GridEntry
, 2> array_type
;
369 struct ExtendedGridEntry
: GridEntry
380 typedef boost::multi_array
<ExtendedGridEntry
, 2> ext_array_type
;
382 array_type
assembleGrid() const;
383 bool isNullGrid(const array_type
& A
) const;
389 Value() : m_nValue(0), m_bExpand(false) {}
392 void calcMaxs(const array_type
&A
, std::vector
<Value
> &rWidths
, std::vector
<Value
> &rHeights
) const;
394 Size
calculateRequisitionForSpacings(sal_Int32 nRowSpacing
, sal_Int32 nColSpacing
) const;
395 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
396 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
398 VclGrid(Window
*pParent
)
399 : VclContainer(pParent
)
400 , m_bRowHomogeneous(false), m_bColumnHomogeneous(false)
401 , m_nRowSpacing(0), m_nColumnSpacing(0)
404 void set_row_homogeneous(bool bHomogeneous
)
406 m_bRowHomogeneous
= bHomogeneous
;
408 void set_column_homogeneous(bool bHomogeneous
)
410 m_bColumnHomogeneous
= bHomogeneous
;
412 bool get_row_homogeneous() const
414 return m_bRowHomogeneous
;
416 bool get_column_homogeneous() const
418 return m_bColumnHomogeneous
;
420 void set_row_spacing(int nSpacing
)
422 m_nRowSpacing
= nSpacing
;
424 void set_column_spacing(int nSpacing
)
426 m_nColumnSpacing
= nSpacing
;
428 int get_row_spacing() const
430 return m_nRowSpacing
;
432 int get_column_spacing() const
434 return m_nColumnSpacing
;
436 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
439 VCL_DLLPUBLIC
void setGridAttach(Window
&rWidget
, sal_Int32 nLeft
, sal_Int32 nTop
,
440 sal_Int32 nWidth
= 1, sal_Int32 nHeight
= 1);
442 class VCL_DLLPUBLIC VclBin
: public VclContainer
445 VclBin(Window
*pParent
, WinBits nStyle
= WB_HIDE
| WB_CLIPCHILDREN
)
446 : VclContainer(pParent
, nStyle
)
449 virtual Window
*get_child();
450 virtual const Window
*get_child() const;
451 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
452 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
455 class VCL_DLLPUBLIC VclFrame
: public VclBin
460 friend class VclBuilder
;
461 void designate_label(Window
*pWindow
);
463 VclFrame(Window
*pParent
)
468 void set_label(const OUString
&rLabel
);
469 OUString
get_label() const;
470 virtual Window
*get_child() SAL_OVERRIDE
;
471 virtual const Window
*get_child() const SAL_OVERRIDE
;
472 Window
*get_label_widget();
473 const Window
*get_label_widget() const;
475 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
476 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
477 virtual OUString
getDefaultAccessibleName() const SAL_OVERRIDE
;
480 class VCL_DLLPUBLIC VclAlignment
: public VclBin
483 VclAlignment(Window
*pParent
)
485 , m_nBottomPadding(0)
495 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
497 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
498 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
500 sal_Int32 m_nBottomPadding
;
501 sal_Int32 m_nLeftPadding
;
502 sal_Int32 m_nRightPadding
;
503 sal_Int32 m_nTopPadding
;
510 class VCL_DLLPUBLIC VclExpander
: public VclBin
513 VclExpander(Window
*pParent
)
515 , m_bResizeTopLevel(true)
516 , m_aDisclosureButton(this)
518 m_aDisclosureButton
.SetToggleHdl(LINK(this, VclExpander
, ClickHdl
));
519 m_aDisclosureButton
.Show();
521 virtual Window
*get_child() SAL_OVERRIDE
;
522 virtual const Window
*get_child() const SAL_OVERRIDE
;
523 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
524 bool get_expanded() const
526 return m_aDisclosureButton
.IsChecked();
528 void set_expanded(bool bExpanded
)
530 m_aDisclosureButton
.Check(bExpanded
);
532 void set_label(const OUString
& rLabel
)
534 m_aDisclosureButton
.SetText(rLabel
);
536 OUString
get_label() const
538 return m_aDisclosureButton
.GetText();
540 virtual void StateChanged(StateChangedType nType
) SAL_OVERRIDE
;
541 void SetExpandedHdl( const Link
& rLink
) { maExpandedHdl
= rLink
; }
542 const Link
& GetExpandedHdl() const { return maExpandedHdl
; }
544 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
545 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
547 bool m_bResizeTopLevel
;
548 DisclosureButton m_aDisclosureButton
;
550 DECL_DLLPRIVATE_LINK(ClickHdl
, DisclosureButton
* pBtn
);
553 class VCL_DLLPUBLIC VclScrolledWindow
: public VclBin
556 VclScrolledWindow(Window
*pParent
, WinBits nStyle
= WB_HIDE
| WB_CLIPCHILDREN
| WB_AUTOHSCROLL
| WB_AUTOVSCROLL
);
557 virtual Window
*get_child() SAL_OVERRIDE
;
558 virtual const Window
*get_child() const SAL_OVERRIDE
;
559 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
560 ScrollBar
& getVertScrollBar() { return m_aVScroll
; }
561 ScrollBar
& getHorzScrollBar() { return m_aHScroll
; }
562 Size
getVisibleChildSize() const;
563 //set to true to disable the built-in scrolling callbacks to allow the user
565 void setUserManagedScrolling(bool bUserManagedScrolling
) { m_bUserManagedScrolling
= bUserManagedScrolling
;}
567 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
568 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
569 DECL_LINK(ScrollBarHdl
, void *);
570 void InitScrollBars(const Size
&rRequest
);
571 virtual bool Notify(NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
573 bool m_bUserManagedScrolling
;
574 ScrollBar m_aVScroll
;
575 ScrollBar m_aHScroll
;
576 ScrollBarBox m_aScrollBarBox
;
579 //Enforces that its children are always the same size as itself.
580 //Intercepts any Commands intended for its children.
582 //by default the Commands are discarded, inherit from this
583 //and implement "Command" to get them
584 class VCL_DLLPUBLIC VclEventBox
: public VclBin
587 //Any Commands an EventBoxHelper receives are forwarded to its parent
588 //The VclEventBox ensures that m_aEventBoxHelper is the
589 //first child and is transparent, but covers the rest of the children
590 class EventBoxHelper
: public Window
593 EventBoxHelper(Window
* pParent
)
596 SetSizePixel(pParent
->GetSizePixel());
597 EnableChildTransparentMode();
598 SetPaintTransparent(true);
601 virtual void Command(const CommandEvent
& rCEvt
) SAL_OVERRIDE
603 GetParent()->Command(rCEvt
);
607 EventBoxHelper m_aEventBoxHelper
;
609 VclEventBox(Window
* pParent
)
611 , m_aEventBoxHelper(this)
613 m_aEventBoxHelper
.Show();
615 virtual Window
*get_child() SAL_OVERRIDE
;
616 virtual const Window
*get_child() const SAL_OVERRIDE
;
617 virtual Size
calculateRequisition() const SAL_OVERRIDE
;
618 virtual void setAllocation(const Size
&rAllocation
) SAL_OVERRIDE
;
620 virtual void Command(const CommandEvent
& rCEvt
) SAL_OVERRIDE
;
623 enum VclSizeGroupMode
626 VCL_SIZE_GROUP_HORIZONTAL
,
627 VCL_SIZE_GROUP_VERTICAL
,
631 class VCL_DLLPUBLIC VclSizeGroup
634 std::set
<Window
*> m_aWindows
;
635 bool m_bIgnoreHidden
;
636 VclSizeGroupMode m_eMode
;
638 void trigger_queue_resize();
641 : m_bIgnoreHidden(false)
642 , m_eMode(VCL_SIZE_GROUP_HORIZONTAL
)
645 void insert(Window
*pWindow
)
647 m_aWindows
.insert(pWindow
);
649 void erase(Window
*pWindow
)
651 m_aWindows
.erase(pWindow
);
653 const std::set
<Window
*>& get_widgets() const
657 std::set
<Window
*>& get_widgets()
661 void set_ignore_hidden(bool bIgnoreHidden
);
662 bool get_ignore_hidden() const
664 return m_bIgnoreHidden
;
666 void set_mode(VclSizeGroupMode eMode
);
667 VclSizeGroupMode
get_mode() const
671 bool set_property(const OString
&rKey
, const OString
&rValue
);
681 VCL_BUTTONS_OK_CANCEL
688 VCL_MESSAGE_QUESTION
,
692 class VCL_DLLPUBLIC MessageDialog
: public Dialog
695 VclButtonsType m_eButtonsType
;
696 VclMessageType m_eMessageType
;
697 VclBox
*m_pOwnedContentArea
;
698 VclButtonBox
*m_pOwnedActionArea
;
700 FixedImage
* m_pImage
;
701 VclMultiLineEdit
* m_pPrimaryMessage
;
702 VclMultiLineEdit
* m_pSecondaryMessage
;
703 std::vector
<PushButton
*> m_aOwnedButtons
;
704 std::map
<const Window
*, short> m_aResponses
;
705 OUString m_sPrimaryString
;
706 OUString m_sSecondaryString
;
707 DECL_DLLPRIVATE_LINK(ButtonHdl
, Button
*);
708 void setButtonHandlers(VclButtonBox
*pButtonBox
);
709 short get_response(const Window
*pWindow
) const;
710 void create_owned_areas();
713 MessageDialog(Window
* pParent
,
714 const OUString
&rMessage
,
715 VclMessageType eMessageType
= VCL_MESSAGE_ERROR
,
716 VclButtonsType eButtonsType
= VCL_BUTTONS_OK
,
717 WinBits nStyle
= WB_MOVEABLE
| WB_3DLOOK
| WB_CLOSEABLE
);
718 MessageDialog(Window
* pParent
, WinBits nStyle
= WB_MOVEABLE
| WB_3DLOOK
| WB_CLOSEABLE
);
719 MessageDialog(Window
* pParent
, const OString
& rID
, const OUString
& rUIXMLDescription
);
720 virtual bool set_property(const OString
&rKey
, const OString
&rValue
) SAL_OVERRIDE
;
721 virtual short Execute() SAL_OVERRIDE
;
722 ///Emitted when an action widget is clicked
723 virtual void response(short nResponseId
);
724 OUString
get_primary_text() const;
725 OUString
get_secondary_text() const;
726 void set_primary_text(const OUString
&rPrimaryString
);
727 void set_secondary_text(const OUString
&rSecondaryString
);
728 virtual ~MessageDialog();
730 static void SetMessagesWidths(Window
*pParent
, VclMultiLineEdit
*pPrimaryMessage
,
731 VclMultiLineEdit
*pSecondaryMessage
);
734 VCL_DLLPUBLIC Size
bestmaxFrameSizeForScreenSize(const Size
&rScreenSize
);
736 //Get first window of a pTopLevel window as
737 //if any intermediate layout widgets didn't exist
738 //i.e. acts like pChild = pChild->GetWindow(WINDOW_FIRSTCHILD);
739 //in a flat hierarchy where dialogs only have one layer
741 VCL_DLLPUBLIC Window
* firstLogicalChildOfParent(Window
*pTopLevel
);
743 //Get next window after pChild of a pTopLevel window as
744 //if any intermediate layout widgets didn't exist
745 //i.e. acts like pChild = pChild->GetWindow(WINDOW_NEXT);
746 //in a flat hierarchy where dialogs only have one layer
748 VCL_DLLPUBLIC Window
* nextLogicalChildOfParent(Window
*pTopLevel
, Window
*pChild
);
750 //Get previous window before pChild of a pTopLevel window as
751 //if any intermediate layout widgets didn't exist
752 //i.e. acts like pChild = pChild->GetWindow(WINDOW_PREV);
753 //in a flat hierarchy where dialogs only have one layer
755 VCL_DLLPUBLIC Window
* prevLogicalChildOfParent(Window
*pTopLevel
, Window
*pChild
);
757 //Returns true is the Window has a single child which is a container
758 VCL_DLLPUBLIC
bool isLayoutEnabled(const Window
*pWindow
);
760 VCL_DLLPUBLIC
inline bool isContainerWindow(const Window
&rWindow
)
762 WindowType eType
= rWindow
.GetType();
763 return (eType
== WINDOW_CONTAINER
|| eType
== WINDOW_SCROLLWINDOW
);
766 VCL_DLLPUBLIC
inline bool isContainerWindow(const Window
*pWindow
)
768 return pWindow
&& isContainerWindow(*pWindow
);
771 //Returns true if the containing dialog is doing its initial
772 //layout and isn't visible yet
773 VCL_DLLPUBLIC
bool isInitialLayout(const Window
*pWindow
);
775 // retro-fitting utilities
777 //Get a Size which is large enough to contain all children with
778 //an equal amount of space at top left and bottom right
779 Size
getLegacyBestSizeForChildren(const Window
&rWindow
);
781 //Get first parent which is not a layout widget
782 VCL_DLLPUBLIC Window
* getNonLayoutParent(Window
*pParent
);
784 //Get first real parent which is not a layout widget
785 Window
* getNonLayoutRealParent(Window
*pParent
);
787 //return true if this window and its stack of containers are all shown
788 bool isVisibleInLayout(const Window
*pWindow
);
790 //return true if this window and its stack of containers are all enabled
791 bool isEnabledInLayout(const Window
*pWindow
);
795 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */