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 { namespace 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 
28 class VirtualDevice;
29 
30 namespace vcl
31 {
32  /*
33  * Map directly to css cursor styles to avoid further mapping in the client.
34  * Gtk (via gdk_cursor_new_from_name) also supports the same css cursor styles.
35  *
36  * This was created partially with help of the mappings in gtkdata.cxx.
37  * The list is incomplete as some cursor style simply aren't supported
38  * by css, it might turn out to be worth mapping some of these missing cursors
39  * to available cursors?
40  */
41  extern const std::map <PointerStyle, OString> gaLOKPointerMap;
42 
43 
45 {
46 protected:
47  int mnTilePixelWidth, mnTilePixelHeight;
48  int mnTileTwipWidth, mnTileTwipHeight;
49 public:
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 OUString getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/)
177  {
178  return OUString();
179  }
180 
185  virtual OString getCellCursor(int /*nOutputWidth*/,
186  int /*nOutputHeight*/,
187  long /*nTileWidth*/,
188  long /*nTileHeight*/)
189  {
190  return OString();
191  }
192 
193  virtual PointerStyle getPointer() = 0;
194 
196  virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
197 
199  virtual bool isMimeTypeSupported() = 0;
200 
209  virtual void setClientZoom(int /*nTilePixelWidth*/,
210  int /*nTilePixelHeight*/,
211  int /*nTileTwipWidth*/,
212  int /*nTileTwipHeight*/)
213  {}
214 
216  virtual void setClientVisibleArea(const tools::Rectangle& /*rRectangle*/)
217  {
218  }
219 
228  virtual void setOutlineState(bool /*bColumn*/, int /*nLevel*/, int /*nIndex*/, bool /*bHidden*/)
229  {
230  return;
231  }
232 
236  virtual OUString getTrackedChanges()
237  {
238  return OUString();
239  }
240 
243  virtual OUString getTrackedChangeAuthors()
244  {
245  return OUString();
246  }
247 
250  virtual OUString getPostIts()
251  {
252  return OUString();
253  }
254 
257  virtual OUString getPostItsPos()
258  {
259  return OUString();
260  }
261 
264  virtual OUString getRulerState()
265  {
266  return OUString();
267  }
268 
269  /*
270  * Used for sheets in spreadsheet documents,
271  * and slides in presentation documents.
272  */
273  virtual OUString getPartInfo(int /*nPart*/)
274  {
275  return OUString();
276  }
277 
283  virtual void selectPart(int /*nPart*/, int /*nSelect*/) {}
284 
290  virtual void moveSelectedParts(int /*nPosition*/, bool /*bDuplicate*/) {}
291 };
292 } // namespace vcl
293 
294 #endif // INCLUDED_VCL_ITILEDRENDERABLE_HXX
295 
296 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString getPostItsPos()
Implementation for lok::Document::getCommandValues(".uno:ViewAnnotationsPosition");.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
virtual OString getCellCursor(int, int, long, long)
Get position and size of cell cursor in Calc.
Reference
virtual int getPart()
Get the currently displayed/selected part – see setPart for further details.
const std::map< PointerStyle, OString > gaLOKPointerMap
virtual OUString getPartPageRectangles()
virtual OUString getTrackedChanges()
Implementation for lok::Document::getCommandValues(".uno:AcceptTrackedChanges") when there is no matc...
virtual void moveSelectedParts(int, bool)
Move selected pages/slides to a new position.
virtual void setOutlineState(bool, int, int, bool)
Show/Hide a single row/column header outline for Calc documents.
virtual OUString getRowColumnHeaders(const tools::Rectangle &)
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 OUString getTrackedChangeAuthors()
Implementation for lok::Document::getCommandValues(".uno:TrackedChangeAuthors").
PointerStyle
Definition: ptrstyle.hxx:25
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 getRulerState()
Implementation for lok::Document::getCommandValues(".uno:RulerState");.
virtual OUString getPostIts()
Implementation for lok::Document::getCommandValues(".uno:ViewAnnotations");.
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 &)