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 #ifndef INCLUDED_VCL_ITILEDRENDERABLE_HXX
12 #define INCLUDED_VCL_ITILEDRENDERABLE_HXX
13 
14 #include <tools/gen.hxx>
15 #include <rtl/ustring.hxx>
16 #include <vcl/dllapi.h>
17 #include <vcl/ptrstyle.hxx>
18 #include <vcl/vclptr.hxx>
19 #include <map>
20 #include <com/sun/star/datatransfer/XTransferable.hpp>
21 
22 namespace com::sun::star::beans { struct PropertyValue; }
23 namespace com::sun::star::datatransfer::clipboard { class XClipboard; }
24 namespace com::sun::star::uno { template <class interface_type> class Reference; }
25 namespace com::sun::star::uno { template <typename > class Sequence; }
26 namespace vcl { class Window; }
27 namespace tools { class JsonWriter; }
28 
29 class VirtualDevice;
30 
31 namespace 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 {
47 public:
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 
76  virtual void setPart( int ) {}
77 
81  virtual int getParts()
82  {
83  return 1;
84  }
85 
90  virtual int getPart()
91  {
92  return 0;
93  }
94 
99  virtual OUString getPartName(int)
100  {
101  return OUString();
102  }
103 
107  virtual VclPtr<vcl::Window> getDocWindow() = 0;
108 
113  virtual OUString getPartHash(int nPart) = 0;
114 
116  virtual void setPartMode(int) {}
117 
122  virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) = 0;
123 
129  virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) = 0;
130 
136  virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) = 0;
137 
143  virtual void setTextSelection(int nType, int nX, int nY) = 0;
144 
148  virtual css::uno::Reference<css::datatransfer::XTransferable> getSelection() = 0;
149 
155  virtual void setGraphicSelection(int nType, int nX, int nY) = 0;
156 
160  virtual void resetSelection() = 0;
161 
165  virtual OUString getPartPageRectangles()
166  {
167  return OUString();
168  }
169 
176  virtual void getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/, tools::JsonWriter& /*rJsonWriter*/)
177  {
178  }
179 
199  virtual OString getSheetGeometryData(bool /*bColumns*/, bool /*bRows*/, bool /*bSizes*/,
200  bool /*bHidden*/, bool /*bFiltered*/, bool /*bGroups*/)
201  {
202  return "";
203  }
204 
210  virtual void getCellCursor(tools::JsonWriter& /*rJsonWriter*/)
211  {
212  }
213 
214  virtual PointerStyle getPointer() = 0;
215 
217  virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
218 
220  virtual bool isMimeTypeSupported() = 0;
221 
230  virtual void setClientZoom(int /*nTilePixelWidth*/,
231  int /*nTilePixelHeight*/,
232  int /*nTileTwipWidth*/,
233  int /*nTileTwipHeight*/)
234  {}
235 
237  virtual void setClientVisibleArea(const tools::Rectangle& /*rRectangle*/)
238  {
239  }
240 
249  virtual void setOutlineState(bool /*bColumn*/, int /*nLevel*/, int /*nIndex*/, bool /*bHidden*/)
250  {
251  return;
252  }
253 
258  {
259  }
260 
263  virtual void getTrackedChangeAuthors(tools::JsonWriter& /*rJsonWriter*/)
264  {
265  }
266 
269  virtual void getPostIts(tools::JsonWriter& /*rJsonWriter*/)
270  {
271  }
272 
275  virtual void getPostItsPos(tools::JsonWriter& /*rJsonWriter*/)
276  {
277  }
278 
281  virtual void getRulerState(tools::JsonWriter& /*rJsonWriter*/)
282  {
283  }
284 
285  /*
286  * Used for sheets in spreadsheet documents,
287  * and slides in presentation documents.
288  */
289  virtual OUString getPartInfo(int /*nPart*/)
290  {
291  return OUString();
292  }
293 
299  virtual void selectPart(int /*nPart*/, int /*nSelect*/) {}
300 
306  virtual void moveSelectedParts(int /*nPosition*/, bool /*bDuplicate*/) {}
307 
309  virtual void completeFunction(const OUString& /*rFunctionName*/)
310  {
311  }
312 
317  virtual bool isDisposed() const
318  {
319  return false;
320  }
321 
326  virtual void executeFromFieldEvent(const StringMap&)
327  {
328  }
329 };
330 } // namespace vcl
331 
332 #endif // INCLUDED_VCL_ITILEDRENDERABLE_HXX
333 
334 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::map< OUString, OUString > StringMap
virtual void executeFromFieldEvent(const StringMap &)
Execute a form field event in the document.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
long Long
virtual void getTrackedChanges(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:AcceptTrackedChanges") when there is no matc...
Reference
virtual int getPart()
Get the currently displayed/selected part – see setPart for further details.
virtual OString getSheetGeometryData(bool, bool, bool, bool, bool, bool)
Generates a serialization of the active (Calc document) sheet's geometry data.
virtual void getPostItsPos(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:ViewAnnotationsPosition");.
const std::map< PointerStyle, OString > gaLOKPointerMap
virtual void getTrackedChangeAuthors(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:TrackedChangeAuthors").
virtual OUString getPartPageRectangles()
virtual void moveSelectedParts(int, bool)
Move selected pages/slides to a new position.
virtual void getPostIts(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:ViewAnnotations");.
virtual void setOutlineState(bool, int, int, bool)
Show/Hide a single row/column header outline for Calc documents.
virtual void completeFunction(const OUString &)
virtual void getRowColumnHeaders(const tools::Rectangle &, tools::JsonWriter &)
Get position and content of row/column headers of Calc documents.
virtual int getParts()
Get the number of parts – see setPart for further details.
virtual void setPart(int)
Set the document "part", i.e.
virtual OUString getPartInfo(int)
virtual void getRulerState(tools::JsonWriter &)
Implementation for lok::Document::getCommandValues(".uno:RulerState");.
virtual bool isDisposed() const
It can happen that the underlying implementation is being disposed, but somebody is trying to access ...
PointerStyle
Definition: ptrstyle.hxx:25
virtual void getCellCursor(tools::JsonWriter &)
Get position and size of cell cursor in Calc - as JSON in the current' views' co-ordinate system...
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 OUString getPartName(int)
Get the name of the currently displayed part, i.e.
virtual void selectPart(int, int)
Select/Unselect a document "part", i.e.
virtual void setPartMode(int)
virtual void setClientVisibleArea(const tools::Rectangle &)