LibreOffice Module sw (master)  1
FrameControl.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX
11 
12 #include <vcl/menubtn.hxx>
13 
14 #include "edtwin.hxx"
15 
16 class SwEditWin;
17 class SwPageFrame;
18 class SwFrame;
19 class Point;
20 
23 {
24 public:
25  virtual ~ISwFrameControl();
26  virtual void SetReadonly( bool bReadonly ) = 0;
27  virtual void ShowAll( bool bShow ) = 0;
28 
30  virtual bool Contains( const Point &rDocPt ) const = 0;
31 
32  virtual const SwFrame* GetFrame() = 0;
33  virtual SwEditWin* GetEditWin() = 0;
34 };
35 
36 class SwFrameControl final
37 {
40 public:
41  SwFrameControl( const VclPtr<vcl::Window> &pWindow );
43 
44  vcl::Window* GetWindow() { return mxWindow.get(); }
45 
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 ); }
49 };
50 
54 {
56  const SwFrame* m_pFrame;
57 
58 protected:
59  virtual ~SwFrameMenuButtonBase() override { disposeOnce(); }
60  virtual void dispose() override;
61 
62 public:
63  SwFrameMenuButtonBase( SwEditWin* pEditWin, const SwFrame* pFrame );
64 
65  virtual const SwFrame* GetFrame() override { return m_pFrame; }
66  virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
67  const SwPageFrame* GetPageFrame() const;
68 };
69 
70 #endif
71 
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetReadonly(bool bReadonly)
Base class of the Writer layout elements.
Definition: frame.hxx:295
virtual void dispose() override
virtual const SwFrame * GetFrame() override
virtual SwEditWin * GetEditWin()=0
vcl::Window * GetWindow()
virtual void ShowAll(bool bShow)=0
Abstract interface to be implemented by writer FrameControls.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
bool Contains(const Point &rDocPt) const
Class sharing some MenuButton code.
virtual ~SwFrameMenuButtonBase() override
VclPtr< vcl::Window > mxWindow
A page of the document layout.
Definition: pagefrm.hxx:40
void ShowAll(bool bShow)
virtual const SwFrame * GetFrame()=0
const SwFrame * m_pFrame
virtual bool Contains(const Point &rDocPt) const =0
Returns true if the point is inside the control.
VclPtr< SwEditWin > m_pEditWin
const SwPageFrame * GetPageFrame() const
SwFrameMenuButtonBase(SwEditWin *pEditWin, const SwFrame *pFrame)
ISwFrameControl * mpIFace
vcl::Window * get() const
virtual void SetReadonly(bool bReadonly)=0
virtual SwEditWin * GetEditWin() override
SwFrameControl(const VclPtr< vcl::Window > &pWindow)