nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / FrameControl.hxx
blobbf2ff623920a8f6012756e06e2edc94a47f9db12
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/.
8 */
9 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
12 #include <vcl/menubtn.hxx>
14 #include "edtwin.hxx"
16 class SwEditWin;
17 class SwPageFrame;
18 class SwFrame;
19 class Point;
21 /// Abstract interface to be implemented by writer FrameControls
22 class ISwFrameControl
24 public:
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;
40 public:
41 SwFrameControl( const VclPtr<vcl::Window> &pWindow );
42 ~SwFrameControl();
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;
58 protected:
59 virtual ~SwFrameMenuButtonBase() override { disposeOnce(); }
60 virtual void dispose() override;
62 public:
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;
70 #endif
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */