1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
12 #include <vcl/menubtn.hxx>
21 /// Abstract interface to be implemented by writer FrameControls
25 virtual ~ISwFrameControl();
26 virtual void SetReadonly( bool bReadonly
) = 0;
27 virtual void ShowAll( bool bShow
) = 0;
29 /// Returns true if the point is inside the control.
30 virtual bool Contains( const Point
&rDocPt
) const = 0;
32 virtual const SwFrame
* GetFrame() = 0;
33 virtual SwEditWin
* GetEditWin() = 0;
36 class SwFrameControl final
38 VclPtr
<vcl::Window
> mxWindow
;
39 ISwFrameControl
*mpIFace
;
41 SwFrameControl( const VclPtr
<vcl::Window
> &pWindow
);
44 vcl::Window
* GetWindow() { return mxWindow
.get(); }
46 void SetReadonly( bool bReadonly
) { mpIFace
->SetReadonly( bReadonly
); }
47 void ShowAll( bool bShow
) { mpIFace
->ShowAll( bShow
); }
48 bool Contains( const Point
&rDocPt
) const { return mpIFace
->Contains( rDocPt
); }
51 /** Class sharing some MenuButton code
53 class SwFrameMenuButtonBase
: public MenuButton
, public ISwFrameControl
55 VclPtr
<SwEditWin
> m_pEditWin
;
56 const SwFrame
* m_pFrame
;
59 virtual ~SwFrameMenuButtonBase() override
{ disposeOnce(); }
60 virtual void dispose() override
;
63 SwFrameMenuButtonBase( SwEditWin
* pEditWin
, const SwFrame
* pFrame
);
65 virtual const SwFrame
* GetFrame() override
{ return m_pFrame
; }
66 virtual SwEditWin
* GetEditWin() override
{ return m_pEditWin
; }
67 const SwPageFrame
* GetPageFrame() const;
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */