bump product version to 5.0.4.1
[LibreOffice.git] / sfx2 / source / inc / splitwin.hxx
blobbc21c05853a9d8c22fab0bd4c91ff2d68b4148b7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
27 class SfxWorkWindow;
28 class SfxDockingWindow;
29 class SfxEmptySplitWin_Impl;
31 struct SfxDock_Impl
33 sal_uInt16 nType;
34 VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window
35 bool bNewLine;
36 bool bHide; // SplitWindow had this window
37 long nSize;
40 typedef boost::ptr_vector<SfxDock_Impl> SfxDockArr_Impl;
42 class SfxSplitWindow : public SplitWindow
44 friend class SfxEmptySplitWin_Impl;
46 private:
47 SfxChildAlignment eAlign;
48 SfxWorkWindow* pWorkWin;
49 SfxDockArr_Impl* pDockArr;
50 bool bLocked;
51 bool bPinned;
52 VclPtr<SfxEmptySplitWin_Impl> pEmptyWin;
53 VclPtr<SfxDockingWindow> pActive;
55 void InsertWindow_Impl( SfxDock_Impl* pDockWin,
56 const Size& rSize,
57 sal_uInt16 nLine,
58 sal_uInt16 nPos,
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();
66 void FadeOut_Impl();
68 protected:
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;
76 public:
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,
87 const Size& rSize);
89 void InsertWindow( SfxDockingWindow* pDockWin,
90 const Size& rSize,
91 sal_uInt16 nLine,
92 sal_uInt16 nPos,
93 bool bNewLine=false );
95 void MoveWindow( SfxDockingWindow* pDockWin,
96 const Size& rSize,
97 sal_uInt16 nLine,
98 sal_uInt16 nPos,
99 bool bNewLine=false );
101 void RemoveWindow( SfxDockingWindow* pDockWin, bool bHide=true);
103 void Lock( bool bLock=true )
105 bLocked = bLock;
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: */