Branch libreoffice-5-0-4
[LibreOffice.git] / include / LibreOfficeKit / LibreOfficeKitGtk.h
blobb3e50d31b01d7769fca01980bde9e7e98964e109
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITGTK_H
11 #define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITGTK_H
13 #include <gtk/gtk.h>
14 #include <gdk/gdk.h>
16 #define LOK_USE_UNSTABLE_API
17 #include <LibreOfficeKit/LibreOfficeKit.h>
19 #ifdef __cplusplus
20 extern "C"
22 #endif
24 #define LOK_DOCVIEW(obj) GTK_CHECK_CAST (obj, lok_docview_get_type(), LOKDocView)
25 #define LOK_DOCVIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, lok_docview_get_type(), LOKDocViewClass)
26 #define IS_LOK_DOCVIEW(obj) GTK_CHECK_TYPE (obj, lok_docview_get_type())
28 typedef struct _LOKDocView LOKDocView;
29 typedef struct _LOKDocViewClass LOKDocViewClass;
31 struct _LOKDocView
33 GtkScrolledWindow aScrollWindow;
34 struct LOKDocView_Impl* m_pImpl;
37 struct _LOKDocViewClass
39 GtkScrolledWindowClass parent_class;
40 void (* edit_changed) (LOKDocView* pView, gboolean was_edit);
41 void (* command_changed) (LOKDocView* pView, char* new_state);
42 void (* search_not_found) (LOKDocView* pView, char* new_state);
43 void (* part_changed) (LOKDocView* pView, int new_part);
46 guint lok_docview_get_type (void);
47 GtkWidget* lok_docview_new ( LibreOfficeKit* pOffice );
48 gboolean lok_docview_open_document (LOKDocView* pDocView,
49 char* pPath);
51 /// Gets the document the viewer displays.
52 LibreOfficeKitDocument* lok_docview_get_document(LOKDocView* pDocView);
54 void lok_docview_set_zoom (LOKDocView* pDocView,
55 float fZoom);
56 float lok_docview_get_zoom (LOKDocView* pDocView);
58 int lok_docview_get_parts (LOKDocView* pDocView);
59 int lok_docview_get_part (LOKDocView* pDocView);
60 void lok_docview_set_part (LOKDocView* pDocView,
61 int nPart);
62 char* lok_docview_get_part_name (LOKDocView* pDocView,
63 int nPart);
64 void lok_docview_set_partmode (LOKDocView* pDocView,
65 int nPartMode);
66 /// Sets if the viewer is actually an editor or not.
67 void lok_docview_set_edit (LOKDocView* pDocView,
68 gboolean bEdit);
69 /// Gets if the viewer is actually an editor or not.
70 gboolean lok_docview_get_edit (LOKDocView* pDocView);
72 /// Posts the .uno: command to the LibreOfficeKit.
73 void lok_docview_post_command (LOKDocView* pDocView, const char* pCommand, const char* pArguments);
75 /// Posts a keyboard event to LibreOfficeKit.
76 void lok_docview_post_key (GtkWidget* pWidget, GdkEventKey* pEvent, gpointer pData);
78 /// Get the visible area of the document (in twips).
79 void lok_docview_get_visarea(LOKDocView* pThis, GdkRectangle* pArea);
80 #ifdef __cplusplus
82 #endif
84 #endif // INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITGTK_H
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */