LibreOffice Module sfx2 (master) 1
lokcomponenthelpers.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
10#ifndef INCLUDED_SFX2_LOKCHARTHELPER_HXX
11#define INCLUDED_SFX2_LOKCHARTHELPER_HXX
12
13#include <sfx2/dllapi.h>
14#include <tools/gen.hxx>
15#include <vcl/vclptr.hxx>
16#include <vcl/window.hxx>
17
18namespace com::sun::star::beans { struct PropertyValue; }
19namespace com::sun::star::frame { class XController; }
20namespace com::sun::star::frame { class XDispatch; }
21namespace com::sun::star::frame { class XFrame; }
22namespace com::sun::star::uno { template<class E> class Sequence; }
23
25class SfxViewShell;
26class VirtualDevice;
27
30{
31private:
33 css::uno::Reference<css::frame::XController> mxController;
34 css::uno::Reference<css::frame::XDispatch> mxDispatcher;
37
38public:
39 LokChartHelper(SfxViewShell* pViewShell, bool bNegativeX = false)
40 : mpViewShell(pViewShell)
41 , mpWindow(nullptr)
42 , mbNegativeX(bNegativeX)
43 {}
44
45 css::uno::Reference<css::frame::XController>& GetXController();
46 css::uno::Reference<css::frame::XDispatch>& GetXDispatcher();
47 vcl::Window* GetWindow();
48 tools::Rectangle GetChartBoundingBox();
49 void Invalidate();
50
51 bool Hit(const Point& aPos);
52 static bool HitAny(const Point& aPos, bool bNegativeX = false);
53 void PaintTile(VirtualDevice& rRenderContext, const tools::Rectangle& rTileRect);
54 static void PaintAllChartsOnTile(VirtualDevice& rDevice,
55 int nOutputWidth, int nOutputHeight,
56 int nTilePosX, int nTilePosY,
57 tools::Long nTileWidth, tools::Long nTileHeight,
58 bool bNegativeX = false);
59 bool postMouseEvent(int nType, int nX, int nY,
60 int nCount, int nButtons, int nModifier,
61 double fScaleX = 1.0, double fScaleY = 1.0);
62 bool setTextSelection(int nType, int nX, int nY);
63 bool setGraphicSelection(int nType, int nX, int nY,
64 double fScaleX = 1.0, double fScaleY = 1.0);
65};
66
69{
70public:
71 LokStarMathHelper(const SfxViewShell* pViewShell);
72
73 vcl::Window* GetGraphicWindow();
74 vcl::Window* GetWidgetWindow();
75 const SfxViewShell* GetSmViewShell();
76 tools::Rectangle GetBoundingBox() const;
77
78 void Dispatch(const OUString& cmd, const css::uno::Sequence<css::beans::PropertyValue>& rArguments) const;
79
80 bool postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier,
81 double fPPTScaleX, double fPPTScaleY);
82
83 static void PaintAllInPlaceOnTile(VirtualDevice& rDevice, int nOutputWidth, int nOutputHeight,
84 int nTilePosX, int nTilePosY, tools::Long nTileWidth,
85 tools::Long nTileHeight);
86
87private:
88 void PaintTile(VirtualDevice& rDevice, const tools::Rectangle& rTileRect);
89
91 const SfxInPlaceClient* mpIPClient = nullptr; // not nullptr when the object is valid
92 css::uno::Reference<css::frame::XFrame> mxFrame; // not empty when the object is valid
95};
96
97#endif
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A class for chart editing support via LibreOfficeKit.
css::uno::Reference< css::frame::XController > mxController
SfxViewShell * mpViewShell
css::uno::Reference< css::frame::XDispatch > mxDispatcher
VclPtr< vcl::Window > mpWindow
LokChartHelper(SfxViewShell *pViewShell, bool bNegativeX=false)
A class for math editing support via LibreOfficeKit.
const SfxViewShell * mpViewShell
VclPtr< vcl::Window > mpGraphicWindow
VclPtr< vcl::Window > mpWidgetWindow
css::uno::Reference< css::frame::XFrame > mxFrame
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
Definition: viewsh.hxx:165
int nCount
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
long Long
QPRO_FUNC_TYPE nType
VclPtr< vcl::Window > mpWindow