xref: /trunk/main/sfx2/source/inc/splitwin.hxx (revision 353d8f4d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SFXSPLITWIN_HXX
24 #define _SFXSPLITWIN_HXX
25 
26 #ifndef _SPLITWIN_HXX //autogen
27 #include <vcl/splitwin.hxx>
28 #endif
29 #include <sfx2/childwin.hxx>
30 
31 class SfxWorkWindow;
32 class SfxDockingWindow;
33 class SfxDockArr_Impl;
34 class SfxEmptySplitWin_Impl;
35 struct SfxDock_Impl;
36 
37 class SfxSplitWindow : public SplitWindow
38 {
39 friend class SfxEmptySplitWin_Impl;
40 
41 private:
42 	SfxChildAlignment 	eAlign;
43 	SfxWorkWindow*		pWorkWin;
44 	SfxDockArr_Impl*	pDockArr;
45 	sal_Bool				bLocked;
46 	sal_Bool				bPinned;
47 	SfxEmptySplitWin_Impl*	pEmptyWin;
48 	SfxDockingWindow*	pActive;
49 
50 	void				InsertWindow_Impl( SfxDock_Impl* pDockWin,
51 							const Size& rSize,
52 							sal_uInt16 nLine,
53 							sal_uInt16 nPos,
54 							sal_Bool bNewLine=sal_False );
55 
56 	DECL_LINK(			TimerHdl, Timer* );
57 	sal_Bool				CursorIsOverRect( sal_Bool bForceAdding = sal_False ) const;
58 	void				SetPinned_Impl( sal_Bool );
59 	void				SetFadeIn_Impl( sal_Bool );
60 	void				SaveConfig_Impl();
61 	void				FadeOut_Impl();
62 
63 protected:
64 
65 	virtual void		StartSplit();
66 	virtual void		SplitResize();
67 	virtual void 		Split();
68 	virtual void		Command ( const CommandEvent& rCEvt );
69 	virtual void		MouseButtonDown ( const MouseEvent& );
70 
71 public:
72 						SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
73 							SfxWorkWindow *pW, sal_Bool bWithButtons,
74 							WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
75 
76 						~SfxSplitWindow();
77 
78 	void				ReleaseWindow_Impl(SfxDockingWindow *pWin, sal_Bool bSaveConfig=sal_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 							sal_Bool bNewLine=sal_False );
88 
89 	void				MoveWindow( SfxDockingWindow* pDockWin,
90 							const Size& rSize,
91 							sal_uInt16 nLine,
92 							sal_uInt16 nPos,
93 							sal_Bool bNewLine=sal_False );
94 
95 	void				RemoveWindow( SfxDockingWindow* pDockWin, sal_Bool bHide=sal_True);
96 
Lock(sal_Bool bLock=sal_True)97 	void				Lock( sal_Bool bLock=sal_True )
98 						{
99 							bLocked = bLock;
100 							SetUpdateMode( !bLock );
101 						}
102         using Window::IsLocked;
IsLocked() const103 	sal_Bool				IsLocked() const { return bLocked; }
104 	sal_Bool				GetWindowPos( const SfxDockingWindow* pWindow,
105 									  sal_uInt16& rLine, sal_uInt16& rPos ) const;
106 	sal_Bool				GetWindowPos( const Point& rTestPos,
107 									  sal_uInt16& rLine, sal_uInt16& rPos ) const;
108 	sal_uInt16				GetLineCount() const;
109 	long				GetLineSize( sal_uInt16 ) const;
110 	sal_uInt16				GetWindowCount(sal_uInt16 nLine) const;
111 	sal_uInt16				GetWindowCount() const;
112 
IsPinned() const113 	sal_Bool				IsPinned() const { return bPinned; }
114 	sal_Bool				IsFadeIn() const;
115 	sal_Bool				IsAutoHide( sal_Bool bSelf = sal_False ) const;
116 	SplitWindow*		GetSplitWindow();
117 
118 	virtual void		AutoHide();
119 	virtual void		FadeOut();
120 	virtual void		FadeIn();
121 	void				Show_Impl();
122 	void				Pin_Impl( sal_Bool bPinned );
123 	sal_Bool				ActivateNextChild_Impl( sal_Bool bForward = sal_True );
124 	void				SetActiveWindow_Impl( SfxDockingWindow* pWin );
125 };
126 
127 #endif // #ifndef _SFXSPLITWIN_HXX
128 
129 
130