Mark some visible strings in ui files as translatable
[LibreOffice.git] / sw / source / uibase / inc / FrameControl.hxx
blob4043f834f94bb12c99b1c240017b20fd430b3cd6
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/InterimItemWindow.hxx>
13 #include <vcl/virdev.hxx>
15 #include "edtwin.hxx"
17 class SwEditWin;
18 class SwPageFrame;
19 class SwFrame;
20 class Point;
22 /// Abstract interface to be implemented by writer FrameControls
23 class SAL_LOPLUGIN_ANNOTATE("crosscast") ISwFrameControl
25 public:
26 virtual ~ISwFrameControl();
27 virtual void SetReadonly( bool bReadonly ) = 0;
28 virtual void ShowAll( bool bShow ) = 0;
30 /// Returns true if the point is inside the control.
31 virtual bool Contains( const Point &rDocPt ) const = 0;
33 virtual const SwFrame* GetFrame() = 0;
34 virtual SwEditWin* GetEditWin() = 0;
35 virtual weld::Button* GetButton() { return nullptr; };
38 class SwFrameControl final
40 VclPtr<vcl::Window> mxWindow;
41 ISwFrameControl *mpIFace;
42 public:
43 SwFrameControl( const VclPtr<vcl::Window> &pWindow );
44 ~SwFrameControl();
46 vcl::Window* GetWindow() { return mxWindow.get(); }
47 ISwFrameControl* GetIFacePtr() { return mpIFace; }
49 void SetReadonly( bool bReadonly ) { mpIFace->SetReadonly( bReadonly ); }
50 void ShowAll( bool bShow ) { mpIFace->ShowAll( bShow ); }
51 bool Contains( const Point &rDocPt ) const { return mpIFace->Contains( rDocPt ); }
54 /** Class sharing some MenuButton code
56 class SwFrameMenuButtonBase : public InterimItemWindow, public ISwFrameControl
58 protected:
59 VclPtr<VirtualDevice> m_xVirDev;
60 private:
61 VclPtr<SwEditWin> m_pEditWin;
62 const SwFrame* m_pFrame;
64 protected:
65 virtual ~SwFrameMenuButtonBase() override { disposeOnce(); }
66 virtual void dispose() override;
68 void SetVirDevFont();
70 public:
71 SwFrameMenuButtonBase(SwEditWin* pEditWin, const SwFrame* pFrame,
72 const OUString& rUIXMLDescription, const OUString& rID);
74 virtual const SwFrame* GetFrame() override { return m_pFrame; }
75 virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
76 const SwPageFrame* GetPageFrame() const;
78 static const SwPageFrame* GetPageFrame(const SwFrame* pFrame);
79 static void SetVirDevFont(OutputDevice& rDevice);
82 #endif
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */