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