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 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 :
25 : #include <boost/ptr_container/ptr_vector.hpp>
26 :
27 : class SfxWorkWindow;
28 : class SfxDockingWindow;
29 : class SfxEmptySplitWin_Impl;
30 :
31 6743 : struct SfxDock_Impl
32 : {
33 : sal_uInt16 nType;
34 : VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window
35 : bool bNewLine;
36 : bool bHide; // SplitWindow had this window
37 : long nSize;
38 : };
39 :
40 : typedef boost::ptr_vector<SfxDock_Impl> SfxDockArr_Impl;
41 :
42 : class SfxSplitWindow : public SplitWindow
43 : {
44 : friend class SfxEmptySplitWin_Impl;
45 :
46 : private:
47 : SfxChildAlignment eAlign;
48 : SfxWorkWindow* pWorkWin;
49 : SfxDockArr_Impl* pDockArr;
50 : bool bLocked;
51 : bool bPinned;
52 : VclPtr<SfxEmptySplitWin_Impl> pEmptyWin;
53 : VclPtr<SfxDockingWindow> pActive;
54 :
55 : void InsertWindow_Impl( SfxDock_Impl* pDockWin,
56 : const Size& rSize,
57 : sal_uInt16 nLine,
58 : sal_uInt16 nPos,
59 : bool bNewLine=false );
60 :
61 : DECL_LINK_TYPED( TimerHdl, Timer*, void );
62 : bool CursorIsOverRect( bool bForceAdding = false ) const;
63 : void SetPinned_Impl( bool );
64 : void SetFadeIn_Impl( bool );
65 : void SaveConfig_Impl();
66 : void FadeOut_Impl();
67 :
68 : protected:
69 :
70 : virtual void StartSplit() SAL_OVERRIDE;
71 : virtual void SplitResize() SAL_OVERRIDE;
72 : virtual void Split() SAL_OVERRIDE;
73 : virtual void Command ( const CommandEvent& rCEvt ) SAL_OVERRIDE;
74 : virtual void MouseButtonDown ( const MouseEvent& ) SAL_OVERRIDE;
75 :
76 : public:
77 : SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
78 : SfxWorkWindow *pW, bool bWithButtons,
79 : WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
80 :
81 : virtual ~SfxSplitWindow();
82 : virtual void dispose() SAL_OVERRIDE;
83 :
84 : void ReleaseWindow_Impl(SfxDockingWindow *pWin, bool bSaveConfig=true);
85 :
86 : void InsertWindow( SfxDockingWindow* pDockWin,
87 : const Size& rSize);
88 :
89 : void InsertWindow( SfxDockingWindow* pDockWin,
90 : const Size& rSize,
91 : sal_uInt16 nLine,
92 : sal_uInt16 nPos,
93 : bool bNewLine=false );
94 :
95 : void MoveWindow( SfxDockingWindow* pDockWin,
96 : const Size& rSize,
97 : sal_uInt16 nLine,
98 : sal_uInt16 nPos,
99 : bool bNewLine=false );
100 :
101 : void RemoveWindow( SfxDockingWindow* pDockWin, bool bHide=true);
102 :
103 13917 : void Lock( bool bLock=true )
104 : {
105 13917 : bLocked = bLock;
106 13917 : SetUpdateMode( !bLock );
107 13917 : }
108 : using Window::IsLocked;
109 : bool IsLocked() const { return bLocked; }
110 : bool GetWindowPos( const SfxDockingWindow* pWindow,
111 : sal_uInt16& rLine, sal_uInt16& rPos ) const;
112 : bool GetWindowPos( const Point& rTestPos,
113 : sal_uInt16& rLine, sal_uInt16& rPos ) const;
114 : sal_uInt16 GetLineCount() const;
115 : long GetLineSize( sal_uInt16 ) const;
116 : sal_uInt16 GetWindowCount(sal_uInt16 nLine) const;
117 : sal_uInt16 GetWindowCount() const;
118 :
119 77324 : bool IsPinned() const { return bPinned; }
120 : bool IsFadeIn() const;
121 : bool IsAutoHide( bool bSelf = false ) const;
122 : SplitWindow* GetSplitWindow();
123 :
124 : virtual void AutoHide() SAL_OVERRIDE;
125 : virtual void FadeOut() SAL_OVERRIDE;
126 : virtual void FadeIn() SAL_OVERRIDE;
127 : void SetActiveWindow_Impl( SfxDockingWindow* pWin );
128 : };
129 :
130 : #endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
131 :
132 :
133 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|