summaryrefslogtreecommitdiff
path: root/touch/idl
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-06-05 16:35:49 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-06-05 17:17:41 +0300
commit92f23297c93dc105e2ffd9ff09c0dafff1ee0fd3 (patch)
treec3ba983227366359d40d6a41ead18d625303005e /touch/idl
parent71dbf5bfd0b9622ad485a5b7620e11d8405ed474 (diff)
Work in progress: Add "touch" module for Android and iOS stuff
Change-Id: I10652743194d44d8465ddf8079f6b4458e6710f9
Diffstat (limited to 'touch/idl')
-rw-r--r--touch/idl/org/libreoffice/touch/Document.idl25
-rw-r--r--touch/idl/org/libreoffice/touch/DocumentRenderCallback.idl25
-rw-r--r--touch/idl/org/libreoffice/touch/XDocument.idl73
-rw-r--r--touch/idl/org/libreoffice/touch/XDocumentRenderCallback.idl55
4 files changed, 178 insertions, 0 deletions
diff --git a/touch/idl/org/libreoffice/touch/Document.idl b/touch/idl/org/libreoffice/touch/Document.idl
new file mode 100644
index 000000000000..c05437ce3473
--- /dev/null
+++ b/touch/idl/org/libreoffice/touch/Document.idl
@@ -0,0 +1,25 @@
+// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+// Copyright 2012 LibreOffice contributors.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License 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/.
+
+#ifndef org_libreoffice_touch_Document_idl
+#define org_libreoffice_touch_Document_idl
+
+#include <org/libreoffice/touch/XDocument.idl>
+
+module org { module libreoffice { module touch {
+
+service Document:
+ XDocument {
+ create( [in] string uri );
+ };
+
+}; }; };
+
+#endif
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/touch/idl/org/libreoffice/touch/DocumentRenderCallback.idl b/touch/idl/org/libreoffice/touch/DocumentRenderCallback.idl
new file mode 100644
index 000000000000..95e7e7730ed8
--- /dev/null
+++ b/touch/idl/org/libreoffice/touch/DocumentRenderCallback.idl
@@ -0,0 +1,25 @@
+// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+// Copyright 2012 LibreOffice contributors.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License 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/.
+
+#ifndef org_libreoffice_touch_DocumentRenderCallback_idl
+#define org_libreoffice_touch_DocumentRenderCallback_idl
+
+#include <org/libreoffice/touch/XDocumentRenderCallback.idl>
+
+module org { module libreoffice { module touch {
+
+service DocumentRenderCallback: XDocumentRenderCallback
+{
+ create();
+};
+
+}; }; };
+
+#endif
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/touch/idl/org/libreoffice/touch/XDocument.idl b/touch/idl/org/libreoffice/touch/XDocument.idl
new file mode 100644
index 000000000000..bc3d563d8708
--- /dev/null
+++ b/touch/idl/org/libreoffice/touch/XDocument.idl
@@ -0,0 +1,73 @@
+// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+// Copyright 2012 LibreOffice contributors.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License 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/.
+
+#ifndef org_libreoffice_touch_XDocument_idl
+#define org_libreoffice_touch_XDocument_idl
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/lang/IllegalArgumentException.idl>
+
+module org { module libreoffice { module touch {
+
+// Note that this is work in progress
+
+// Error handling? Presumably for true errors expected to be uncommon, or
+// invalid usage, the methods should throw exceptions.
+
+// Multithreaded use of this is undefined (the intent obviously is that this
+// API is called in another thread than the "main" UI thread, but calling this
+// stuff on the same object simultaneously in multiple threads is undefined).
+
+// Represents one (Writer, for now) document
+
+interface XDocumentRenderCallback;
+
+interface XDocument: com::sun::star::uno::XInterface
+{
+ [attribute, readonly] long numberOfPages;
+
+ // Renders a (part of a) page into a square bitmap, for Android in the
+ // android.graphics.Bitmap.Config.ARGB_8888 format. Despite the name, the
+ // order of bytes is R,G,B,A. Is this reliable, or coincidental depending
+ // on Android version and/or hardware? TBD. Will the same format be useful
+ // also for iOS? TBD.
+
+ // buffer must have an exact number of bytes for a square number of
+ // pixels, At the UNO level buffer is represented as the address of its
+ // bytes, i.e. on Android it must be a "direct" ByteBuffer for that to be
+ // meaningful.
+
+ // listener gets a "reasonable" number of callbacks during the rendering
+ // if it takes "significantly" long, and can inerrupt the rendering.
+
+ // zoomLevel is 0 for whole page, 1 for tiled into four, etc.
+
+ // x and y are in [0..2^zoomLevel]
+
+ // Should we have this method copy the rendered buffer into a Bitmap
+ // instead and return that? A Bitmap is presumably what the caller wants
+ // anyway?
+
+ // Or should we just go OpenGL ES and render into a texture?
+
+ void render( [in] hyper buffer,
+ [in] long bufferSize,
+ [in] XDocumentRenderCallback listener,
+ [in] long pageNo,
+ [in] long zoomLevel,
+ [in] long x,
+ [in] long y)
+ raises( com::sun::star::lang::IllegalArgumentException );
+
+};
+
+}; }; };
+
+#endif
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/touch/idl/org/libreoffice/touch/XDocumentRenderCallback.idl b/touch/idl/org/libreoffice/touch/XDocumentRenderCallback.idl
new file mode 100644
index 000000000000..62da11c2eedb
--- /dev/null
+++ b/touch/idl/org/libreoffice/touch/XDocumentRenderCallback.idl
@@ -0,0 +1,55 @@
+// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+// Copyright 2012 LibreOffice contributors.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License 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/.
+
+#ifndef org_libreoffice_touch_XDocumentRenderCallback_idl
+#define org_libreoffice_touch_XDocumentRenderCallback_idl
+
+#include <com/sun/star/uno/XInterface.idl>
+
+module org { module libreoffice { module touch {
+
+interface XDocument;
+
+interface XDocumentRenderCallback: com::sun::star::uno::XInterface
+{
+
+ // Return false from any of the callbacks if the render result isn't
+ // wanted after all and the rendering should stop
+
+ // pageWidth and pageHeight are in [1..squareSide] where squareSide is
+ // the side of the render target square implied by the size of the
+ // buffer passed to render().
+
+ // This always called at the start of rendering one page
+
+ boolean start( [in] long pageWidth,
+ [in] long pageHeight );
+
+ // Called with unspecified frequency during the rendering, possibly
+ // even not at all, but the intent is to call this with "reasonable"
+ // frquency if the rendering takes a "long" time. Maybe around ten
+ // times a second?
+
+ // There is no guarantee in which order the bitmap is being rendered
+
+ // fraction is in [0..1] and is an approximation of unknown exactness
+ // If the rendering code doesn't even bother guessing, it can pass
+ // zero all the time. The fraction in subsequent calls never
+ // decreases.
+
+ boolean progress( [in] float fraction );
+
+ // There is no callback when the rendering finishes; render() just
+ // returns.
+};
+
+}; }; };
+
+#endif
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab: