LibreOffice Module vcl (master) 1
ITiledRenderable.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
11#pragma once
12
13#include <tools/gen.hxx>
14#include <rtl/ustring.hxx>
15#include <vcl/dllapi.h>
16#include <vcl/ptrstyle.hxx>
17#include <vcl/vclptr.hxx>
18#include <map>
19#include <com/sun/star/datatransfer/XTransferable.hpp>
21
22namespace com::sun::star::beans { struct PropertyValue; }
23namespace com::sun::star::datatransfer::clipboard { class XClipboard; }
24namespace com::sun::star::uno { template <class interface_type> class Reference; }
25namespace com::sun::star::uno { template <typename > class Sequence; }
26namespace vcl { class Window; }
27namespace tools { class JsonWriter; }
28
29class VirtualDevice;
30
31namespace vcl
32{
33 /*
34 * Map directly to css cursor styles to avoid further mapping in the client.
35 * Gtk (via gdk_cursor_new_from_name) also supports the same css cursor styles.
36 *
37 * This was created partially with help of the mappings in gtkdata.cxx.
38 * The list is incomplete as some cursor style simply aren't supported
39 * by css, it might turn out to be worth mapping some of these missing cursors
40 * to available cursors?
41 */
42 extern const std::map <PointerStyle, OString> gaLOKPointerMap;
43
44
46{
47public:
48
49 typedef std::map<OUString, OUString> StringMap;
50
51 virtual ~ITiledRenderable();
52
59 virtual void paintTile( VirtualDevice &rDevice,
60 int nOutputWidth,
61 int nOutputHeight,
62 int nTilePosX,
63 int nTilePosY,
64 tools::Long nTileWidth,
65 tools::Long nTileHeight ) = 0;
66
70 virtual Size getDocumentSize() = 0;
71
78 virtual void setPart( int /*nPart*/, bool /*bAllowChangeFocus*/ = true ) {}
79
83 virtual int getParts()
84 {
85 return 1;
86 }
87
92 virtual int getPart()
93 {
94 return 0;
95 }
96
101 virtual OUString getPartName(int)
102 {
103 return OUString();
104 }
105
110
115 virtual OUString getPartHash(int nPart) = 0;
116
118 virtual void setPartMode(int) {}
119
124 virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) = 0;
125
131 virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) = 0;
132
138 virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) = 0;
139
145 virtual void setTextSelection(int nType, int nX, int nY) = 0;
146
150 virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() = 0;
151
157 virtual void setGraphicSelection(int nType, int nX, int nY) = 0;
158
162 virtual void resetSelection() = 0;
163
167 virtual OUString getPartPageRectangles()
168 {
169 return OUString();
170 }
171
178 virtual void getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/, tools::JsonWriter& /*rJsonWriter*/)
179 {
180 }
181
201 virtual OString getSheetGeometryData(bool /*bColumns*/, bool /*bRows*/, bool /*bSizes*/,
202 bool /*bHidden*/, bool /*bFiltered*/, bool /*bGroups*/)
203 {
204 return "";
205 }
206
212 virtual void getCellCursor(tools::JsonWriter& /*rJsonWriter*/)
213 {
214 }
215
217
219 virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
220
222 virtual bool isMimeTypeSupported() = 0;
223
232 virtual void setClientZoom(int /*nTilePixelWidth*/,
233 int /*nTilePixelHeight*/,
234 int /*nTileTwipWidth*/,
235 int /*nTileTwipHeight*/)
236 {}
237
239 virtual void setClientVisibleArea(const tools::Rectangle& /*rRectangle*/)
240 {
241 }
242
251 virtual void setOutlineState(bool /*bColumn*/, int /*nLevel*/, int /*nIndex*/, bool /*bHidden*/)
252 {
253 return;
254 }
255
260 {
261 }
262
265 virtual void getTrackedChangeAuthors(tools::JsonWriter& /*rJsonWriter*/)
266 {
267 }
268
271 virtual void getPostIts(tools::JsonWriter& /*rJsonWriter*/)
272 {
273 }
274
277 virtual void getPostItsPos(tools::JsonWriter& /*rJsonWriter*/)
278 {
279 }
280
283 virtual void getRulerState(tools::JsonWriter& /*rJsonWriter*/)
284 {
285 }
286
287 /*
288 * Used for sheets in spreadsheet documents,
289 * and slides in presentation documents.
290 */
291 virtual OUString getPartInfo(int /*nPart*/)
292 {
293 return OUString();
294 }
295
301 virtual void selectPart(int /*nPart*/, int /*nSelect*/) {}
302
308 virtual void moveSelectedParts(int /*nPosition*/, bool /*bDuplicate*/) {}
309
311 virtual void completeFunction(const OUString& /*rFunctionName*/)
312 {
313 }
314
319 virtual bool isDisposed() const
320 {
321 return false;
322 }
323
328 virtual void executeFromFieldEvent(const StringMap&)
329 {
330 }
331
335 virtual std::vector<basegfx::B2DRange> getSearchResultRectangles(const char* /*pPayload*/)
336 {
337 return std::vector<basegfx::B2DRange>();
338 }
339
344 virtual void executeContentControlEvent(const StringMap&) {}
345};
346} // namespace vcl
347
348/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void completeFunction(const OUString &)
virtual bool isMimeTypeSupported()=0
If the current contents of the clipboard is something we can paste.
virtual OUString getPartPageRectangles()
virtual void setPartMode(int)
virtual void setTextSelection(int nType, int nX, int nY)=0
Sets the start or end of a text selection.
virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode)=0
Posts a keyboard event on the document.
virtual void resetSelection()=0
virtual void getRowColumnHeaders(const tools::Rectangle &, tools::JsonWriter &)
Get position and content of row/column headers of Calc documents.
virtual bool isDisposed() const
It can happen that the underlying implementation is being disposed, but somebody is trying to access ...
virtual OUString getPartName(int)
Get the name of the currently displayed part, i.e.
virtual int getParts()
Get the number of parts – see setPart for further details.
virtual void getCellCursor(tools::JsonWriter &)
Get position and size of cell cursor in Calc - as JSON in the current' views' co-ordinate system.
virtual VclPtr< vcl::Window > getDocWindow()=0
Get the vcl::Window for the document being edited.
virtual Size getDocumentSize()=0
Get the document size in twips.
virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)=0
Posts a mouse event on the document.
virtual void setGraphicSelection(int nType, int nX, int nY)=0
Adjusts the graphic selection.
virtual OString getSheetGeometryData(bool, bool, bool, bool, bool, bool)
Generates a serialization of the active (Calc document) sheet's geometry data.
virtual OUString getPartHash(int nPart)=0
Get the hash of the currently displayed part, i.e.
virtual void moveSelectedParts(int, bool)
Move selected pages/slides to a new position.
virtual OUString getPartInfo(int)
virtual void initializeForTiledRendering(const css::uno::Sequence< css::beans::PropertyValue > &rArguments)=0
Setup various document properties that are needed for the document to be renderable via tiled renderi...
virtual void executeFromFieldEvent(const StringMap &)
Execute a form field event in the document.
virtual void getPostIts(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:ViewAnnotations");.
std::map< OUString, OUString > StringMap
virtual void selectPart(int, int)
Select/Unselect a document "part", i.e.
virtual void getPostItsPos(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:ViewAnnotationsPosition");.
virtual void setPart(int, bool=true)
Set the document "part", i.e.
virtual void setOutlineState(bool, int, int, bool)
Show/Hide a single row/column header outline for Calc documents.
virtual std::vector< basegfx::B2DRange > getSearchResultRectangles(const char *)
Returns the rectangles of the input search result JSON.
virtual void getRulerState(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:RulerState");.
virtual void setClientVisibleArea(const tools::Rectangle &)
virtual void setClientZoom(int, int, int, int)
Save the client's view so that we can compute the right zoom level for the mouse events.
virtual void setClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &xClipboard)=0
Sets the clipboard of the component.
virtual void executeContentControlEvent(const StringMap &)
Execute a content control event in the document.
virtual void paintTile(VirtualDevice &rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, tools::Long nTileWidth, tools::Long nTileHeight)=0
Paint a tile to a given VirtualDevice.
virtual void getTrackedChangeAuthors(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:TrackedChangeAuthors").
virtual css::uno::Reference< css::datatransfer::XTransferable > getSelection()=0
Gets the selection as a transferable for later processing.
virtual void getTrackedChanges(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:AcceptTrackedChanges") when there is no matc...
virtual PointerStyle getPointer()=0
virtual int getPart()
Get the currently displayed/selected part – see setPart for further details.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
Reference
long Long
const std::map< PointerStyle, OString > gaLOKPointerMap
PointerStyle
Definition: ptrstyle.hxx:26