2014-06-12 17:38:10 +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/.
|
|
|
|
*/
|
|
|
|
|
2015-02-02 11:03:13 +01:00
|
|
|
#ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITGTK_H
|
|
|
|
#define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITGTK_H
|
2014-06-12 17:38:10 +01:00
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
|
|
|
|
#include <LibreOfficeKit/LibreOfficeKit.h>
|
|
|
|
|
2015-06-06 02:07:31 +05:30
|
|
|
G_BEGIN_DECLS
|
2014-06-12 17:38:10 +01:00
|
|
|
|
2015-06-06 03:10:31 +05:30
|
|
|
#define LOK_TYPE_DOC_VIEW (lok_doc_view_get_type())
|
|
|
|
#define LOK_DOC_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LOK_TYPE_DOC_VIEW, LOKDocView))
|
|
|
|
#define LOK_IS_DOC_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LOK_TYPE_DOC_VIEW))
|
|
|
|
#define LOK_DOC_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LOK_TYPE_DOC_VIEW, LOKDocViewClass))
|
|
|
|
#define LOK_IS_DOC_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), LOK_TYPE_DOC_VIEW))
|
|
|
|
#define LOK_DOC_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), LOK_TYPE_DOC_VIEW, LOKDocViewClass))
|
|
|
|
|
2015-06-11 22:00:11 +05:30
|
|
|
typedef struct _LOKDocView LOKDocView;
|
|
|
|
typedef struct _LOKDocViewClass LOKDocViewClass;
|
|
|
|
typedef struct _LOKDocViewPrivate LOKDocViewPrivate;
|
2014-06-12 17:38:10 +01:00
|
|
|
|
|
|
|
struct _LOKDocView
|
|
|
|
{
|
2015-06-09 16:27:37 +05:30
|
|
|
GtkDrawingArea aDrawingArea;
|
2014-06-12 17:38:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _LOKDocViewClass
|
|
|
|
{
|
2015-06-09 16:27:37 +05:30
|
|
|
GtkDrawingAreaClass parent_class;
|
2014-06-12 17:38:10 +01:00
|
|
|
};
|
|
|
|
|
2015-06-07 22:28:01 +05:30
|
|
|
GType lok_doc_view_get_type (void) G_GNUC_CONST;
|
2015-06-09 16:27:37 +05:30
|
|
|
|
2015-06-18 21:52:22 +05:30
|
|
|
GtkWidget* lok_doc_view_new (const gchar* pPath,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GError **error);
|
2015-06-09 16:27:37 +05:30
|
|
|
|
2015-07-06 22:01:30 +05:30
|
|
|
void lok_doc_view_open_document (LOKDocView* pDocView,
|
|
|
|
const gchar* pPath,
|
|
|
|
GCancellable* cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer userdata);
|
|
|
|
|
|
|
|
gboolean lok_doc_view_open_document_finish (LOKDocView* pDocView,
|
|
|
|
GAsyncResult* res,
|
|
|
|
GError** error);
|
2015-03-20 10:16:07 +01:00
|
|
|
|
|
|
|
/// Gets the document the viewer displays.
|
2015-06-06 03:10:31 +05:30
|
|
|
LibreOfficeKitDocument* lok_doc_view_get_document (LOKDocView* pDocView);
|
|
|
|
|
|
|
|
void lok_doc_view_set_zoom (LOKDocView* pDocView,
|
|
|
|
float fZoom);
|
|
|
|
float lok_doc_view_get_zoom (LOKDocView* pDocView);
|
|
|
|
|
|
|
|
int lok_doc_view_get_parts (LOKDocView* pDocView);
|
|
|
|
int lok_doc_view_get_part (LOKDocView* pDocView);
|
|
|
|
void lok_doc_view_set_part (LOKDocView* pDocView,
|
|
|
|
int nPart);
|
|
|
|
char* lok_doc_view_get_part_name (LOKDocView* pDocView,
|
|
|
|
int nPart);
|
|
|
|
void lok_doc_view_set_partmode (LOKDocView* pDocView,
|
|
|
|
int nPartMode);
|
2015-07-21 18:49:21 +03:00
|
|
|
|
|
|
|
void lok_doc_view_reset_view (LOKDocView* pDocView);
|
|
|
|
|
2015-01-13 16:47:23 +01:00
|
|
|
/// Sets if the viewer is actually an editor or not.
|
2015-06-06 03:10:31 +05:30
|
|
|
void lok_doc_view_set_edit (LOKDocView* pDocView,
|
|
|
|
gboolean bEdit);
|
2015-03-10 11:18:25 +01:00
|
|
|
/// Gets if the viewer is actually an editor or not.
|
2015-06-06 03:10:31 +05:30
|
|
|
gboolean lok_doc_view_get_edit (LOKDocView* pDocView);
|
2015-03-12 14:59:59 +01:00
|
|
|
|
|
|
|
/// Posts the .uno: command to the LibreOfficeKit.
|
2015-06-06 03:10:31 +05:30
|
|
|
void lok_doc_view_post_command (LOKDocView* pDocView,
|
2015-07-12 23:22:51 +05:30
|
|
|
const gchar* pCommand,
|
|
|
|
const gchar* pArguments);
|
2015-03-25 17:54:11 +01:00
|
|
|
|
2015-06-09 16:27:37 +05:30
|
|
|
float lok_doc_view_pixel_to_twip (LOKDocView* pDocView,
|
|
|
|
float fInput);
|
|
|
|
|
|
|
|
float lok_doc_view_twip_to_pixel (LOKDocView* pDocView,
|
|
|
|
float fInput);
|
2015-06-06 02:07:31 +05:30
|
|
|
|
|
|
|
G_END_DECLS
|
2014-06-12 17:38:10 +01:00
|
|
|
|
2015-02-02 11:03:13 +01:00
|
|
|
#endif // INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITGTK_H
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|