2013-11-15 12:09:10 +00: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/.
|
|
|
|
*/
|
|
|
|
|
2015-02-02 11:03:13 +01:00
|
|
|
#ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_H
|
|
|
|
#define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_H
|
2013-11-15 12:09:10 +00:00
|
|
|
|
2014-06-12 16:33:23 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2015-03-13 09:14:16 +01:00
|
|
|
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
|
|
|
|
|
2013-11-15 12:09:10 +00:00
|
|
|
#ifdef __cplusplus
|
2014-04-06 12:05:13 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2013-11-15 12:09:10 +00:00
|
|
|
#endif
|
|
|
|
|
2014-06-10 11:31:51 +01:00
|
|
|
typedef struct _LibreOfficeKit LibreOfficeKit;
|
2014-06-17 15:13:33 +01:00
|
|
|
typedef struct _LibreOfficeKitClass LibreOfficeKitClass;
|
|
|
|
|
2014-06-10 11:31:51 +01:00
|
|
|
typedef struct _LibreOfficeKitDocument LibreOfficeKitDocument;
|
2014-06-17 15:13:33 +01:00
|
|
|
typedef struct _LibreOfficeKitDocumentClass LibreOfficeKitDocumentClass;
|
2013-11-15 12:09:10 +00:00
|
|
|
|
2014-06-12 13:28:26 +01:00
|
|
|
// Do we have an extended member in this struct ?
|
|
|
|
#define LIBREOFFICEKIT_HAS_MEMBER(strct,member,nSize) \
|
2015-03-10 16:13:39 +01:00
|
|
|
(offsetof(strct, member) < (nSize))
|
2014-06-12 13:28:26 +01:00
|
|
|
|
2014-06-17 15:13:33 +01:00
|
|
|
#define LIBREOFFICEKIT_HAS(pKit,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitClass,member,(pKit)->pClass->nSize)
|
2014-06-12 13:28:26 +01:00
|
|
|
|
2014-06-10 11:31:51 +01:00
|
|
|
struct _LibreOfficeKit
|
2014-06-17 15:13:33 +01:00
|
|
|
{
|
|
|
|
LibreOfficeKitClass* pClass;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _LibreOfficeKitClass
|
2014-04-06 12:05:13 +02:00
|
|
|
{
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
size_t nSize;
|
|
|
|
|
|
|
|
void (*destroy) (LibreOfficeKit* pThis);
|
|
|
|
|
|
|
|
LibreOfficeKitDocument* (*documentLoad) (LibreOfficeKit* pThis,
|
|
|
|
const char* pURL);
|
|
|
|
|
|
|
|
char* (*getError) (LibreOfficeKit* pThis);
|
|
|
|
|
|
|
|
LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis,
|
|
|
|
const char* pURL,
|
|
|
|
const char* pOptions);
|
2015-05-06 16:43:33 +03:00
|
|
|
#ifdef LOK_USE_UNSTABLE_API
|
|
|
|
void (*registerCallback) (LibreOfficeKit* pThis,
|
|
|
|
LibreOfficeKitCallback pCallback,
|
|
|
|
void* pData);
|
|
|
|
#endif
|
2013-11-15 12:09:10 +00:00
|
|
|
};
|
|
|
|
|
2014-06-17 15:13:33 +01:00
|
|
|
#define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
|
2014-06-12 13:28:26 +01:00
|
|
|
|
2014-06-10 11:31:51 +01:00
|
|
|
struct _LibreOfficeKitDocument
|
2014-06-17 15:13:33 +01:00
|
|
|
{
|
|
|
|
LibreOfficeKitDocumentClass* pClass;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _LibreOfficeKitDocumentClass
|
2014-04-06 12:05:13 +02:00
|
|
|
{
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
size_t nSize;
|
|
|
|
|
|
|
|
void (*destroy) (LibreOfficeKitDocument* pThis);
|
|
|
|
|
|
|
|
int (*saveAs) (LibreOfficeKitDocument* pThis,
|
|
|
|
const char* pUrl,
|
|
|
|
const char* pFormat,
|
|
|
|
const char* pFilterOptions);
|
2013-11-15 12:09:10 +00:00
|
|
|
|
2014-05-09 14:37:27 +01:00
|
|
|
#ifdef LOK_USE_UNSTABLE_API
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
/// @see lok::Document::getDocumentType().
|
|
|
|
int (*getDocumentType) (LibreOfficeKitDocument* pThis);
|
|
|
|
|
|
|
|
/// @see lok::Document::getParts().
|
|
|
|
int (*getParts) (LibreOfficeKitDocument* pThis);
|
|
|
|
|
|
|
|
/// @see lok::Document::getPart().
|
|
|
|
int (*getPart) (LibreOfficeKitDocument* pThis);
|
|
|
|
|
|
|
|
/// @see lok::Document::setPart().
|
|
|
|
void (*setPart) (LibreOfficeKitDocument* pThis,
|
|
|
|
int nPart);
|
|
|
|
|
|
|
|
/// @see lok::Document::getPartName().
|
|
|
|
char* (*getPartName) (LibreOfficeKitDocument* pThis,
|
|
|
|
int nPart);
|
|
|
|
|
|
|
|
/** Sets mode of the current part.
|
|
|
|
*
|
|
|
|
* @param nMode - element from the LibreOfficeKitPartMode enum.
|
|
|
|
*/
|
|
|
|
void (*setPartMode) (LibreOfficeKitDocument* pThis,
|
|
|
|
int nMode);
|
|
|
|
|
|
|
|
/// @see lok::Document::paintTile().
|
|
|
|
void (*paintTile) (LibreOfficeKitDocument* pThis,
|
|
|
|
unsigned char* pBuffer,
|
|
|
|
const int nCanvasWidth,
|
|
|
|
const int nCanvasHeight,
|
|
|
|
const int nTilePosX,
|
|
|
|
const int nTilePosY,
|
|
|
|
const int nTileWidth,
|
|
|
|
const int nTileHeight);
|
|
|
|
|
|
|
|
/// @see lok::Document::getDocumentSize().
|
|
|
|
void (*getDocumentSize) (LibreOfficeKitDocument* pThis,
|
|
|
|
long* pWidth,
|
|
|
|
long* pHeight);
|
|
|
|
|
|
|
|
/// @see lok::Document::initializeForRendering().
|
|
|
|
void (*initializeForRendering) (LibreOfficeKitDocument* pThis);
|
|
|
|
|
|
|
|
void (*registerCallback) (LibreOfficeKitDocument* pThis,
|
2015-01-06 15:49:12 +01:00
|
|
|
LibreOfficeKitCallback pCallback,
|
|
|
|
void* pData);
|
2015-01-21 12:42:08 +01:00
|
|
|
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
/// @see lok::Document::postKeyEvent
|
|
|
|
void (*postKeyEvent) (LibreOfficeKitDocument* pThis,
|
|
|
|
int nType,
|
|
|
|
int nCharCode,
|
|
|
|
int nKeyCode);
|
|
|
|
|
|
|
|
/// @see lok::Document::postMouseEvent
|
|
|
|
void (*postMouseEvent) (LibreOfficeKitDocument* pThis,
|
|
|
|
int nType,
|
|
|
|
int nX,
|
|
|
|
int nY,
|
|
|
|
int nCount);
|
|
|
|
|
|
|
|
/// @see lok::Document::postUnoCommand
|
|
|
|
void (*postUnoCommand) (LibreOfficeKitDocument* pThis,
|
2015-04-22 14:28:36 +02:00
|
|
|
const char* pCommand,
|
|
|
|
const char* pArguments);
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
|
|
|
|
/// @see lok::Document::setTextSelection
|
|
|
|
void (*setTextSelection) (LibreOfficeKitDocument* pThis,
|
2015-03-19 13:58:12 +02:00
|
|
|
int nType,
|
|
|
|
int nX,
|
|
|
|
int nY);
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
|
2015-06-17 18:00:01 +02:00
|
|
|
/// @see lok::Document::getTextSelection
|
|
|
|
char* (*getTextSelection) (LibreOfficeKitDocument* pThis,
|
2015-06-19 18:13:27 +02:00
|
|
|
const char* pMimeType,
|
|
|
|
char** pUsedMimeType);
|
2015-06-17 18:00:01 +02:00
|
|
|
|
The mode lines says we use 4-column indentation steps, so do that then
Also, be consistent in spacing, indentation and alignment. Inconsistency is
infuritating.
In this case, I decided to drop the attempts to align the names of "methods",
and their parameter lists. They were not all aligned anyway, and some of those
that tried to be in fact were off by one column. Also, consistently use a
blank line between the method pointers,
If you feel strongly about this and *want* such inter-line alignment, by all
means re-introduce it, but at least try to be consistent then, and do it for
all methods.
Change-Id: I382ca0eaf8533ebc3f829ebd978a9676ebcefaf0
2015-04-16 12:34:43 +03:00
|
|
|
/// @see lok::Document::setGraphicSelection
|
|
|
|
void (*setGraphicSelection) (LibreOfficeKitDocument* pThis,
|
|
|
|
int nType,
|
|
|
|
int nX,
|
|
|
|
int nY);
|
|
|
|
|
|
|
|
/// @see lok::Document::resetSelection
|
|
|
|
void (*resetSelection) (LibreOfficeKitDocument* pThis);
|
2014-05-09 14:37:27 +01:00
|
|
|
#endif // LOK_USE_UNSTABLE_API
|
2013-11-15 12:09:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2014-04-08 17:39:10 +02:00
|
|
|
}
|
2013-11-15 12:09:10 +00:00
|
|
|
#endif
|
|
|
|
|
2015-02-02 11:03:13 +01:00
|
|
|
#endif // INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_H
|
|
|
|
|
2013-11-15 12:09:10 +00:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|