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 
15 class SwEditWin;
16 class SwPageFrame;
17 class SwFrame;
18 class Point;
19 
22 {
23 public:
24  virtual ~ISwFrameControl();
25  virtual void SetReadonly( bool bReadonly ) = 0;
26  virtual void ShowAll( bool bShow ) = 0;
27 
29  virtual bool Contains( const Point &rDocPt ) const = 0;
30 
31  virtual const SwFrame* GetFrame() = 0;
32  virtual SwEditWin* GetEditWin() = 0;
33 };
34 
35 class SwFrameControl final
36 {
39 public:
40  SwFrameControl( const VclPtr<vcl::Window> &pWindow );
42 
43  vcl::Window* GetWindow() { return mxWindow.get(); }
44 
45  void SetReadonly( bool bReadonly ) { mpIFace->SetReadonly( bReadonly ); }
46  void ShowAll( bool bShow ) { mpIFace->ShowAll( bShow ); }
47  bool Contains( const Point &rDocPt ) const { return mpIFace->Contains( rDocPt ); }
48 };
49 
53 {
55  const SwFrame* m_pFrame;
56 
57 protected:
58  virtual ~SwFrameMenuButtonBase() override { disposeOnce(); }
59  virtual void dispose() override;
60 
61 public:
62  SwFrameMenuButtonBase( SwEditWin* pEditWin, const SwFrame* pFrame );
63 
64  virtual const SwFrame* GetFrame() override { return m_pFrame; }
65  virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
66  const SwPageFrame* GetPageFrame();
67 };
68 
69 #endif
70 
71 /* 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
SwFrameMenuButtonBase(SwEditWin *pEditWin, const SwFrame *pFrame)
ISwFrameControl * mpIFace
const SwPageFrame * GetPageFrame()
vcl::Window * get() const
virtual void SetReadonly(bool bReadonly)=0
virtual SwEditWin * GetEditWin() override
SwFrameControl(const VclPtr< vcl::Window > &pWindow)