merge the formfield patch from ooo-build
[ooovba.git] / sfx2 / source / inc / splitwin.hxx
blobb1fe78e1a963bc0c76c6b6adac1809c8dda1bf95
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: splitwin.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SFXSPLITWIN_HXX
31 #define _SFXSPLITWIN_HXX
33 #ifndef _SPLITWIN_HXX //autogen
34 #include <vcl/splitwin.hxx>
35 #endif
36 #include <sfx2/childwin.hxx>
38 class SfxWorkWindow;
39 class SfxDockingWindow;
40 class SfxDockArr_Impl;
41 class SfxEmptySplitWin_Impl;
42 struct SfxDock_Impl;
44 class SfxSplitWindow : public SplitWindow
46 friend class SfxEmptySplitWin_Impl;
48 private:
49 SfxChildAlignment eAlign;
50 SfxWorkWindow* pWorkWin;
51 SfxDockArr_Impl* pDockArr;
52 BOOL bLocked;
53 BOOL bPinned;
54 SfxEmptySplitWin_Impl* pEmptyWin;
55 SfxDockingWindow* pActive;
57 void InsertWindow_Impl( SfxDock_Impl* pDockWin,
58 const Size& rSize,
59 USHORT nLine,
60 USHORT nPos,
61 BOOL bNewLine=FALSE );
63 DECL_LINK( TimerHdl, Timer* );
64 BOOL CursorIsOverRect( BOOL bForceAdding = FALSE ) const;
65 void SetPinned_Impl( BOOL );
66 void SetFadeIn_Impl( BOOL );
67 void SaveConfig_Impl();
68 void FadeOut_Impl();
70 protected:
72 virtual void StartSplit();
73 virtual void SplitResize();
74 virtual void Split();
75 virtual void Command ( const CommandEvent& rCEvt );
76 virtual void MouseButtonDown ( const MouseEvent& );
78 public:
79 SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
80 SfxWorkWindow *pW, BOOL bWithButtons,
81 WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
83 ~SfxSplitWindow();
85 void ReleaseWindow_Impl(SfxDockingWindow *pWin, BOOL bSaveConfig=TRUE);
87 void InsertWindow( SfxDockingWindow* pDockWin,
88 const Size& rSize);
90 void InsertWindow( SfxDockingWindow* pDockWin,
91 const Size& rSize,
92 USHORT nLine,
93 USHORT nPos,
94 BOOL bNewLine=FALSE );
96 void MoveWindow( SfxDockingWindow* pDockWin,
97 const Size& rSize,
98 USHORT nLine,
99 USHORT nPos,
100 BOOL bNewLine=FALSE );
102 void RemoveWindow( SfxDockingWindow* pDockWin, BOOL bHide=TRUE);
104 void Lock( BOOL bLock=TRUE )
106 bLocked = bLock;
107 SetUpdateMode( !bLock );
109 using Window::IsLocked;
110 BOOL IsLocked() const { return bLocked; }
111 BOOL GetWindowPos( const SfxDockingWindow* pWindow,
112 USHORT& rLine, USHORT& rPos ) const;
113 BOOL GetWindowPos( const Point& rTestPos,
114 USHORT& rLine, USHORT& rPos ) const;
115 USHORT GetLineCount() const;
116 long GetLineSize( USHORT ) const;
117 USHORT GetWindowCount(USHORT nLine) const;
118 USHORT GetWindowCount() const;
120 BOOL IsPinned() const { return bPinned; }
121 BOOL IsFadeIn() const;
122 BOOL IsAutoHide( BOOL bSelf = FALSE ) const;
123 SplitWindow* GetSplitWindow();
125 virtual void AutoHide();
126 virtual void FadeOut();
127 virtual void FadeIn();
128 void Show_Impl();
129 void Pin_Impl( BOOL bPinned );
130 BOOL ActivateNextChild_Impl( BOOL bForward = TRUE );
131 void SetActiveWindow_Impl( SfxDockingWindow* pWin );
134 #endif // #ifndef _SFXSPLITWIN_HXX