2014-06-13 17:31:42 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_VCL_ITILEDRENDERABLE_HXX
|
|
|
|
#define INCLUDED_VCL_ITILEDRENDERABLE_HXX
|
|
|
|
|
2015-03-13 09:14:16 +01:00
|
|
|
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
|
2014-06-13 17:31:42 +01:00
|
|
|
#include <tools/gen.hxx>
|
2015-11-11 10:05:25 +01:00
|
|
|
#include <vcl/pointr.hxx>
|
2014-06-13 17:31:42 +01:00
|
|
|
#include <vcl/virdev.hxx>
|
2015-11-10 16:34:55 -05:00
|
|
|
#include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
|
2014-06-13 17:31:42 +01:00
|
|
|
|
|
|
|
namespace vcl
|
|
|
|
{
|
|
|
|
|
|
|
|
class VCL_DLLPUBLIC ITiledRenderable
|
|
|
|
{
|
2015-11-06 14:34:28 +02:00
|
|
|
protected:
|
2016-01-08 15:47:42 +11:00
|
|
|
int mnTilePixelWidth, mnTilePixelHeight;
|
|
|
|
int mnTileTwipWidth, mnTileTwipHeight;
|
2014-06-13 17:31:42 +01:00
|
|
|
public:
|
2014-06-25 17:18:46 +02:00
|
|
|
virtual ~ITiledRenderable();
|
2014-06-13 17:31:42 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Paint a tile to a given VirtualDevice.
|
|
|
|
*
|
|
|
|
* Output parameters are measured in pixels, tile parameters are in
|
|
|
|
* twips.
|
|
|
|
*/
|
|
|
|
virtual void paintTile( VirtualDevice &rDevice,
|
|
|
|
int nOutputWidth,
|
|
|
|
int nOutputHeight,
|
|
|
|
int nTilePosX,
|
|
|
|
int nTilePosY,
|
|
|
|
long nTileWidth,
|
|
|
|
long nTileHeight ) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the document size in twips.
|
|
|
|
*/
|
|
|
|
virtual Size getDocumentSize() = 0;
|
|
|
|
|
2014-07-08 15:23:06 +02:00
|
|
|
/**
|
|
|
|
* Set the document "part", i.e. slide for a slideshow, and
|
|
|
|
* tab for a spreadsheet.
|
|
|
|
*/
|
2014-07-29 13:28:49 +02:00
|
|
|
virtual void setPart( int nPart )
|
|
|
|
{
|
|
|
|
(void) nPart;
|
|
|
|
}
|
2014-07-08 15:23:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the number of parts -- see setPart for further details.
|
|
|
|
*/
|
2014-07-29 13:28:49 +02:00
|
|
|
virtual int getParts()
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
2014-07-08 15:23:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the currently displayed/selected part -- see setPart for further
|
|
|
|
* details.
|
|
|
|
*/
|
2014-07-29 13:28:49 +02:00
|
|
|
virtual int getPart()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2014-07-29 08:50:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name of the currently displayed part, i.e. sheet in a spreadsheet
|
|
|
|
* or slide in a presentation.
|
|
|
|
*/
|
|
|
|
virtual OUString getPartName(int nPart)
|
|
|
|
{
|
|
|
|
(void) nPart;
|
2014-07-30 13:30:07 +02:00
|
|
|
return OUString("");
|
2014-07-29 08:50:34 +02:00
|
|
|
}
|
2014-07-29 08:59:13 +02:00
|
|
|
|
2016-04-20 13:52:31 -04:00
|
|
|
/**
|
|
|
|
* Get the hash of the currently displayed part, i.e. sheet in a spreadsheet
|
|
|
|
* or slide in a presentation.
|
|
|
|
*/
|
|
|
|
virtual OUString getPartHash(int nPart) = 0;
|
|
|
|
|
2015-02-20 16:21:06 +01:00
|
|
|
/// @see lok::Document::setPartMode().
|
|
|
|
virtual void setPartMode(int nPartMode)
|
2014-07-29 08:59:13 +02:00
|
|
|
{
|
2015-02-20 16:21:06 +01:00
|
|
|
(void) nPartMode;
|
2014-07-29 08:59:13 +02:00
|
|
|
}
|
2014-12-29 16:10:48 +09:00
|
|
|
|
2015-02-04 14:48:57 +01:00
|
|
|
/**
|
|
|
|
* Setup various document properties that are needed for the document to
|
|
|
|
* be renderable via tiled rendering.
|
|
|
|
*/
|
2015-11-18 15:20:30 +01:00
|
|
|
virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) = 0;
|
2015-01-06 15:06:51 +01:00
|
|
|
|
2015-04-03 12:29:28 +02:00
|
|
|
/**
|
|
|
|
* Posts a keyboard event on the document.
|
|
|
|
*
|
|
|
|
* @see lok::Document::postKeyEvent().
|
|
|
|
*/
|
|
|
|
virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) = 0;
|
|
|
|
|
2015-01-21 12:42:08 +01:00
|
|
|
/**
|
|
|
|
* Posts a mouse event on the document.
|
|
|
|
*
|
|
|
|
* @see lok::Document::postMouseEvent().
|
|
|
|
*/
|
2015-10-04 19:40:13 +03:00
|
|
|
virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) = 0;
|
2015-02-10 17:43:18 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the start or end of a text selection.
|
|
|
|
*
|
|
|
|
* @see lok::Document::setTextSelection().
|
|
|
|
*/
|
2015-03-24 17:13:19 +01:00
|
|
|
virtual void setTextSelection(int nType, int nX, int nY) = 0;
|
2015-03-10 09:40:38 +01:00
|
|
|
|
2015-06-17 18:00:01 +02:00
|
|
|
/**
|
|
|
|
* Gets the text selection.
|
|
|
|
*
|
|
|
|
* @see lok::Document::getTextSelection().
|
|
|
|
*/
|
2015-07-10 09:11:20 +02:00
|
|
|
virtual OString getTextSelection(const char* pMimeType, OString& rUsedMimeType) = 0;
|
2015-06-17 18:00:01 +02:00
|
|
|
|
2015-03-10 09:40:38 +01:00
|
|
|
/**
|
|
|
|
* Adjusts the graphic selection.
|
|
|
|
*
|
|
|
|
* @see lok::Document::setGraphicSelection().
|
|
|
|
*/
|
2015-03-26 12:33:40 +01:00
|
|
|
virtual void setGraphicSelection(int nType, int nX, int nY) = 0;
|
2015-03-10 16:13:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see lok::Document::resetSelection().
|
|
|
|
*/
|
2015-03-26 15:37:45 +01:00
|
|
|
virtual void resetSelection() = 0;
|
2015-09-29 10:47:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @see lok::Document::getPartPageRectangles().
|
|
|
|
*/
|
|
|
|
virtual OUString getPartPageRectangles()
|
|
|
|
{
|
|
|
|
return OUString();
|
|
|
|
}
|
2015-10-22 10:15:34 +02:00
|
|
|
|
2015-10-30 11:18:19 +01:00
|
|
|
/**
|
|
|
|
* Get position and content of row/column headers of Calc documents.
|
2015-11-03 15:05:37 +01:00
|
|
|
*
|
|
|
|
* @param rRectangle - if not empty, then limit the output only to the area of this rectangle
|
|
|
|
* @return a JSON describing position/content of rows/columns
|
2015-10-30 11:18:19 +01:00
|
|
|
*/
|
2016-01-08 15:18:26 +11:00
|
|
|
virtual OUString getRowColumnHeaders(const Rectangle& rRectangle)
|
2015-10-30 11:18:19 +01:00
|
|
|
{
|
2016-01-08 15:18:26 +11:00
|
|
|
(void) rRectangle;
|
2015-10-30 11:18:19 +01:00
|
|
|
return OUString();
|
|
|
|
}
|
|
|
|
|
2015-11-04 17:24:15 +01:00
|
|
|
/**
|
|
|
|
* Get position and size of cell cursor in Calc.
|
|
|
|
* (This could maybe also be used for tables in Writer/Impress in future?)
|
|
|
|
*/
|
|
|
|
virtual OString getCellCursor(int /*nOutputWidth*/,
|
|
|
|
int /*nOutputHeight*/,
|
|
|
|
long /*nTileWidth*/,
|
|
|
|
long /*nTileHeight*/)
|
|
|
|
{
|
|
|
|
return OString();
|
|
|
|
}
|
|
|
|
|
2015-11-11 10:05:25 +01:00
|
|
|
virtual Pointer getPointer() = 0;
|
|
|
|
|
2015-10-28 09:44:37 +01:00
|
|
|
/// Sets the clipboard of the component.
|
|
|
|
virtual void setClipboard(const css::uno::Reference<css::datatransfer::clipboard::XClipboard>& xClipboard) = 0;
|
2015-10-26 11:28:55 +01:00
|
|
|
|
2015-10-26 13:42:02 +01:00
|
|
|
/// If the current contents of the clipboard is something we can paste.
|
|
|
|
virtual bool isMimeTypeSupported() = 0;
|
2015-11-06 14:34:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Save the client's view so that we can compute the right zoom level
|
|
|
|
* for the mouse events.
|
|
|
|
* @param nTilePixelWidth - tile width in pixels
|
|
|
|
* @param nTilePixelHeight - tile height in pixels
|
|
|
|
* @param nTileTwipWidth - tile width in twips
|
|
|
|
* @param nTileTwipHeight - tile height in twips
|
|
|
|
*/
|
2016-01-08 15:18:26 +11:00
|
|
|
virtual void setClientZoom(int nTilePixelWidth,
|
|
|
|
int nTilePixelHeight,
|
|
|
|
int nTileTwipWidth,
|
|
|
|
int nTileTwipHeight)
|
2015-11-06 14:34:28 +02:00
|
|
|
{
|
2016-01-08 15:18:26 +11:00
|
|
|
(void) nTilePixelWidth;
|
|
|
|
(void) nTilePixelHeight;
|
|
|
|
(void) nTileTwipWidth;
|
|
|
|
(void) nTileTwipHeight;
|
2015-11-06 14:34:28 +02:00
|
|
|
}
|
2016-02-02 10:32:36 +01:00
|
|
|
|
|
|
|
/// @see lok::Document::setClientVisibleArea().
|
|
|
|
virtual void setClientVisibleArea(const Rectangle& /*rRectangle*/)
|
|
|
|
{
|
|
|
|
}
|
2016-08-30 15:34:11 +02:00
|
|
|
|
|
|
|
/// Implementation for
|
|
|
|
/// lok::Document::getCommandValues(".uno:AcceptTrackedChanges") when there
|
|
|
|
/// is no matching UNO API.
|
|
|
|
virtual OUString getTrackedChanges()
|
|
|
|
{
|
|
|
|
return OUString();
|
|
|
|
}
|
2016-09-21 17:27:48 +02:00
|
|
|
|
|
|
|
/// Implementation for
|
|
|
|
/// lok::Document::getCommandValues(".uno:TrackedChangeAuthors").
|
|
|
|
virtual OUString getTrackedChangeAuthors()
|
|
|
|
{
|
|
|
|
return OUString();
|
|
|
|
}
|
2014-06-13 17:31:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace vcl
|
|
|
|
|
|
|
|
#endif // INCLUDED_VCL_ITILEDRENDERABLE_HXX
|
2015-09-14 12:50:48 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|