From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- sw/source/uibase/inc/FrameControl.hxx | 83 +++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sw/source/uibase/inc/FrameControl.hxx (limited to 'sw/source/uibase/inc/FrameControl.hxx') diff --git a/sw/source/uibase/inc/FrameControl.hxx b/sw/source/uibase/inc/FrameControl.hxx new file mode 100644 index 000000000..561dac78f --- /dev/null +++ b/sw/source/uibase/inc/FrameControl.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX +#define INCLUDED_SW_SOURCE_UIBASE_INC_FRAMECONTROL_HXX + +#include +#include + +#include "edtwin.hxx" + +class SwEditWin; +class SwPageFrame; +class SwFrame; +class Point; + +/// Abstract interface to be implemented by writer FrameControls +class ISwFrameControl +{ +public: + virtual ~ISwFrameControl(); + virtual void SetReadonly( bool bReadonly ) = 0; + virtual void ShowAll( bool bShow ) = 0; + + /// Returns true if the point is inside the control. + virtual bool Contains( const Point &rDocPt ) const = 0; + + virtual const SwFrame* GetFrame() = 0; + virtual SwEditWin* GetEditWin() = 0; +}; + +class SwFrameControl final +{ + VclPtr mxWindow; + ISwFrameControl *mpIFace; +public: + SwFrameControl( const VclPtr &pWindow ); + ~SwFrameControl(); + + vcl::Window* GetWindow() { return mxWindow.get(); } + ISwFrameControl* GetIFacePtr() { return mpIFace; } + + void SetReadonly( bool bReadonly ) { mpIFace->SetReadonly( bReadonly ); } + void ShowAll( bool bShow ) { mpIFace->ShowAll( bShow ); } + bool Contains( const Point &rDocPt ) const { return mpIFace->Contains( rDocPt ); } +}; + +/** Class sharing some MenuButton code + */ +class SwFrameMenuButtonBase : public InterimItemWindow, public ISwFrameControl +{ +protected: + VclPtr m_xVirDev; +private: + VclPtr m_pEditWin; + const SwFrame* m_pFrame; + +protected: + virtual ~SwFrameMenuButtonBase() override { disposeOnce(); } + virtual void dispose() override; + + void SetVirDevFont(); + +public: + SwFrameMenuButtonBase(SwEditWin* pEditWin, const SwFrame* pFrame, + const OUString& rUIXMLDescription, const OString& rID); + + virtual const SwFrame* GetFrame() override { return m_pFrame; } + virtual SwEditWin* GetEditWin() override { return m_pEditWin; } + const SwPageFrame* GetPageFrame() const; + + static const SwPageFrame* GetPageFrame(const SwFrame* pFrame); + static void SetVirDevFont(OutputDevice& rDevice); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3