bump product version to 7.2.5.1
[LibreOffice.git] / sfx2 / source / inc / splitwin.hxx
blob7d765363fd72b770017da22ed86505f1060ba132
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>
24 #include <sfx2/dockwin.hxx>
26 #include <vector>
27 #include <memory>
29 class SfxWorkWindow;
30 class SfxDockingWindow;
31 class SfxEmptySplitWin_Impl;
33 struct SfxDock_Impl
35 sal_uInt16 nType;
36 VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window
37 bool bNewLine;
38 bool bHide; // SplitWindow had this window
41 class SfxSplitWindow : public SplitWindow
43 friend class SfxEmptySplitWin_Impl;
45 private:
46 SfxChildAlignment eAlign;
47 SfxWorkWindow* pWorkWin;
48 std::vector<std::unique_ptr<SfxDock_Impl> >
49 maDockArr;
50 bool bPinned;
51 VclPtr<SfxEmptySplitWin_Impl> pEmptyWin;
52 VclPtr<SfxDockingWindow> pActive;
54 void InsertWindow_Impl( SfxDock_Impl const * pDockWin,
55 const Size& rSize,
56 sal_uInt16 nLine,
57 sal_uInt16 nPos,
58 bool bNewLine );
60 DECL_LINK( TimerHdl, Timer*, void );
61 bool CursorIsOverRect() const;
62 void SetPinned_Impl( bool );
63 void SetFadeIn_Impl( bool );
64 void SaveConfig_Impl();
65 void FadeOut_Impl();
67 protected:
69 virtual void StartSplit() override;
70 virtual void SplitResize() override;
71 virtual void Split() override;
72 virtual void MouseButtonDown ( const MouseEvent& ) override;
74 public:
75 SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
76 SfxWorkWindow *pW, bool bWithButtons );
78 virtual ~SfxSplitWindow() override;
79 virtual void dispose() override;
81 void ReleaseWindow_Impl(SfxDockingWindow const *pWin, bool bSaveConfig=true);
83 void InsertWindow( SfxDockingWindow* pDockWin,
84 const Size& rSize);
86 void InsertWindow( SfxDockingWindow* pDockWin,
87 const Size& rSize,
88 sal_uInt16 nLine,
89 sal_uInt16 nPos,
90 bool bNewLine );
92 void MoveWindow( SfxDockingWindow* pDockWin,
93 const Size& rSize,
94 sal_uInt16 nLine,
95 sal_uInt16 nPos,
96 bool bNewLine );
98 void RemoveWindow( SfxDockingWindow const * pDockWin, bool bHide=true);
100 void Lock( bool bLock=true )
102 SetUpdateMode( !bLock );
105 bool GetWindowPos( const SfxDockingWindow* pWindow,
106 sal_uInt16& rLine, sal_uInt16& rPos ) const;
107 bool GetWindowPos( const Point& rTestPos,
108 sal_uInt16& rLine, sal_uInt16& rPos ) const;
109 sal_uInt16 GetLineCount() const;
110 tools::Long GetLineSize( sal_uInt16 ) const;
111 sal_uInt16 GetWindowCount(sal_uInt16 nLine) const;
112 sal_uInt16 GetWindowCount() const;
114 bool IsPinned() const { return bPinned; }
115 bool IsFadeIn() const;
116 bool IsAutoHide( bool bSelf ) const;
117 SplitWindow* GetSplitWindow();
119 virtual void FadeOut() override;
120 virtual void FadeIn() override;
121 void SetActiveWindow_Impl( SfxDockingWindow* pWin );
124 #endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */