/src/libreoffice/sfx2/source/inc/splitwin.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | #ifndef INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX |
20 | | #define INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX |
21 | | |
22 | | #include <vcl/splitwin.hxx> |
23 | | #include <sfx2/childwin.hxx> |
24 | | #include <sfx2/dockwin.hxx> |
25 | | |
26 | | #include <vector> |
27 | | #include <memory> |
28 | | |
29 | | class SfxWorkWindow; |
30 | | class SfxEmptySplitWin_Impl; |
31 | | |
32 | | struct SfxDock_Impl |
33 | | { |
34 | | sal_uInt16 nType; |
35 | | VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window |
36 | | bool bNewLine; |
37 | | bool bHide; // SplitWindow had this window |
38 | | }; |
39 | | |
40 | | class SfxSplitWindow final : public SplitWindow |
41 | | { |
42 | | friend class SfxEmptySplitWin_Impl; |
43 | | |
44 | | private: |
45 | | SfxChildAlignment eAlign; |
46 | | SfxWorkWindow* pWorkWin; |
47 | | std::vector<std::unique_ptr<SfxDock_Impl> > |
48 | | maDockArr; |
49 | | bool bPinned; |
50 | | VclPtr<SfxEmptySplitWin_Impl> pEmptyWin; |
51 | | VclPtr<SfxDockingWindow> pActive; |
52 | | |
53 | | void InsertWindow_Impl( SfxDock_Impl const * pDockWin, |
54 | | const Size& rSize, |
55 | | sal_uInt16 nLine, |
56 | | sal_uInt16 nPos, |
57 | | bool bNewLine ); |
58 | | |
59 | | DECL_LINK( TimerHdl, Timer*, void ); |
60 | | bool CursorIsOverRect() const; |
61 | | void SetPinned_Impl( bool ); |
62 | | void SetFadeIn_Impl( bool ); |
63 | | void SaveConfig_Impl(); |
64 | | void FadeOut_Impl(); |
65 | | |
66 | | virtual void StartSplit() override; |
67 | | virtual void SplitResize() override; |
68 | | virtual void Split() override; |
69 | | virtual void MouseButtonDown ( const MouseEvent& ) override; |
70 | | |
71 | | public: |
72 | | SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl, |
73 | | SfxWorkWindow *pW, bool bWithButtons ); |
74 | | |
75 | | virtual ~SfxSplitWindow() override; |
76 | | virtual void dispose() override; |
77 | | |
78 | | void ReleaseWindow_Impl(SfxDockingWindow const *pWin, bool bSaveConfig=true); |
79 | | |
80 | | void InsertWindow( SfxDockingWindow* pDockWin, |
81 | | const Size& rSize); |
82 | | |
83 | | void InsertWindow( SfxDockingWindow* pDockWin, |
84 | | const Size& rSize, |
85 | | sal_uInt16 nLine, |
86 | | sal_uInt16 nPos, |
87 | | bool bNewLine ); |
88 | | |
89 | | void MoveWindow( SfxDockingWindow* pDockWin, |
90 | | const Size& rSize, |
91 | | sal_uInt16 nLine, |
92 | | sal_uInt16 nPos, |
93 | | bool bNewLine ); |
94 | | |
95 | | void RemoveWindow( SfxDockingWindow const * pDockWin, bool bHide=true); |
96 | | |
97 | | void Lock( bool bLock=true ) |
98 | 0 | { |
99 | 0 | SetUpdateMode( !bLock ); |
100 | 0 | } |
101 | | |
102 | | bool GetWindowPos( const SfxDockingWindow* pWindow, |
103 | | sal_uInt16& rLine, sal_uInt16& rPos ) const; |
104 | | bool GetWindowPos( const Point& rTestPos, |
105 | | sal_uInt16& rLine, sal_uInt16& rPos ) const; |
106 | | sal_uInt16 GetLineCount() const; |
107 | | tools::Long GetLineSize( sal_uInt16 ) const; |
108 | | sal_uInt16 GetWindowCount(sal_uInt16 nLine) const; |
109 | | sal_uInt16 GetWindowCount() const; |
110 | | |
111 | 0 | bool IsPinned() const { return bPinned; } |
112 | | bool IsFadeIn() const; |
113 | | bool IsAutoHide( bool bSelf ) const; |
114 | | SplitWindow* GetSplitWindow(); |
115 | | |
116 | | virtual void FadeOut() override; |
117 | | virtual void FadeIn() override; |
118 | | void SetActiveWindow_Impl( SfxDockingWindow* pWin ); |
119 | | }; |
120 | | |
121 | | #endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX |
122 | | |
123 | | |
124 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |