Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / ITiledRenderable.hxx
blob5c5d8339b8a1667abc7f845e2bddd96e6f3f238f
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/.
9 */
11 #ifndef INCLUDED_VCL_ITILEDRENDERABLE_HXX
12 #define INCLUDED_VCL_ITILEDRENDERABLE_HXX
14 #include <LibreOfficeKit/LibreOfficeKitTypes.h>
15 #include <tools/gen.hxx>
16 #include <vcl/pointr.hxx>
17 #include <vcl/virdev.hxx>
18 #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
20 namespace vcl
23 class VCL_DLLPUBLIC ITiledRenderable
25 protected:
26 int mnTilePixelWidth, mnTilePixelHeight;
27 int mnTileTwipWidth, mnTileTwipHeight;
28 public:
29 virtual ~ITiledRenderable();
31 /**
32 * Paint a tile to a given VirtualDevice.
34 * Output parameters are measured in pixels, tile parameters are in
35 * twips.
37 virtual void paintTile( VirtualDevice &rDevice,
38 int nOutputWidth,
39 int nOutputHeight,
40 int nTilePosX,
41 int nTilePosY,
42 long nTileWidth,
43 long nTileHeight ) = 0;
45 /**
46 * Get the document size in twips.
48 virtual Size getDocumentSize() = 0;
50 /**
51 * Set the document "part", i.e. slide for a slideshow, and
52 * tab for a spreadsheet.
54 virtual void setPart( int nPart )
56 (void) nPart;
59 /**
60 * Get the number of parts -- see setPart for further details.
62 virtual int getParts()
64 return 1;
67 /**
68 * Get the currently displayed/selected part -- see setPart for further
69 * details.
71 virtual int getPart()
73 return 0;
76 /**
77 * Get the name of the currently displayed part, i.e. sheet in a spreadsheet
78 * or slide in a presentation.
80 virtual OUString getPartName(int nPart)
82 (void) nPart;
83 return OUString();
86 /**
87 * Get the hash of the currently displayed part, i.e. sheet in a spreadsheet
88 * or slide in a presentation.
90 virtual OUString getPartHash(int nPart) = 0;
92 /// @see lok::Document::setPartMode().
93 virtual void setPartMode(int nPartMode)
95 (void) nPartMode;
98 /**
99 * Setup various document properties that are needed for the document to
100 * be renderable via tiled rendering.
102 virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) = 0;
105 * Posts a keyboard event on the document.
107 * @see lok::Document::postKeyEvent().
109 virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) = 0;
112 * Posts a mouse event on the document.
114 * @see lok::Document::postMouseEvent().
116 virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) = 0;
119 * Sets the start or end of a text selection.
121 * @see lok::Document::setTextSelection().
123 virtual void setTextSelection(int nType, int nX, int nY) = 0;
126 * Gets the text selection.
128 * @see lok::Document::getTextSelection().
130 virtual OString getTextSelection(const char* pMimeType, OString& rUsedMimeType) = 0;
133 * Adjusts the graphic selection.
135 * @see lok::Document::setGraphicSelection().
137 virtual void setGraphicSelection(int nType, int nX, int nY) = 0;
140 * @see lok::Document::resetSelection().
142 virtual void resetSelection() = 0;
145 * @see lok::Document::getPartPageRectangles().
147 virtual OUString getPartPageRectangles()
149 return OUString();
153 * Get position and content of row/column headers of Calc documents.
155 * @param rRectangle - if not empty, then limit the output only to the area of this rectangle
156 * @return a JSON describing position/content of rows/columns
158 virtual OUString getRowColumnHeaders(const tools::Rectangle& rRectangle)
160 (void) rRectangle;
161 return OUString();
165 * Get position and size of cell cursor in Calc.
166 * (This could maybe also be used for tables in Writer/Impress in future?)
168 virtual OString getCellCursor(int /*nOutputWidth*/,
169 int /*nOutputHeight*/,
170 long /*nTileWidth*/,
171 long /*nTileHeight*/)
173 return OString();
176 virtual Pointer getPointer() = 0;
178 /// Sets the clipboard of the component.
179 virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
181 /// If the current contents of the clipboard is something we can paste.
182 virtual bool isMimeTypeSupported() = 0;
185 * Save the client's view so that we can compute the right zoom level
186 * for the mouse events.
187 * @param nTilePixelWidth - tile width in pixels
188 * @param nTilePixelHeight - tile height in pixels
189 * @param nTileTwipWidth - tile width in twips
190 * @param nTileTwipHeight - tile height in twips
192 virtual void setClientZoom(int nTilePixelWidth,
193 int nTilePixelHeight,
194 int nTileTwipWidth,
195 int nTileTwipHeight)
197 (void) nTilePixelWidth;
198 (void) nTilePixelHeight;
199 (void) nTileTwipWidth;
200 (void) nTileTwipHeight;
203 /// @see lok::Document::setClientVisibleArea().
204 virtual void setClientVisibleArea(const tools::Rectangle& /*rRectangle*/)
208 /// Implementation for
209 /// lok::Document::getCommandValues(".uno:AcceptTrackedChanges") when there
210 /// is no matching UNO API.
211 virtual OUString getTrackedChanges()
213 return OUString();
216 /// Implementation for
217 /// lok::Document::getCommandValues(".uno:TrackedChangeAuthors").
218 virtual OUString getTrackedChangeAuthors()
220 return OUString();
223 /// Implementation for
224 /// lok::Document::getCommandValues(".uno:ViewAnnotations");
225 virtual OUString getPostIts()
227 return OUString();
230 /// Implementation for
231 /// lok::Document::getCommandValues(".uno:ViewAnnotationsPosition");
232 virtual OUString getPostItsPos()
234 return OUString();
238 } // namespace vcl
240 #endif // INCLUDED_VCL_ITILEDRENDERABLE_HXX
242 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */