Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
32cfef5c
Kaydet (Commit)
32cfef5c
authored
Mar 30, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
LOK: document remaining Document member functions
Change-Id: Idc5836317c01780bb5078d39d8c31775886027d0
üst
fa2948bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
17 deletions
+67
-17
LibreOfficeKit.h
include/LibreOfficeKit/LibreOfficeKit.h
+8
-16
LibreOfficeKit.hxx
include/LibreOfficeKit/LibreOfficeKit.hxx
+59
-1
No files found.
include/LibreOfficeKit/LibreOfficeKit.h
Dosyayı görüntüle @
32cfef5c
...
@@ -65,24 +65,19 @@ struct _LibreOfficeKitDocumentClass
...
@@ -65,24 +65,19 @@ struct _LibreOfficeKitDocumentClass
const
char
*
pFormat
,
const
char
*
pFormat
,
const
char
*
pFilterOptions
);
const
char
*
pFilterOptions
);
#ifdef LOK_USE_UNSTABLE_API
#ifdef LOK_USE_UNSTABLE_API
/** Get document type.
/// @see lok::Document::getDocumentType().
*
* @returns an element of the LibreOfficeKitDocumentType enum.
*/
int
(
*
getDocumentType
)
(
LibreOfficeKitDocument
*
pThis
);
int
(
*
getDocumentType
)
(
LibreOfficeKitDocument
*
pThis
);
/** Get number of part that the document contains.
/// @see lok::Document::getParts().
* Part refers to either indivual sheets in a Spreadsheet,
* or slides in a Slideshow, and has no relevance for
* writer documents.
*/
int
(
*
getParts
)
(
LibreOfficeKitDocument
*
pThis
);
int
(
*
getParts
)
(
LibreOfficeKitDocument
*
pThis
);
/
** Get current part of the document */
/
// @see lok::Document::getPart().
int
(
*
getPart
)
(
LibreOfficeKitDocument
*
pThis
);
int
(
*
getPart
)
(
LibreOfficeKitDocument
*
pThis
);
/// @see lok::Document::setPart().
void
(
*
setPart
)
(
LibreOfficeKitDocument
*
pThis
,
void
(
*
setPart
)
(
LibreOfficeKitDocument
*
pThis
,
int
nPart
);
int
nPart
);
/// @see lok::Document::getPartName().
char
*
(
*
getPartName
)
(
LibreOfficeKitDocument
*
pThis
,
char
*
(
*
getPartName
)
(
LibreOfficeKitDocument
*
pThis
,
int
nPart
);
int
nPart
);
...
@@ -93,6 +88,7 @@ struct _LibreOfficeKitDocumentClass
...
@@ -93,6 +88,7 @@ struct _LibreOfficeKitDocumentClass
void
(
*
setPartMode
)
(
LibreOfficeKitDocument
*
pThis
,
void
(
*
setPartMode
)
(
LibreOfficeKitDocument
*
pThis
,
int
nMode
);
int
nMode
);
/// @see lok::Document::paintTile().
void
(
*
paintTile
)
(
LibreOfficeKitDocument
*
pThis
,
void
(
*
paintTile
)
(
LibreOfficeKitDocument
*
pThis
,
unsigned
char
*
pBuffer
,
unsigned
char
*
pBuffer
,
const
int
nCanvasWidth
,
const
int
nCanvasWidth
,
...
@@ -102,16 +98,12 @@ struct _LibreOfficeKitDocumentClass
...
@@ -102,16 +98,12 @@ struct _LibreOfficeKitDocumentClass
const
int
nTileWidth
,
const
int
nTileWidth
,
const
int
nTileHeight
);
const
int
nTileHeight
);
/
** Get the document sizes in twips. */
/
// @see lok::Document::getDocumentSize().
void
(
*
getDocumentSize
)
(
LibreOfficeKitDocument
*
pThis
,
void
(
*
getDocumentSize
)
(
LibreOfficeKitDocument
*
pThis
,
long
*
pWidth
,
long
*
pWidth
,
long
*
pHeight
);
long
*
pHeight
);
/** Initialize document for rendering.
/// @see lok::Document::initializeForRendering().
* Sets the rendering and document parameters to default values
* that are needed to render the document correctly using
* tiled rendering.
*/
void
(
*
initializeForRendering
)
(
LibreOfficeKitDocument
*
pThis
);
void
(
*
initializeForRendering
)
(
LibreOfficeKitDocument
*
pThis
);
void
(
*
registerCallback
)
(
LibreOfficeKitDocument
*
pThis
,
void
(
*
registerCallback
)
(
LibreOfficeKitDocument
*
pThis
,
...
...
include/LibreOfficeKit/LibreOfficeKit.hxx
Dosyayı görüntüle @
32cfef5c
...
@@ -21,12 +21,14 @@
...
@@ -21,12 +21,14 @@
namespace
lok
namespace
lok
{
{
/// The lok::Document class represents one loaded document instance.
class
Document
class
Document
{
{
private
:
private
:
LibreOfficeKitDocument
*
mpDoc
;
LibreOfficeKitDocument
*
mpDoc
;
public
:
public
:
/// A lok::Document is typically created by the lok::Office::documentLoad() method.
inline
Document
(
LibreOfficeKitDocument
*
pDoc
)
:
inline
Document
(
LibreOfficeKitDocument
*
pDoc
)
:
mpDoc
(
pDoc
)
mpDoc
(
pDoc
)
{}
{}
...
@@ -36,39 +38,77 @@ public:
...
@@ -36,39 +38,77 @@ public:
mpDoc
->
pClass
->
destroy
(
mpDoc
);
mpDoc
->
pClass
->
destroy
(
mpDoc
);
}
}
/**
* Stores the document's persistent data to a URL and
* continues to be a representation of the old URL.
*
* @param pUrl the location where to store the document
* @param pFormat the format to use while exporting, when omitted, then deducted from pURL's extension
* @param pFilterOptions options for the export filter, e.g. SkipImages.
*/
inline
bool
saveAs
(
const
char
*
pUrl
,
const
char
*
pFormat
=
NULL
,
const
char
*
pFilterOptions
=
NULL
)
inline
bool
saveAs
(
const
char
*
pUrl
,
const
char
*
pFormat
=
NULL
,
const
char
*
pFilterOptions
=
NULL
)
{
{
return
mpDoc
->
pClass
->
saveAs
(
mpDoc
,
pUrl
,
pFormat
,
pFilterOptions
)
!=
0
;
return
mpDoc
->
pClass
->
saveAs
(
mpDoc
,
pUrl
,
pFormat
,
pFilterOptions
)
!=
0
;
}
}
/// Gives access to the underlying C pointer.
inline
LibreOfficeKitDocument
*
get
()
{
return
mpDoc
;
}
inline
LibreOfficeKitDocument
*
get
()
{
return
mpDoc
;
}
#ifdef LOK_USE_UNSTABLE_API
#ifdef LOK_USE_UNSTABLE_API
/**
* Get document type.
*
* @return an element of the LibreOfficeKitDocumentType enum.
*/
inline
int
getDocumentType
()
inline
int
getDocumentType
()
{
{
return
mpDoc
->
pClass
->
getDocumentType
(
mpDoc
);
return
mpDoc
->
pClass
->
getDocumentType
(
mpDoc
);
}
}
/**
* Get number of part that the document contains.
*
* Part refers to either indivual sheets in a Calc, or slides in Impress,
* and has no relevance for Writer.
*/
inline
int
getParts
()
inline
int
getParts
()
{
{
return
mpDoc
->
pClass
->
getParts
(
mpDoc
);
return
mpDoc
->
pClass
->
getParts
(
mpDoc
);
}
}
/// Get the current part of the document.
inline
int
getPart
()
inline
int
getPart
()
{
{
return
mpDoc
->
pClass
->
getPart
(
mpDoc
);
return
mpDoc
->
pClass
->
getPart
(
mpDoc
);
}
}
/// Set the current part of the document.
inline
void
setPart
(
int
nPart
)
inline
void
setPart
(
int
nPart
)
{
{
mpDoc
->
pClass
->
setPart
(
mpDoc
,
nPart
);
mpDoc
->
pClass
->
setPart
(
mpDoc
,
nPart
);
}
}
/// Get the current part's name.
inline
char
*
getPartName
(
int
nPart
)
inline
char
*
getPartName
(
int
nPart
)
{
{
return
mpDoc
->
pClass
->
getPartName
(
mpDoc
,
nPart
);
return
mpDoc
->
pClass
->
getPartName
(
mpDoc
,
nPart
);
}
}
/**
* Renders a subset of the document to a pre-allocated buffer.
*
* Note that the buffer size and the tile size implicitly supports
* rendering at different zoom levels, as the number of rendered pixels and
* the rendered rectangle of the document are independent.
*
* @param pBuffer pointer to the buffer, its size is determined by nCanvasWidth and nCanvasHeight.
* @param nCanvasWidth number of pixels in a row of pBuffer.
* @param nCanvasHeight number of pixels in a column of pBuffer.
* @param nTilePosX logical X position of the top left corner of the rendered rectangle, in TWIPs.
* @param nTilePosY logical Y position of the top left corner of the rendered rectangle, in TWIPs.
* @param nTileWidth logical width of the rendered rectangle, in TWIPs.
* @param nTileHeight logical height of the rendered rectangle, in TWIPs.
*/
inline
void
paintTile
(
inline
void
paintTile
(
unsigned
char
*
pBuffer
,
unsigned
char
*
pBuffer
,
const
int
nCanvasWidth
,
const
int
nCanvasWidth
,
...
@@ -82,11 +122,20 @@ public:
...
@@ -82,11 +122,20 @@ public:
nTilePosX
,
nTilePosY
,
nTileWidth
,
nTileHeight
);
nTilePosX
,
nTilePosY
,
nTileWidth
,
nTileHeight
);
}
}
/// Get the document sizes in TWIPs.
inline
void
getDocumentSize
(
long
*
pWidth
,
long
*
pHeight
)
inline
void
getDocumentSize
(
long
*
pWidth
,
long
*
pHeight
)
{
{
mpDoc
->
pClass
->
getDocumentSize
(
mpDoc
,
pWidth
,
pHeight
);
mpDoc
->
pClass
->
getDocumentSize
(
mpDoc
,
pWidth
,
pHeight
);
}
}
/**
* Initialize document for rendering.
*
* Sets the rendering and document parameters to default values that are
* needed to render the document correctly using tiled rendering. This
* method has to be called right after documentLoad() in case any of the
* tiled rendering methods are to be used later.
*/
inline
void
initializeForRendering
()
inline
void
initializeForRendering
()
{
{
mpDoc
->
pClass
->
initializeForRendering
(
mpDoc
);
mpDoc
->
pClass
->
initializeForRendering
(
mpDoc
);
...
@@ -173,12 +222,14 @@ public:
...
@@ -173,12 +222,14 @@ public:
#endif // LOK_USE_UNSTABLE_API
#endif // LOK_USE_UNSTABLE_API
};
};
/// The lok::Office class represents one started LibreOfficeKit instance.
class
Office
class
Office
{
{
private
:
private
:
LibreOfficeKit
*
mpThis
;
LibreOfficeKit
*
mpThis
;
public
:
public
:
/// A lok::Office is typically created by the lok_cpp_init() function.
inline
Office
(
LibreOfficeKit
*
pThis
)
:
inline
Office
(
LibreOfficeKit
*
pThis
)
:
mpThis
(
pThis
)
mpThis
(
pThis
)
{}
{}
...
@@ -188,6 +239,12 @@ public:
...
@@ -188,6 +239,12 @@ public:
mpThis
->
pClass
->
destroy
(
mpThis
);
mpThis
->
pClass
->
destroy
(
mpThis
);
}
}
/**
* Loads a document from an URL.
*
* @param pUrl the URL of the document to load
* @param pFilterOptions options for the import filter, e.g. SkipImages.
*/
inline
Document
*
documentLoad
(
const
char
*
pUrl
,
const
char
*
pFilterOptions
=
NULL
)
inline
Document
*
documentLoad
(
const
char
*
pUrl
,
const
char
*
pFilterOptions
=
NULL
)
{
{
LibreOfficeKitDocument
*
pDoc
=
NULL
;
LibreOfficeKitDocument
*
pDoc
=
NULL
;
...
@@ -203,13 +260,14 @@ public:
...
@@ -203,13 +260,14 @@ public:
return
new
Document
(
pDoc
);
return
new
Document
(
pDoc
);
}
}
//
return the last error as a string, free me
.
//
/ Returns the last error as a string, the returned pointer has to be freed by the caller
.
inline
char
*
getError
()
inline
char
*
getError
()
{
{
return
mpThis
->
pClass
->
getError
(
mpThis
);
return
mpThis
->
pClass
->
getError
(
mpThis
);
}
}
};
};
/// Factory method to create a lok::Office instance.
inline
Office
*
lok_cpp_init
(
const
char
*
pInstallPath
)
inline
Office
*
lok_cpp_init
(
const
char
*
pInstallPath
)
{
{
LibreOfficeKit
*
pThis
=
lok_init
(
pInstallPath
);
LibreOfficeKit
*
pThis
=
lok_init
(
pInstallPath
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment