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_DOCKWIN_HXX
20 : #define INCLUDED_SFX2_DOCKWIN_HXX
21 :
22 : #include <sal/config.h>
23 : #include <sal/types.h>
24 : #include <vcl/dockwin.hxx>
25 :
26 : #include <com/sun/star/uno/Reference.hxx>
27 : #include <com/sun/star/awt/XWindow.hpp>
28 : #include <com/sun/star/frame/XFrame.hpp>
29 :
30 : #include <sfx2/dllapi.h>
31 : #include <sfx2/childwin.hxx>
32 :
33 : class SfxSplitWindow;
34 : class SfxDockingWindow_Impl;
35 :
36 : void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName );
37 : bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName );
38 :
39 : class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow
40 : {
41 : private:
42 : Rectangle aInnerRect;
43 : Rectangle aOuterRect;
44 : SfxBindings* pBindings;
45 : Size aFloatSize;
46 : SfxChildWindow* pMgr;
47 : SfxDockingWindow_Impl* pImp;
48 :
49 : SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined
50 : SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined
51 :
52 : protected:
53 : SfxChildAlignment CalcAlignment(const Point& rPos, Rectangle& rRect );
54 : void CalcSplitPosition(const Point rPos, Rectangle& rRect,
55 : SfxChildAlignment eAlign);
56 : virtual Size CalcDockingSize(SfxChildAlignment);
57 : virtual SfxChildAlignment
58 : CheckAlignment(SfxChildAlignment,SfxChildAlignment);
59 :
60 : virtual void Resize() SAL_OVERRIDE;
61 : virtual bool PrepareToggleFloatingMode() SAL_OVERRIDE;
62 : virtual void ToggleFloatingMode() SAL_OVERRIDE;
63 : virtual void StartDocking() SAL_OVERRIDE;
64 : virtual bool Docking( const Point& rPos, Rectangle& rRect ) SAL_OVERRIDE;
65 : virtual void EndDocking( const Rectangle& rRect, bool bFloatMode ) SAL_OVERRIDE;
66 : virtual void Resizing( Size& rSize ) SAL_OVERRIDE;
67 : virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
68 : virtual bool Close() SAL_OVERRIDE;
69 : virtual void Move() SAL_OVERRIDE;
70 :
71 0 : SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; }
72 :
73 : public:
74 : SfxDockingWindow( SfxBindings *pBindings,
75 : SfxChildWindow *pCW,
76 : Window* pParent,
77 : WinBits nWinBits=0);
78 : SfxDockingWindow( SfxBindings *pBindings,
79 : SfxChildWindow *pCW,
80 : Window* pParent,
81 : const ResId& rResId);
82 : virtual ~SfxDockingWindow();
83 :
84 : void Initialize (SfxChildWinInfo* pInfo);
85 : virtual void FillInfo(SfxChildWinInfo&) const;
86 : virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
87 :
88 0 : void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner)
89 0 : { aInnerRect = rInner; aOuterRect = rOuter; }
90 0 : const Rectangle& GetInnerRect() const { return aInnerRect; }
91 0 : const Rectangle& GetOuterRect() const { return aOuterRect; }
92 0 : SfxBindings& GetBindings() const { return *pBindings; }
93 0 : sal_uInt16 GetType() const { return pMgr->GetType(); }
94 0 : SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); }
95 0 : void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); }
96 0 : Size GetFloatingSize() const { return aFloatSize; }
97 0 : void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; }
98 :
99 : void SetMinOutputSizePixel( const Size& rSize );
100 : Size GetMinOutputSizePixel() const;
101 : virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
102 : virtual void FadeIn( bool );
103 : void AutoShow( bool bShow = true );
104 : DECL_LINK(TimerHdl, void *);
105 :
106 : SAL_DLLPRIVATE void Initialize_Impl();
107 : SAL_DLLPRIVATE sal_uInt16 GetWinBits_Impl() const;
108 : SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
109 : SAL_DLLPRIVATE void Disappear_Impl();
110 : SAL_DLLPRIVATE void Reappear_Impl();
111 : SAL_DLLPRIVATE bool IsAutoHide_Impl() const;
112 : SAL_DLLPRIVATE void AutoShow_Impl( bool bShow = true );
113 : SAL_DLLPRIVATE void Pin_Impl( bool bPinned );
114 : SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
115 : };
116 :
117 0 : class SfxDockingWrapper : public SfxChildWindow
118 : {
119 : public:
120 : SfxDockingWrapper( Window* pParent ,
121 : sal_uInt16 nId ,
122 : SfxBindings* pBindings ,
123 : SfxChildWinInfo* pInfo );
124 :
125 : SFX_DECL_CHILDWINDOW(SfxDockingWrapper);
126 : };
127 :
128 : #endif // INCLUDED_SFX2_DOCKWIN_HXX
129 :
130 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|