Code

tpdfv-ctl: Added controller module used to manage multiple GtkTPDFV widgets.
[tpdfview.git] / src / tpdfv-ctl.h
diff --git a/src/tpdfv-ctl.h b/src/tpdfv-ctl.h
new file mode 100644 (file)
index 0000000..afc71e0
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * tpdfview - src/tpdfvctl.h
+ * Copyright (C) 2011 Sebastian 'tokkee' Harl <sh@tokkee.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This module provides a controller use to manage multiple GtkTPDFV widgets.
+ */
+
+#ifndef TPDFVCTL_H
+#define TPDFVCTL_H 1
+
+#include <glib-object.h>
+
+#include "gtk-tpdfv.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TPDFV_TYPE_CTL (tpdfv_ctl_get_type())
+#define TPDFV_CTL(obj) \
+       (G_TYPE_CHECK_INSTANCE_CAST((obj), TPDFV_TYPE_CTL, TPDFVCtl))
+#define TPDFV_CTL_CLASS(obj) \
+       (G_TYPE_CHECK_CLASS_CAST((obj), TPDFV_TYPE_CTL, TPDFVCtlClass))
+#define TPDFV_IS_CTL(obj) \
+       (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPDFV_TYPE_CTL))
+#define TPDFV_IS_CTL_CLASS(obj) \
+       (G_TYPE_CHECK_CLASS_TYPE((obj), TPDFV_TYPE_CTL))
+#define TPDFV_CTL_GET_CLASS(obj) \
+       (G_TYPE_INSTANCE_GET_CLASS((obj), TPDFV_TYPE_CTL, TPDFVCtlClass))
+
+GType
+tpdfv_ctl_get_type(void);
+
+typedef struct {
+       GObject parent_instance;
+} TPDFVCtl;
+
+typedef struct {
+       GObjectClass parent_class;
+} TPDFVCtlClass;
+
+/*
+ * tpdfv_ctl_new:
+ * Creates a new TPDFVCtl object using the specified main GtkTPDFV widget.
+ */
+GObject *
+tpdfv_ctl_new(GtkTPDFV *main);
+
+/*
+ * tpdfv_ctl_add_slave:
+ * Add a new slave to the controller.
+ *
+ * 'factor' and 'offset' determine how the current page of the slave relate to
+ * the master.
+ *
+ * Returns FALSE if adding the slave failed.
+ */
+gboolean
+tpdfv_ctl_add_slave(GObject *obj, GtkTPDFV *slave,
+               gint factor, gint offset);
+
+/*
+ * tpdfv_ctl_reload:
+ * Reload all PDF files.
+ */
+void
+tpdfv_ctl_reload(GObject *obj);
+
+/*
+ * tpdfv_ctl_page_up, tpdfv_ctl_page_down,
+ * tpdfv_ctl_first_page, tpdfv_ctl_last_page,
+ * tpdfv_ctl_goto_page:
+ * Navigation.
+ */
+void
+tpdfv_ctl_page_up(GObject *obj);
+void
+tpdfv_ctl_page_down(GObject *obj);
+void
+tpdfv_ctl_first_page(GObject *obj);
+void
+tpdfv_ctl_last_page(GObject *obj);
+void
+tpdfv_ctl_goto_page(GObject *obj, gint page);
+
+/*
+ * tpdfv_ctl_zoom_in, tpdfv_ctl_zoom_out,
+ * tpdfv_ctl_zoom_1:
+ * Zooming.
+ */
+void
+tpdfv_ctl_zoom_in(GObject *obj);
+void
+tpdfv_ctl_zoom_out(GObject *obj);
+void
+tpdfv_ctl_zoom_1(GObject *obj);
+void
+tpdfv_ctl_zoom_width(GObject *obj);
+void
+tpdfv_ctl_zoom_height(GObject *obj);
+void
+tpdfv_ctl_zoom_fit(GObject *obj);
+
+/*
+ * tpdfv_ctl_scroll_up, tpdfv_ctl_scroll_down,
+ * tpdfv_ctl_scroll_left, tpdfv_ctl_scroll_right:
+ * Scrolling.
+ */
+void
+tpdfv_ctl_scroll_up(GObject *obj);
+void
+tpdfv_ctl_scroll_down(GObject *obj);
+void
+tpdfv_ctl_scroll_left(GObject *obj);
+void
+tpdfv_ctl_scroll_right(GObject *obj);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* ! TPDFVCTL_H */
+
+/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
+