LibreOffice Module desktop (master)  1
Namespaces | Enumerations | Functions | Variables
init.cxx File Reference
#include <config_features.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <memory>
#include <iostream>
#include <boost/property_tree/json_parser.hpp>
#include <boost/algorithm/string.hpp>
#include <LibreOfficeKit/LibreOfficeKit.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sal/log.hxx>
#include <vcl/errinf.hxx>
#include <vcl/lok.hxx>
#include <o3tl/any.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include <osl/thread.h>
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/uri.hxx>
#include <svl/zforlist.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <comphelper/base64.hxx>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <comphelper/profilezone.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/scopeguard.hxx>
#include <comphelper/threadpool.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/DispatchResultEvent.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatchResultListener.hpp>
#include <com/sun/star/frame/XSynchronousDispatch.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/reflection/theCoreReflection.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
#include <com/sun/star/reflection/XIdlReflection.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
#include <com/sun/star/datatransfer/XTransferable2.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/document/XRedlinesSupplier.hpp>
#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
#include <com/sun/star/xml/crypto/SEInitializer.hpp>
#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
#include <com/sun/star/xml/crypto/XCertificateCreator.hpp>
#include <com/sun/star/security/XCertificate.hpp>
#include <com/sun/star/linguistic2/LinguServiceManager.hpp>
#include <com/sun/star/linguistic2/XSpellChecker.hpp>
#include <com/sun/star/i18n/Calendar2.hpp>
#include <com/sun/star/i18n/LocaleCalendar2.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <editeng/flstitem.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/lokcharthelper.hxx>
#include <sfx2/DocumentSigner.hxx>
#include <sfx2/sidebar/SidebarDockingWindow.hxx>
#include <svx/dialmgr.hxx>
#include <svx/strings.hrc>
#include <svx/svdview.hxx>
#include <svx/svxids.hrc>
#include <svx/ucsubset.hxx>
#include <vcl/vclevent.hxx>
#include <vcl/GestureEvent.hxx>
#include <vcl/svapp.hxx>
#include <unotools/resmgr.hxx>
#include <tools/fract.hxx>
#include <tools/json_writer.hxx>
#include <svtools/ctrltool.hxx>
#include <svtools/langtab.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/fontcharmap.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/virdev.hxx>
#include <vcl/ImageTree.hxx>
#include <vcl/ITiledRenderable.hxx>
#include <vcl/dialoghelper.hxx>
#include <unicode/uchar.h>
#include <unotools/syslocaleoptions.hxx>
#include <unotools/mediadescriptor.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/streamwrap.hxx>
#include <osl/module.hxx>
#include <comphelper/sequence.hxx>
#include <sfx2/sfxbasemodel.hxx>
#include <svl/undo.hxx>
#include <unotools/datetime.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <vcl/builder.hxx>
#include <vcl/abstdlg.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/uitest/uiobject.hxx>
#include <vcl/jsdialog/builder.hxx>
#include <com/sun/star/document/XUndoManager.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <editeng/sizeitem.hxx>
#include <svx/rulritem.hxx>
#include <svx/pageitem.hxx>
#include <app.hxx>
#include "../app/cmdlineargs.hxx"
#include "../app/sofficemain.h"
#include "../app/officeipcthread.hxx"
#include <lib/init.hxx>
#include "lokinteractionhandler.hxx"
#include "lokclipboard.hxx"
#include <officecfg/Office/Impress.hxx>
Include dependency graph for init.cxx:

Go to the source code of this file.

Namespaces

 desktop
 

Enumerations

enum  UndoOrRedo
 

Functions

static void SetLastExceptionMsg (const OUString &s=OUString())
 
static OUString getUString (const char *pString)
 
static char * convertOString (const OString &rStr)
 
static char * convertOUString (const OUString &aStr)
 
static OUString getAbsoluteURL (const char *pURL)
 Try to convert a relative URL to an absolute one, unless it already looks like a URL. More...
 
static uno::Any jsonToUnoAny (const boost::property_tree::ptree &aTree)
 
static StringMap jsonToStringMap (const char *pJSON)
 
static boost::property_tree::ptree unoAnyToPropertyTree (const uno::Any &anyItem)
 
static void doc_destroy (LibreOfficeKitDocument *pThis)
 
static int doc_saveAs (LibreOfficeKitDocument *pThis, const char *pUrl, const char *pFormat, const char *pFilterOptions)
 
static int doc_getDocumentType (LibreOfficeKitDocument *pThis)
 
static int doc_getParts (LibreOfficeKitDocument *pThis)
 
static char * doc_getPartPageRectangles (LibreOfficeKitDocument *pThis)
 
static int doc_getPart (LibreOfficeKitDocument *pThis)
 
static void doc_setPart (LibreOfficeKitDocument *pThis, int nPart)
 
static void doc_selectPart (LibreOfficeKitDocument *pThis, int nPart, int nSelect)
 
static void doc_moveSelectedParts (LibreOfficeKitDocument *pThis, int nPosition, bool bDuplicate)
 
static char * doc_getPartName (LibreOfficeKitDocument *pThis, int nPart)
 
static void doc_setPartMode (LibreOfficeKitDocument *pThis, int nPartMode)
 
static void doc_paintTile (LibreOfficeKitDocument *pThis, unsigned char *pBuffer, const int nCanvasWidth, const int nCanvasHeight, const int nTilePosX, const int nTilePosY, const int nTileWidth, const int nTileHeight)
 
static void doc_paintPartTile (LibreOfficeKitDocument *pThis, unsigned char *pBuffer, const int nPart, const int nCanvasWidth, const int nCanvasHeight, const int nTilePosX, const int nTilePosY, const int nTileWidth, const int nTileHeight)
 
static int doc_getTileMode (LibreOfficeKitDocument *pThis)
 
static void doc_getDocumentSize (LibreOfficeKitDocument *pThis, long *pWidth, long *pHeight)
 
static void doc_initializeForRendering (LibreOfficeKitDocument *pThis, const char *pArguments)
 
static void doc_registerCallback (LibreOfficeKitDocument *pThis, LibreOfficeKitCallback pCallback, void *pData)
 
static void doc_postKeyEvent (LibreOfficeKitDocument *pThis, int nType, int nCharCode, int nKeyCode)
 
static void doc_postWindowExtTextInputEvent (LibreOfficeKitDocument *pThis, unsigned nWindowId, int nType, const char *pText)
 
static void doc_removeTextContext (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, int nCharBefore, int nCharAfter)
 
static void doc_sendDialogEvent (LibreOfficeKitDocument *pThis, unsigned long long int nLOKWindowId, const char *pArguments)
 
static void doc_postWindowKeyEvent (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode)
 
static void doc_postMouseEvent (LibreOfficeKitDocument *pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
 
static void doc_postWindowMouseEvent (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
 
static void doc_postWindowGestureEvent (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, const char *pType, int nX, int nY, int nOffset)
 
static void doc_postUnoCommand (LibreOfficeKitDocument *pThis, const char *pCommand, const char *pArguments, bool bNotifyWhenFinished)
 
static void doc_setWindowTextSelection (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, bool swap, int nX, int nY)
 
static void doc_setTextSelection (LibreOfficeKitDocument *pThis, int nType, int nX, int nY)
 
static char * doc_getTextSelection (LibreOfficeKitDocument *pThis, const char *pMimeType, char **pUsedMimeType)
 
static int doc_getSelectionType (LibreOfficeKitDocument *pThis)
 
static int doc_getClipboard (LibreOfficeKitDocument *pThis, const char **pMimeTypes, size_t *pOutCount, char ***pOutMimeTypes, size_t **pOutSizes, char ***pOutStreams)
 
static int doc_setClipboard (LibreOfficeKitDocument *pThis, const size_t nInCount, const char **pInMimeTypes, const size_t *pInSizes, const char **pInStreams)
 
static bool doc_paste (LibreOfficeKitDocument *pThis, const char *pMimeType, const char *pData, size_t nSize)
 
static void doc_setGraphicSelection (LibreOfficeKitDocument *pThis, int nType, int nX, int nY)
 
static void doc_resetSelection (LibreOfficeKitDocument *pThis)
 
static char * doc_getCommandValues (LibreOfficeKitDocument *pThis, const char *pCommand)
 
static void doc_setClientZoom (LibreOfficeKitDocument *pThis, int nTilePixelWidth, int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight)
 
static void doc_setClientVisibleArea (LibreOfficeKitDocument *pThis, int nX, int nY, int nWidth, int nHeight)
 
static void doc_setOutlineState (LibreOfficeKitDocument *pThis, bool bColumn, int nLevel, int nIndex, bool bHidden)
 
static int doc_createView (LibreOfficeKitDocument *pThis)
 
static int doc_createViewWithOptions (LibreOfficeKitDocument *pThis, const char *pOptions)
 
static void doc_destroyView (LibreOfficeKitDocument *pThis, int nId)
 
static void doc_setView (LibreOfficeKitDocument *pThis, int nId)
 
static int doc_getView (LibreOfficeKitDocument *pThis)
 
static int doc_getViewsCount (LibreOfficeKitDocument *pThis)
 
static bool doc_getViewIds (LibreOfficeKitDocument *pThis, int *pArray, size_t nSize)
 
static void doc_setViewLanguage (LibreOfficeKitDocument *pThis, int nId, const char *language)
 
static unsigned char * doc_renderFontOrientation (LibreOfficeKitDocument *pThis, const char *pFontName, const char *pChar, int *pFontWidth, int *pFontHeight, int pOrientation)
 
static unsigned char * doc_renderFont (LibreOfficeKitDocument *pThis, const char *pFontName, const char *pChar, int *pFontWidth, int *pFontHeight)
 
static char * doc_getPartHash (LibreOfficeKitDocument *pThis, int nPart)
 
static void doc_paintWindow (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, unsigned char *pBuffer, const int nX, const int nY, const int nWidth, const int nHeight)
 
static void doc_paintWindowDPI (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, unsigned char *pBuffer, const int nX, const int nY, const int nWidth, const int nHeight, const double fDPIScale)
 
static void doc_paintWindowForView (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, unsigned char *pBuffer, const int nX, const int nY, const int nWidth, const int nHeight, const double fDPIScale, int viewId)
 
static void doc_postWindow (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, int nAction, const char *pData)
 
static char * doc_getPartInfo (LibreOfficeKitDocument *pThis, int nPart)
 
static bool doc_insertCertificate (LibreOfficeKitDocument *pThis, const unsigned char *pCertificateBinary, const int nCertificateBinarySize, const unsigned char *pPrivateKeyBinary, const int nPrivateKeyBinarySize)
 
static bool doc_addCertificate (LibreOfficeKitDocument *pThis, const unsigned char *pCertificateBinary, const int nCertificateBinarySize)
 
static int doc_getSignatureState (LibreOfficeKitDocument *pThis)
 
static size_t doc_renderShapeSelection (LibreOfficeKitDocument *pThis, char **pOutput)
 
static void doc_resizeWindow (LibreOfficeKitDocument *pThis, unsigned nLOKWindowId, const int nWidth, const int nHeight)
 
static void doc_completeFunction (LibreOfficeKitDocument *pThis, const char *)
 
static void doc_sendFormFieldEvent (LibreOfficeKitDocument *pThis, const char *pArguments)
 
static OUString getGenerator ()
 
static void lo_destroy (LibreOfficeKit *pThis)
 
static int lo_initialize (LibreOfficeKit *pThis, const char *pInstallPath, const char *pUserProfilePath)
 
static LibreOfficeKitDocument * lo_documentLoad (LibreOfficeKit *pThis, const char *pURL)
 
static char * lo_getError (LibreOfficeKit *pThis)
 
static void lo_freeError (char *pFree)
 
static LibreOfficeKitDocument * lo_documentLoadWithOptions (LibreOfficeKit *pThis, const char *pURL, const char *pOptions)
 
static void lo_registerCallback (LibreOfficeKit *pThis, LibreOfficeKitCallback pCallback, void *pData)
 
static char * lo_getFilterTypes (LibreOfficeKit *pThis)
 
static void lo_setOptionalFeatures (LibreOfficeKit *pThis, unsigned long long features)
 
static void lo_setDocumentPassword (LibreOfficeKit *pThis, const char *pURL, const char *pPassword)
 
static char * lo_getVersionInfo (LibreOfficeKit *pThis)
 
static int lo_runMacro (LibreOfficeKit *pThis, const char *pURL)
 
static bool lo_signDocument (LibreOfficeKit *pThis, const char *pUrl, const unsigned char *pCertificateBinary, const int nCertificateBinarySize, const unsigned char *pPrivateKeyBinary, const int nPrivateKeyBinarySize)
 
static void lo_runLoop (LibreOfficeKit *pThis, LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void *pData)
 
static void doc_iniUnoCommands ()
 Initialize UNO commands, in the sense that from now on, the LOK client gets updates for status changes of these commands. More...
 
static int doc_getTileMode (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *)
 
static char * getPostIts (LibreOfficeKitDocument *pThis)
 Returns the JSON representation of all the comments in the document. More...
 
static char * getPostItsPos (LibreOfficeKitDocument *pThis)
 Returns the JSON representation of the positions of all the comments in the document. More...
 
static char * getRulerState (LibreOfficeKitDocument *pThis)
 
static bool getFromTransferrable (const css::uno::Reference< css::datatransfer::XTransferable > &xTransferable, const OString &aInMimeType, OString &aRet)
 
static bool encodeImageAsHTML (const css::uno::Reference< css::datatransfer::XTransferable > &xTransferable, const OString &aMimeType, OString &aRet)
 
static bool encodeTextAsHTML (const css::uno::Reference< css::datatransfer::XTransferable > &xTransferable, const OString &aMimeType, OString &aRet)
 
static char * getLanguages (const char *pCommand)
 
static char * getFonts (const char *pCommand)
 
static char * getFontSubset (const OString &aFontName)
 
static char * getStyles (LibreOfficeKitDocument *pThis, const char *pCommand)
 
static char * getUndoOrRedo (LibreOfficeKitDocument *pThis, UndoOrRedo eCommand)
 Returns the JSON representation of either an undo or a redo stack. More...
 
static char * getTrackedChanges (LibreOfficeKitDocument *pThis)
 Returns the JSON representation of the redline stack. More...
 
static char * getTrackedChangeAuthors (LibreOfficeKitDocument *pThis)
 Returns the JSON representation of the redline author table. More...
 
static void doc_destroyView (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *, int nId)
 
static void doc_setView (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *, int nId)
 
static int doc_getView (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *)
 
static int doc_getViewsCount (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *)
 
static bool doc_getViewIds (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *, int *pArray, size_t nSize)
 
static void doc_setViewLanguage (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *, int nId, const char *language)
 
unsigned char * doc_renderFontOrientation (SAL_UNUSED_PARAMETER LibreOfficeKitDocument *, const char *pFontName, const char *pChar, int *pFontWidth, int *pFontHeight, int pOrientation)
 
static char * lo_getVersionInfo (SAL_UNUSED_PARAMETER LibreOfficeKit *)
 
static void aBasicErrorFunc (const OUString &rError, const OUString &rAction)
 
static bool initialize_uno (const OUString &aAppProgramURL)
 
static void lo_startmain (void *)
 
static void lo_status_indicator_callback (void *data, comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent)
 
static void preloadData ()
 Used only by LibreOfficeKit when used by Online to pre-initialize. More...
 
SAL_JNI_EXPORT LibreOfficeKit * libreofficekit_hook_2 (const char *install_path, const char *user_profile_url)
 
SAL_JNI_EXPORT LibreOfficeKit * libreofficekit_hook (const char *install_path)
 
SAL_JNI_EXPORT int lok_preinit (const char *install_path, const char *user_profile_url)
 

Variables

static LibLibreOffice_ImplgImpl = nullptr
 
static std::weak_ptr< LibreOfficeKitClass > gOfficeClass
 
static std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass
 
const ExtensionMap aWriterExtensionMap []
 
const ExtensionMap aCalcExtensionMap []
 
const ExtensionMap aImpressExtensionMap []
 
const ExtensionMap aDrawExtensionMap []
 
static uno::Reference< css::uno::XComponentContext > xContext
 
static uno::Reference< css::lang::XMultiServiceFactory > xSFactory
 
static uno::Reference< css::lang::XMultiComponentFactory > xFactory
 
static bool bInitialized = false
 

Enumeration Type Documentation

enum UndoOrRedo
strong

Definition at line 4764 of file init.cxx.

Function Documentation

static void aBasicErrorFunc ( const OUString &  rError,
const OUString &  rAction 
)
static

Definition at line 5719 of file init.cxx.

References aBuffer, and OUStringToOString().

Referenced by lo_initialize().

static char* convertOString ( const OString &  rStr)
static

Definition at line 274 of file init.cxx.

References assert().

Referenced by convertOUString(), doc_getClipboard(), and doc_getTextSelection().

static char* convertOUString ( const OUString &  aStr)
static
static bool doc_addCertificate ( LibreOfficeKitDocument *  pThis,
const unsigned char *  pCertificateBinary,
const int  nCertificateBinarySize 
)
static
static void doc_completeFunction ( LibreOfficeKitDocument *  pThis,
const char *  pFunctionName 
)
static
static int doc_createView ( LibreOfficeKitDocument *  pThis)
static

Definition at line 5082 of file init.cxx.

References doc_createViewWithOptions().

Referenced by desktop::LibLODocument_Impl::LibLODocument_Impl().

static int doc_createViewWithOptions ( LibreOfficeKitDocument *  pThis,
const char *  pOptions 
)
static
static void doc_destroy ( LibreOfficeKitDocument *  pThis)
static
static void doc_destroyView ( LibreOfficeKitDocument *  pThis,
int  nId 
)
static
static void doc_destroyView ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  ,
int  nId 
)
static
static int doc_getClipboard ( LibreOfficeKitDocument *  pThis,
const char **  pMimeTypes,
size_t *  pOutCount,
char ***  pOutMimeTypes,
size_t **  pOutSizes,
char ***  pOutStreams 
)
static
static char * doc_getCommandValues ( LibreOfficeKitDocument *  pThis,
const char *  pCommand 
)
static
static void doc_getDocumentSize ( LibreOfficeKitDocument *  pThis,
long *  pWidth,
long *  pHeight 
)
static
static int doc_getDocumentType ( LibreOfficeKitDocument *  pThis)
static
static int doc_getPart ( LibreOfficeKitDocument *  pThis)
static
static char * doc_getPartHash ( LibreOfficeKitDocument *  pThis,
int  nPart 
)
static
static char * doc_getPartInfo ( LibreOfficeKitDocument *  pThis,
int  nPart 
)
static
static char * doc_getPartName ( LibreOfficeKitDocument *  pThis,
int  nPart 
)
static
static char * doc_getPartPageRectangles ( LibreOfficeKitDocument *  pThis)
static
static int doc_getParts ( LibreOfficeKitDocument *  pThis)
static
static int doc_getSelectionType ( LibreOfficeKitDocument *  pThis)
static
static int doc_getSignatureState ( LibreOfficeKitDocument *  pThis)
static
static char * doc_getTextSelection ( LibreOfficeKitDocument *  pThis,
const char *  pMimeType,
char **  pUsedMimeType 
)
static
static int doc_getTileMode ( LibreOfficeKitDocument *  pThis)
static
static int doc_getTileMode ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  )
static

Definition at line 3207 of file init.cxx.

References SetLastExceptionMsg().

static int doc_getView ( LibreOfficeKitDocument *  pThis)
static
static int doc_getView ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  )
static

Definition at line 5109 of file init.cxx.

References SfxLokHelper::getView(), and SetLastExceptionMsg().

static bool doc_getViewIds ( LibreOfficeKitDocument *  pThis,
int pArray,
size_t  nSize 
)
static
static bool doc_getViewIds ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  ,
int pArray,
size_t  nSize 
)
static

Definition at line 5129 of file init.cxx.

References SfxLokHelper::getViewIds(), and SetLastExceptionMsg().

static int doc_getViewsCount ( LibreOfficeKitDocument *  pThis)
static
static int doc_getViewsCount ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  )
static

Definition at line 5119 of file init.cxx.

References SfxLokHelper::getViewsCount(), and SetLastExceptionMsg().

static void doc_initializeForRendering ( LibreOfficeKitDocument *  pThis,
const char *  pArguments 
)
static
static void doc_iniUnoCommands ( )
static

Initialize UNO commands, in the sense that from now on, the LOK client gets updates for status changes of these commands.

This is necessary, because (unlike in the desktop case) there are no toolbars hosting widgets these UNO commands, so no such status updates would be sent to the headless LOK clients out of the box.

Definition at line 2586 of file init.cxx.

References dp_registry::backend::bundle::create(), SfxViewShell::Current(), SfxViewFrame::GetBindings(), SfxBindings::GetDispatch(), comphelper::getProcessComponentContext(), SfxSlotPool::GetSlotPool(), SfxSlotPool::GetUnoSlot(), SfxViewShell::GetViewFrame(), SAL_WARN, and SetLastExceptionMsg().

Referenced by doc_initializeForRendering().

static bool doc_insertCertificate ( LibreOfficeKitDocument *  pThis,
const unsigned char *  pCertificateBinary,
const int  nCertificateBinarySize,
const unsigned char *  pPrivateKeyBinary,
const int  nPrivateKeyBinarySize 
)
static
static void doc_moveSelectedParts ( LibreOfficeKitDocument *  pThis,
int  nPosition,
bool  bDuplicate 
)
static
static void doc_paintPartTile ( LibreOfficeKitDocument *  pThis,
unsigned char *  pBuffer,
const int  nPart,
const int  nCanvasWidth,
const int  nCanvasHeight,
const int  nTilePosX,
const int  nTilePosY,
const int  nTileWidth,
const int  nTileHeight 
)
static
static void doc_paintTile ( LibreOfficeKitDocument *  pThis,
unsigned char *  pBuffer,
const int  nCanvasWidth,
const int  nCanvasHeight,
const int  nTilePosX,
const int  nTilePosY,
const int  nTileWidth,
const int  nTileHeight 
)
static
static void doc_paintWindow ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
unsigned char *  pBuffer,
const int  nX,
const int  nY,
const int  nWidth,
const int  nHeight 
)
static

Definition at line 5270 of file init.cxx.

References doc_paintWindowDPI().

Referenced by desktop::LibLODocument_Impl::LibLODocument_Impl().

static void doc_paintWindowDPI ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
unsigned char *  pBuffer,
const int  nX,
const int  nY,
const int  nWidth,
const int  nHeight,
const double  fDPIScale 
)
static
static void doc_paintWindowForView ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
unsigned char *  pBuffer,
const int  nX,
const int  nY,
const int  nWidth,
const int  nHeight,
const double  fDPIScale,
int  viewId 
)
static
static bool doc_paste ( LibreOfficeKitDocument *  pThis,
const char *  pMimeType,
const char *  pData,
size_t  nSize 
)
static
static void doc_postKeyEvent ( LibreOfficeKitDocument *  pThis,
int  nType,
int  nCharCode,
int  nKeyCode 
)
static
static void doc_postMouseEvent ( LibreOfficeKitDocument *  pThis,
int  nType,
int  nX,
int  nY,
int  nCount,
int  nButtons,
int  nModifier 
)
static
static void doc_postUnoCommand ( LibreOfficeKitDocument *  pThis,
const char *  pCommand,
const char *  pArguments,
bool  bNotifyWhenFinished 
)
static
static void doc_postWindow ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
int  nAction,
const char *  pData 
)
static
static void doc_postWindowExtTextInputEvent ( LibreOfficeKitDocument *  pThis,
unsigned  nWindowId,
int  nType,
const char *  pText 
)
static
static void doc_postWindowGestureEvent ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
const char *  pType,
int  nX,
int  nY,
int  nOffset 
)
static
static void doc_postWindowKeyEvent ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
int  nType,
int  nCharCode,
int  nKeyCode 
)
static
static void doc_postWindowMouseEvent ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
int  nType,
int  nX,
int  nY,
int  nCount,
int  nButtons,
int  nModifier 
)
static
static void doc_registerCallback ( LibreOfficeKitDocument *  pThis,
LibreOfficeKitCallback  pCallback,
void pData 
)
static
static void doc_removeTextContext ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
int  nCharBefore,
int  nCharAfter 
)
static
unsigned char * doc_renderFont ( LibreOfficeKitDocument *  pThis,
const char *  pFontName,
const char *  pChar,
int pFontWidth,
int pFontHeight 
)
static

Definition at line 5153 of file init.cxx.

References doc_renderFontOrientation().

Referenced by desktop::LibLODocument_Impl::LibLODocument_Impl().

static unsigned char* doc_renderFontOrientation ( LibreOfficeKitDocument *  pThis,
const char *  pFontName,
const char *  pChar,
int pFontWidth,
int pFontHeight,
int  pOrientation 
)
static
unsigned char* doc_renderFontOrientation ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  ,
const char *  pFontName,
const char *  pChar,
int pFontWidth,
int pFontHeight,
int  pOrientation 
)
static size_t doc_renderShapeSelection ( LibreOfficeKitDocument *  pThis,
char **  pOutput 
)
static
static void doc_resetSelection ( LibreOfficeKitDocument *  pThis)
static
static void doc_resizeWindow ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
const int  nWidth,
const int  nHeight 
)
static
static int doc_saveAs ( LibreOfficeKitDocument *  pThis,
const char *  pUrl,
const char *  pFormat,
const char *  pFilterOptions 
)
static
static void doc_selectPart ( LibreOfficeKitDocument *  pThis,
int  nPart,
int  nSelect 
)
static
static void doc_sendDialogEvent ( LibreOfficeKitDocument *  pThis,
unsigned long long int  nLOKWindowId,
const char *  pArguments 
)
static
static void doc_sendFormFieldEvent ( LibreOfficeKitDocument *  pThis,
const char *  pArguments 
)
static
static void doc_setClientVisibleArea ( LibreOfficeKitDocument *  pThis,
int  nX,
int  nY,
int  nWidth,
int  nHeight 
)
static
static void doc_setClientZoom ( LibreOfficeKitDocument *  pThis,
int  nTilePixelWidth,
int  nTilePixelHeight,
int  nTileTwipWidth,
int  nTileTwipHeight 
)
static
static int doc_setClipboard ( LibreOfficeKitDocument *  pThis,
const size_t  nInCount,
const char **  pInMimeTypes,
const size_t *  pInSizes,
const char **  pInStreams 
)
static
static void doc_setGraphicSelection ( LibreOfficeKitDocument *  pThis,
int  nType,
int  nX,
int  nY 
)
static
static void doc_setOutlineState ( LibreOfficeKitDocument *  pThis,
bool  bColumn,
int  nLevel,
int  nIndex,
bool  bHidden 
)
static
static void doc_setPart ( LibreOfficeKitDocument *  pThis,
int  nPart 
)
static
static void doc_setPartMode ( LibreOfficeKitDocument *  pThis,
int  nPartMode 
)
static
static void doc_setTextSelection ( LibreOfficeKitDocument *  pThis,
int  nType,
int  nX,
int  nY 
)
static
static void doc_setView ( LibreOfficeKitDocument *  pThis,
int  nId 
)
static
static void doc_setView ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  ,
int  nId 
)
static

Definition at line 5099 of file init.cxx.

References SetLastExceptionMsg(), and SfxLokHelper::setView().

static void doc_setViewLanguage ( LibreOfficeKitDocument *  pThis,
int  nId,
const char *  language 
)
static
static void doc_setViewLanguage ( SAL_UNUSED_PARAMETER LibreOfficeKitDocument *  ,
int  nId,
const char *  language 
)
static
static void doc_setWindowTextSelection ( LibreOfficeKitDocument *  pThis,
unsigned  nLOKWindowId,
bool  swap,
int  nX,
int  nY 
)
static
static bool encodeImageAsHTML ( const css::uno::Reference< css::datatransfer::XTransferable > &  xTransferable,
const OString &  aMimeType,
OString &  aRet 
)
static

Definition at line 4119 of file init.cxx.

References aSeq, comphelper::Base64::encode(), getFromTransferrable(), and getGenerator().

Referenced by getFromTransferrable().

static bool encodeTextAsHTML ( const css::uno::Reference< css::datatransfer::XTransferable > &  xTransferable,
const OString &  aMimeType,
OString &  aRet 
)
static

Definition at line 4145 of file init.cxx.

References getFromTransferrable(), and getGenerator().

Referenced by getFromTransferrable().

static OUString getAbsoluteURL ( const char *  pURL)
static

Try to convert a relative URL to an absolute one, unless it already looks like a URL.

Definition at line 288 of file init.cxx.

References aURL, and getUString().

Referenced by doc_saveAs(), lo_documentLoadWithOptions(), and lo_signDocument().

static char* getFonts ( const char *  pCommand)
static
static char* getFontSubset ( const OString &  aFontName)
static
static bool getFromTransferrable ( const css::uno::Reference< css::datatransfer::XTransferable > &  xTransferable,
const OString &  aInMimeType,
OString &  aRet 
)
static
static OUString getGenerator ( )
static

Definition at line 1285 of file init.cxx.

References Translate::ExpandVariables().

Referenced by encodeImageAsHTML(), and encodeTextAsHTML().

static char* getLanguages ( const char *  pCommand)
static
static char* getPostIts ( LibreOfficeKitDocument *  pThis)
static

Returns the JSON representation of all the comments in the document.

Definition at line 3309 of file init.cxx.

References tools::JsonWriter::extractData(), vcl::ITiledRenderable::getPostIts(), and SetLastExceptionMsg().

Referenced by doc_getCommandValues().

static char* getPostItsPos ( LibreOfficeKitDocument *  pThis)
static

Returns the JSON representation of the positions of all the comments in the document.

Definition at line 3324 of file init.cxx.

References tools::JsonWriter::extractData(), vcl::ITiledRenderable::getPostItsPos(), and SetLastExceptionMsg().

Referenced by doc_getCommandValues().

static char* getRulerState ( LibreOfficeKitDocument *  pThis)
static
static char* getStyles ( LibreOfficeKitDocument *  pThis,
const char *  pCommand 
)
static
static char* getTrackedChangeAuthors ( LibreOfficeKitDocument *  pThis)
static

Returns the JSON representation of the redline author table.

Definition at line 4856 of file init.cxx.

References tools::JsonWriter::extractData(), vcl::ITiledRenderable::getTrackedChangeAuthors(), and SetLastExceptionMsg().

Referenced by doc_getCommandValues().

static char* getTrackedChanges ( LibreOfficeKitDocument *  pThis)
static
static char* getUndoOrRedo ( LibreOfficeKitDocument *  pThis,
UndoOrRedo  eCommand 
)
static

Returns the JSON representation of either an undo or a redo stack.

Definition at line 4773 of file init.cxx.

References SfxObjectShell::GetObjectShell(), SfxUndoManager::GetRedoActionsInfo(), SfxUndoManager::GetUndoActionsInfo(), SfxShell::GetUndoManager(), and desktop::LibLODocument_Impl::mxComponent.

Referenced by doc_getCommandValues().

static OUString getUString ( const char *  pString)
static
static bool initialize_uno ( const OUString &  aAppProgramURL)
static
static StringMap jsonToStringMap ( const char *  pJSON)
static

Definition at line 441 of file init.cxx.

Referenced by doc_sendDialogEvent(), and doc_sendFormFieldEvent().

static uno::Any jsonToUnoAny ( const boost::property_tree::ptree &  aTree)
static
SAL_JNI_EXPORT LibreOfficeKit* libreofficekit_hook ( const char *  install_path)

Definition at line 6282 of file init.cxx.

References libreofficekit_hook_2().

SAL_JNI_EXPORT LibreOfficeKit* libreofficekit_hook_2 ( const char *  install_path,
const char *  user_profile_url 
)

Definition at line 6266 of file init.cxx.

References gImpl, lo_destroy(), lo_initialize(), and SAL_INFO.

Referenced by libreofficekit_hook().

static void lo_destroy ( LibreOfficeKit *  pThis)
static
static LibreOfficeKitDocument * lo_documentLoad ( LibreOfficeKit *  pThis,
const char *  pURL 
)
static
static LibreOfficeKitDocument * lo_documentLoadWithOptions ( LibreOfficeKit *  pThis,
const char *  pURL,
const char *  pOptions 
)
static
static void lo_freeError ( char *  pFree)
static

Definition at line 5629 of file init.cxx.

Referenced by desktop::LibLibreOffice_Impl::LibLibreOffice_Impl().

static char * lo_getError ( LibreOfficeKit *  pThis)
static
static char * lo_getFilterTypes ( LibreOfficeKit *  pThis)
static
static char* lo_getVersionInfo ( LibreOfficeKit *  pThis)
static
static char* lo_getVersionInfo ( SAL_UNUSED_PARAMETER LibreOfficeKit *  )
static
static int lo_initialize ( LibreOfficeKit *  pThis,
const char *  pInstallPath,
const char *  pUserProfilePath 
)
static
static void lo_registerCallback ( LibreOfficeKit *  pThis,
LibreOfficeKitCallback  pCallback,
void pData 
)
static
static void lo_runLoop ( LibreOfficeKit *  pThis,
LibreOfficeKitPollCallback  pPollCallback,
LibreOfficeKitWakeCallback  pWakeCallback,
void pData 
)
static
static int lo_runMacro ( LibreOfficeKit *  pThis,
const char *  pURL 
)
static
static void lo_setDocumentPassword ( LibreOfficeKit *  pThis,
const char *  pURL,
const char *  pPassword 
)
static
static void lo_setOptionalFeatures ( LibreOfficeKit *  pThis,
unsigned long long  features 
)
static
static bool lo_signDocument ( LibreOfficeKit *  pThis,
const char *  pUrl,
const unsigned char *  pCertificateBinary,
const int  nCertificateBinarySize,
const unsigned char *  pPrivateKeyBinary,
const int  nPrivateKeyBinarySize 
)
static
static void lo_startmain ( void )
static
static void lo_status_indicator_callback ( void data,
comphelper::LibreOfficeKit::statusIndicatorCallbackType  type,
int  percent 
)
static
SAL_JNI_EXPORT int lok_preinit ( const char *  install_path,
const char *  user_profile_url 
)

Definition at line 6288 of file init.cxx.

References lo_initialize().

static void preloadData ( )
static
static void SetLastExceptionMsg ( const OUString &  s = OUString())
static

Definition at line 181 of file init.cxx.

References desktop::LibLibreOffice_Impl::maLastExceptionMsg, and SAL_WARN_IF.

Referenced by doc_completeFunction(), doc_createViewWithOptions(), doc_destroyView(), doc_getClipboard(), doc_getCommandValues(), doc_getDocumentSize(), doc_getDocumentType(), doc_getPart(), doc_getPartHash(), doc_getPartInfo(), doc_getPartName(), doc_getPartPageRectangles(), doc_getParts(), doc_getSelectionType(), doc_getTextSelection(), doc_getTileMode(), doc_getView(), doc_getViewIds(), doc_getViewsCount(), doc_initializeForRendering(), doc_iniUnoCommands(), doc_paintPartTile(), doc_paintTile(), doc_paintWindowForView(), doc_paste(), doc_postKeyEvent(), doc_postMouseEvent(), doc_postUnoCommand(), doc_postWindow(), doc_postWindowExtTextInputEvent(), doc_postWindowGestureEvent(), doc_postWindowKeyEvent(), doc_postWindowMouseEvent(), doc_registerCallback(), doc_renderFontOrientation(), doc_renderShapeSelection(), doc_resetSelection(), doc_saveAs(), doc_sendDialogEvent(), doc_sendFormFieldEvent(), doc_setClientVisibleArea(), doc_setClientZoom(), doc_setClipboard(), doc_setGraphicSelection(), doc_setOutlineState(), doc_setPart(), doc_setPartMode(), doc_setTextSelection(), doc_setView(), doc_setViewLanguage(), doc_setWindowTextSelection(), getFromTransferrable(), getPostIts(), getPostItsPos(), getRulerState(), getTrackedChangeAuthors(), getTrackedChanges(), initialize_uno(), lo_getFilterTypes(), lo_getVersionInfo(), lo_setDocumentPassword(), and lo_setOptionalFeatures().

static boost::property_tree::ptree unoAnyToPropertyTree ( const uno::Any anyItem)
static

Definition at line 459 of file init.cxx.

References aSeq, and i.

Referenced by doc_postUnoCommand().

Variable Documentation

const ExtensionMap aCalcExtensionMap[]
Initial value:
=
{
{ "csv", "Text - txt - csv (StarCalc)" },
{ "fods", "OpenDocument Spreadsheet Flat XML" },
{ "html", "HTML (StarCalc)" },
{ "ods", "calc8" },
{ "ots", "calc8_template" },
{ "pdf", "calc_pdf_Export" },
{ "xhtml", "XHTML Calc File" },
{ "xls", "MS Excel 97" },
{ "xlsm", "Calc MS Excel 2007 VBA XML" },
{ "xlsx", "Calc MS Excel 2007 XML" },
{ "png", "calc_png_Export" },
{ nullptr, nullptr }
}

Definition at line 216 of file init.cxx.

Referenced by doc_saveAs().

const ExtensionMap aDrawExtensionMap[]
Initial value:
=
{
{ "fodg", "draw_ODG_FlatXML" },
{ "html", "draw_html_Export" },
{ "odg", "draw8" },
{ "pdf", "draw_pdf_Export" },
{ "svg", "draw_svg_Export" },
{ "xhtml", "XHTML Draw File" },
{ "png", "draw_png_Export"},
{ nullptr, nullptr }
}

Definition at line 252 of file init.cxx.

Referenced by doc_saveAs().

const ExtensionMap aImpressExtensionMap[]
Initial value:
=
{
{ "fodp", "OpenDocument Presentation Flat XML" },
{ "html", "impress_html_Export" },
{ "odg", "impress8_draw" },
{ "odp", "impress8" },
{ "otp", "impress8_template" },
{ "pdf", "impress_pdf_Export" },
{ "potm", "Impress MS PowerPoint 2007 XML Template" },
{ "pot", "MS PowerPoint 97 Vorlage" },
{ "pptm", "Impress MS PowerPoint 2007 XML VBA" },
{ "pptx", "Impress MS PowerPoint 2007 XML" },
{ "pps", "MS PowerPoint 97 Autoplay" },
{ "ppt", "MS PowerPoint 97" },
{ "svg", "impress_svg_Export" },
{ "xhtml", "XHTML Impress File" },
{ "png", "impress_png_Export"},
{ nullptr, nullptr }
}

Definition at line 232 of file init.cxx.

Referenced by doc_saveAs().

const ExtensionMap aWriterExtensionMap[]
Initial value:
=
{
{ "doc", "MS Word 97" },
{ "docm", "MS Word 2007 XML VBA" },
{ "docx", "MS Word 2007 XML" },
{ "fodt", "OpenDocument Text Flat XML" },
{ "html", "HTML (StarWriter)" },
{ "odt", "writer8" },
{ "ott", "writer8_template" },
{ "pdf", "writer_pdf_Export" },
{ "epub", "EPUB" },
{ "rtf", "Rich Text Format" },
{ "txt", "Text" },
{ "xhtml", "XHTML Writer File" },
{ "png", "writer_png_Export" },
{ nullptr, nullptr }
}

Definition at line 198 of file init.cxx.

Referenced by doc_saveAs().

bool bInitialized = false
static

Definition at line 5809 of file init.cxx.

Referenced by lo_initialize().

std::weak_ptr< LibreOfficeKitDocumentClass > gDocumentClass
static

Definition at line 179 of file init.cxx.

Referenced by desktop::LibLODocument_Impl::LibLODocument_Impl().

LibLibreOffice_Impl* gImpl = nullptr
static

Definition at line 177 of file init.cxx.

Referenced by libreofficekit_hook_2().

std::weak_ptr< LibreOfficeKitClass > gOfficeClass
static

Definition at line 178 of file init.cxx.

Referenced by desktop::LibLibreOffice_Impl::LibLibreOffice_Impl().

uno::Reference<css::uno::XComponentContext> xContext
static
uno::Reference<css::lang::XMultiComponentFactory> xFactory
static

Definition at line 2107 of file init.cxx.

uno::Reference<css::lang::XMultiServiceFactory> xSFactory
static

Definition at line 2106 of file init.cxx.