Kaydet (Commit) 3d81ec33 authored tarafından Pranav Kant's avatar Pranav Kant

lokdialog: Add dialog APIs to lok::Document class

Change-Id: I1947dc84c91e2e01072fbff3e97aa94d514ecb5a
üst fa02b636
......@@ -266,19 +266,21 @@ struct _LibreOfficeKitDocumentClass
int* pArray,
size_t nSize);
/// WIP
/// Paints dialog with given dialog id to the buffer
/// @see lok::Document::paintDialog().
void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
/// @see lok::Document::paintActiveFloatingWindow().
void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
/// WIP
/// @see lok::Document::postDialogKeyEvent().
void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis,
const char* pDialogId,
int nType,
int nCharCode,
int nKeyCode);
/// WIP
/// @see lok::Document::postDialogMouseEvent().
void (*postDialogMouseEvent) (LibreOfficeKitDocument* pThis,
const char* pDialogId,
int nType,
......@@ -288,7 +290,7 @@ struct _LibreOfficeKitDocumentClass
int nButtons,
int nModifier);
/// WIP
/// @see lok::Document::postDialogChildMouseEvent().
void (*postDialogChildMouseEvent) (LibreOfficeKitDocument* pThis,
const char* pDialogId,
int nType,
......
......@@ -155,6 +155,25 @@ public:
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
}
/**
* Renders a dialog with give dialog id and writes the width and height of the rendered dialog
*
* Client must truncate pBuffer according to the nWidth and nHeight returned after the call.
*
* @param pDialogId Unique dialog id to be painted
* @param pBuffer Buffer with enough memory allocated to render any dialog
* @param nWidth output parameter returning the width of the rendered dialog.
* @param nHeight output parameter returning the height of the rendered dialog
*/
void paintDialog(const char* pDialogId,
unsigned char* pBuffer,
int& nWidth,
int& nHeight)
{
return mpDoc->pClass->paintDialog(mpDoc, pDialogId, pBuffer,
&nWidth, &nHeight);
}
/**
* Gets the tile mode: the pixel format used for the pBuffer of paintTile().
*
......@@ -235,6 +254,22 @@ public:
mpDoc->pClass->postMouseEvent(mpDoc, nType, nX, nY, nCount, nButtons, nModifier);
}
/**
* Posts a mouse event to the dialog with given id.
*
* @param aDialogId Dialog id where mouse event is to be posted
* @param nType Event type, like down, move or up.
* @param nX horizontal position in document coordinates
* @param nY vertical position in document coordinates
* @param nCount number of clicks: 1 for single click, 2 for double click
* @param nButtons: which mouse buttons: 1 for left, 2 for middle, 4 right
* @param nModifier: which keyboard modifier: (see include/vcl/vclenum.hxx for possible values)
*/
void postDialogMouseEvent(const char* pDialogId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
mpDoc->pClass->postDialogMouseEvent(mpDoc, pDialogId, nType, nX, nY, nCount, nButtons, nModifier);
}
/**
* Posts an UNO command to the document.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment