update emoji autocorrect entries from po-files
[LibreOffice.git] / include / sfx2 / dockwin.hxx
blobe929824a9c49f7a7541cf69dc4f333c7ece3d711
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SFX2_DOCKWIN_HXX
20 #define INCLUDED_SFX2_DOCKWIN_HXX
22 #include <sal/config.h>
23 #include <sal/types.h>
24 #include <vcl/dockwin.hxx>
26 #include <com/sun/star/uno/Reference.hxx>
27 #include <com/sun/star/awt/XWindow.hpp>
28 #include <com/sun/star/frame/XFrame.hpp>
30 #include <sfx2/dllapi.h>
31 #include <sfx2/childwin.hxx>
33 class SfxSplitWindow;
34 class SfxDockingWindow_Impl;
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 );
39 class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow
41 private:
42 Rectangle aInnerRect;
43 Rectangle aOuterRect;
44 SfxBindings* pBindings;
45 Size aFloatSize;
46 SfxChildWindow* pMgr;
47 SfxDockingWindow_Impl* pImp;
49 SfxDockingWindow(SfxDockingWindow &) SAL_DELETED_FUNCTION;
50 void operator =(SfxDockingWindow &) SAL_DELETED_FUNCTION;
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);
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( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
68 virtual bool Close() SAL_OVERRIDE;
69 virtual void Move() SAL_OVERRIDE;
71 SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; }
73 public:
74 SfxDockingWindow( SfxBindings *pBindings,
75 SfxChildWindow *pCW,
76 vcl::Window* pParent,
77 WinBits nWinBits=0);
78 SfxDockingWindow( SfxBindings *pBindings,
79 SfxChildWindow *pCW,
80 vcl::Window* pParent,
81 const ResId& rResId);
82 SfxDockingWindow( SfxBindings *pBindings,
83 SfxChildWindow *pCW,
84 vcl::Window* pParent,
85 const OString& rID, const OUString& rUIXMLDescription );
86 virtual ~SfxDockingWindow();
87 virtual void dispose() SAL_OVERRIDE;
89 void Initialize (SfxChildWinInfo* pInfo);
90 virtual void FillInfo(SfxChildWinInfo&) const;
91 virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
93 void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner)
94 { aInnerRect = rInner; aOuterRect = rOuter; }
95 const Rectangle& GetInnerRect() const { return aInnerRect; }
96 const Rectangle& GetOuterRect() const { return aOuterRect; }
97 SfxBindings& GetBindings() const { return *pBindings; }
98 sal_uInt16 GetType() const { return pMgr->GetType(); }
99 SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); }
100 void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); }
101 Size GetFloatingSize() const { return aFloatSize; }
102 void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; }
104 void SetMinOutputSizePixel( const Size& rSize );
105 Size GetMinOutputSizePixel() const;
106 virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
107 DECL_LINK_TYPED(TimerHdl, Idle *, void);
109 SAL_DLLPRIVATE void Initialize_Impl();
110 SAL_DLLPRIVATE sal_uInt16 GetWinBits_Impl() const;
111 SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
112 SAL_DLLPRIVATE void Disappear_Impl();
113 SAL_DLLPRIVATE void Reappear_Impl();
114 SAL_DLLPRIVATE bool IsAutoHide_Impl() const;
115 SAL_DLLPRIVATE void AutoShow_Impl( bool bShow = true );
116 SAL_DLLPRIVATE void Pin_Impl( bool bPinned );
117 SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
120 class SfxDockingWrapper : public SfxChildWindow
122 public:
123 SfxDockingWrapper( vcl::Window* pParent ,
124 sal_uInt16 nId ,
125 SfxBindings* pBindings ,
126 SfxChildWinInfo* pInfo );
128 SFX_DECL_CHILDWINDOW(SfxDockingWrapper);
131 #endif // INCLUDED_SFX2_DOCKWIN_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */