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<const 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  long nTileWidth,
65  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 
185  virtual void getCellCursor(tools::JsonWriter& /*rJsonWriter*/)
186  {
187  }
188 
189  virtual PointerStyle getPointer() = 0;
190 
192  virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
193 
195  virtual bool isMimeTypeSupported() = 0;
196 
205  virtual void setClientZoom(int /*nTilePixelWidth*/,
206  int /*nTilePixelHeight*/,
207  int /*nTileTwipWidth*/,
208  int /*nTileTwipHeight*/)
209  {}
210 
212  virtual void setClientVisibleArea(const tools::Rectangle& /*rRectangle*/)
213  {
214  }
215 
224  virtual void setOutlineState(bool /*bColumn*/, int /*nLevel*/, int /*nIndex*/, bool /*bHidden*/)
225  {
226  return;
227  }
228 
233  {
234  }
235 
238  virtual void getTrackedChangeAuthors(tools::JsonWriter& /*rJsonWriter*/)
239  {
240  }
241 
244  virtual void getPostIts(tools::JsonWriter& /*rJsonWriter*/)
245  {
246  }
247 
250  virtual void getPostItsPos(tools::JsonWriter& /*rJsonWriter*/)
251  {
252  }
253 
256  virtual void getRulerState(tools::JsonWriter& /*rJsonWriter*/)
257  {
258  }
259 
260  /*
261  * Used for sheets in spreadsheet documents,
262  * and slides in presentation documents.
263  */
264  virtual OUString getPartInfo(int /*nPart*/)
265  {
266  return OUString();
267  }
268 
274  virtual void selectPart(int /*nPart*/, int /*nSelect*/) {}
275 
281  virtual void moveSelectedParts(int /*nPosition*/, bool /*bDuplicate*/) {}
282 
284  virtual void completeFunction(const OUString& /*rFunctionName*/)
285  {
286  }
287 
292  virtual bool isDisposed() const
293  {
294  return false;
295  }
296 
301  virtual void executeFromFieldEvent(const StringMap&)
302  {
303  }
304 };
305 } // namespace vcl
306 
307 #endif // INCLUDED_VCL_ITILEDRENDERABLE_HXX
308 
309 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::map< const OUString, OUString > StringMap
virtual void executeFromFieldEvent(const StringMap &)
Execute a form field event in the document.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
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 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 &)