Line data Source code
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 _SFXSPLITWIN_HXX
20 : #define _SFXSPLITWIN_HXX
21 :
22 : #include <vcl/splitwin.hxx>
23 : #include <sfx2/childwin.hxx>
24 :
25 : class SfxWorkWindow;
26 : class SfxDockingWindow;
27 : class SfxDockArr_Impl;
28 : class SfxEmptySplitWin_Impl;
29 : struct SfxDock_Impl;
30 :
31 : class SfxSplitWindow : public SplitWindow
32 : {
33 : friend class SfxEmptySplitWin_Impl;
34 :
35 : private:
36 : SfxChildAlignment eAlign;
37 : SfxWorkWindow* pWorkWin;
38 : SfxDockArr_Impl* pDockArr;
39 : sal_Bool bLocked;
40 : sal_Bool bPinned;
41 : SfxEmptySplitWin_Impl* pEmptyWin;
42 : SfxDockingWindow* pActive;
43 :
44 : void InsertWindow_Impl( SfxDock_Impl* pDockWin,
45 : const Size& rSize,
46 : sal_uInt16 nLine,
47 : sal_uInt16 nPos,
48 : sal_Bool bNewLine=sal_False );
49 :
50 : DECL_LINK( TimerHdl, Timer* );
51 : sal_Bool CursorIsOverRect( sal_Bool bForceAdding = sal_False ) const;
52 : void SetPinned_Impl( sal_Bool );
53 : void SetFadeIn_Impl( sal_Bool );
54 : void SaveConfig_Impl();
55 : void FadeOut_Impl();
56 :
57 : protected:
58 :
59 : virtual void StartSplit();
60 : virtual void SplitResize();
61 : virtual void Split();
62 : virtual void Command ( const CommandEvent& rCEvt );
63 : virtual void MouseButtonDown ( const MouseEvent& );
64 :
65 : public:
66 : SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
67 : SfxWorkWindow *pW, sal_Bool bWithButtons,
68 : WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
69 :
70 : ~SfxSplitWindow();
71 :
72 : void ReleaseWindow_Impl(SfxDockingWindow *pWin, sal_Bool bSaveConfig=sal_True);
73 :
74 : void InsertWindow( SfxDockingWindow* pDockWin,
75 : const Size& rSize);
76 :
77 : void InsertWindow( SfxDockingWindow* pDockWin,
78 : const Size& rSize,
79 : sal_uInt16 nLine,
80 : sal_uInt16 nPos,
81 : sal_Bool bNewLine=sal_False );
82 :
83 : void MoveWindow( SfxDockingWindow* pDockWin,
84 : const Size& rSize,
85 : sal_uInt16 nLine,
86 : sal_uInt16 nPos,
87 : sal_Bool bNewLine=sal_False );
88 :
89 : void RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide=sal_True);
90 :
91 0 : void Lock( sal_Bool bLock=sal_True )
92 : {
93 0 : bLocked = bLock;
94 0 : SetUpdateMode( !bLock );
95 0 : }
96 : using Window::IsLocked;
97 : sal_Bool IsLocked() const { return bLocked; }
98 : sal_Bool GetWindowPos( const SfxDockingWindow* pWindow,
99 : sal_uInt16& rLine, sal_uInt16& rPos ) const;
100 : sal_Bool GetWindowPos( const Point& rTestPos,
101 : sal_uInt16& rLine, sal_uInt16& rPos ) const;
102 : sal_uInt16 GetLineCount() const;
103 : long GetLineSize( sal_uInt16 ) const;
104 : sal_uInt16 GetWindowCount(sal_uInt16 nLine) const;
105 : sal_uInt16 GetWindowCount() const;
106 :
107 3868 : sal_Bool IsPinned() const { return bPinned; }
108 : sal_Bool IsFadeIn() const;
109 : sal_Bool IsAutoHide( sal_Bool bSelf = sal_False ) const;
110 : SplitWindow* GetSplitWindow();
111 :
112 : virtual void AutoHide();
113 : virtual void FadeOut();
114 : virtual void FadeIn();
115 : void Show_Impl();
116 : void Pin_Impl( sal_Bool bPinned );
117 : sal_Bool ActivateNextChild_Impl( sal_Bool bForward = sal_True );
118 : void SetActiveWindow_Impl( SfxDockingWindow* pWin );
119 : };
120 :
121 : #endif // #ifndef _SFXSPLITWIN_HXX
122 :
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|