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 .
19 #ifndef INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
20 #define INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
22 #include <vcl/splitwin.hxx>
23 #include <sfx2/childwin.hxx>
25 #include <boost/ptr_container/ptr_vector.hpp>
28 class SfxDockingWindow
;
29 class SfxEmptySplitWin_Impl
;
34 VclPtr
<SfxDockingWindow
> pWin
; // SplitWindow has this window
36 bool bHide
; // SplitWindow had this window
40 typedef boost::ptr_vector
<SfxDock_Impl
> SfxDockArr_Impl
;
42 class SfxSplitWindow
: public SplitWindow
44 friend class SfxEmptySplitWin_Impl
;
47 SfxChildAlignment eAlign
;
48 SfxWorkWindow
* pWorkWin
;
49 SfxDockArr_Impl
* pDockArr
;
52 VclPtr
<SfxEmptySplitWin_Impl
> pEmptyWin
;
53 VclPtr
<SfxDockingWindow
> pActive
;
55 void InsertWindow_Impl( SfxDock_Impl
* pDockWin
,
59 bool bNewLine
=false );
61 DECL_LINK_TYPED( TimerHdl
, Timer
*, void );
62 bool CursorIsOverRect( bool bForceAdding
= false ) const;
63 void SetPinned_Impl( bool );
64 void SetFadeIn_Impl( bool );
65 void SaveConfig_Impl();
70 virtual void StartSplit() SAL_OVERRIDE
;
71 virtual void SplitResize() SAL_OVERRIDE
;
72 virtual void Split() SAL_OVERRIDE
;
73 virtual void Command ( const CommandEvent
& rCEvt
) SAL_OVERRIDE
;
74 virtual void MouseButtonDown ( const MouseEvent
& ) SAL_OVERRIDE
;
77 SfxSplitWindow( vcl::Window
* pParent
, SfxChildAlignment eAl
,
78 SfxWorkWindow
*pW
, bool bWithButtons
,
79 WinBits nBits
= WB_BORDER
| WB_SIZEABLE
| WB_3DLOOK
);
81 virtual ~SfxSplitWindow();
82 virtual void dispose() SAL_OVERRIDE
;
84 void ReleaseWindow_Impl(SfxDockingWindow
*pWin
, bool bSaveConfig
=true);
86 void InsertWindow( SfxDockingWindow
* pDockWin
,
89 void InsertWindow( SfxDockingWindow
* pDockWin
,
93 bool bNewLine
=false );
95 void MoveWindow( SfxDockingWindow
* pDockWin
,
99 bool bNewLine
=false );
101 void RemoveWindow( SfxDockingWindow
* pDockWin
, bool bHide
=true);
103 void Lock( bool bLock
=true )
106 SetUpdateMode( !bLock
);
108 using Window::IsLocked
;
109 bool IsLocked() const { return bLocked
; }
110 bool GetWindowPos( const SfxDockingWindow
* pWindow
,
111 sal_uInt16
& rLine
, sal_uInt16
& rPos
) const;
112 bool GetWindowPos( const Point
& rTestPos
,
113 sal_uInt16
& rLine
, sal_uInt16
& rPos
) const;
114 sal_uInt16
GetLineCount() const;
115 long GetLineSize( sal_uInt16
) const;
116 sal_uInt16
GetWindowCount(sal_uInt16 nLine
) const;
117 sal_uInt16
GetWindowCount() const;
119 bool IsPinned() const { return bPinned
; }
120 bool IsFadeIn() const;
121 bool IsAutoHide( bool bSelf
= false ) const;
122 SplitWindow
* GetSplitWindow();
124 virtual void AutoHide() SAL_OVERRIDE
;
125 virtual void FadeOut() SAL_OVERRIDE
;
126 virtual void FadeIn() SAL_OVERRIDE
;
127 void Pin_Impl( bool bPinned
);
128 bool ActivateNextChild_Impl( bool bForward
= true );
129 void SetActiveWindow_Impl( SfxDockingWindow
* pWin
);
132 #endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */