1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_drawing_XPresenterHelper_idl__
25#define __com_sun_star_drawing_XPresenterHelper_idl__
26
27#ifndef __com_sun_star_awt_XWindow_idl__
28#include <com/sun/star/awt/XWindow.idl>
29#endif
30#ifndef __com_sun_star_rendering_XCanvas_idl__
31#include <com/sun/star/rendering/XCanvas.idl>
32#endif
33#ifndef __com_sun_star_rendering_XSpriteCanvas_idl__
34#include <com/sun/star/rendering/XSpriteCanvas.idl>
35#endif
36#ifndef __com_sun_star_awt_Rectangle_idl__
37#include <com/sun/star/awt/Rectangle.idl>
38#endif
39
40module com { module sun { module star { module drawing {
41
42constants CanvasFeature
43{
44    const short None = 0;
45    const short SpriteCanvas = 1;
46};
47
48/** This interface is a collection of functions that are necessary to
49    implement larger parts of the presenter screen as extension.  The
50    methods of this interface give access to services that can, at the
51    moment, only implemented in the Office core, not in an extension.
52
53    <p>With time some, maybe all, methods can moved to other, better suited,
54    interfaces.</p>
55*/
56interface XPresenterHelper
57{
58    /** Create a new window as child window of the given parent window.
59        @param xParentWindow
60            The parent window of the new window.
61        @param bCreateSystemChildWindow
62            When <TRUE/> then the new window will be a system window that,
63            in the context of the presenter screen, can not be painted over
64            by other windows that lie behind it.
65        @param bInitiallyVisible
66            When <TRUE/> the new window will be visible from the start,
67            i.e. a window listener will not receive a windowShown signal.
68        @param bEnableChildTransparentMode
69            When <TRUE/> the parent window is painted behind its child
70            windows. This is one half of allowing child windows to be
71            transparent.
72        @param bEnableParentClip
73            When <TRUE/> then the parent window is not clipped where its
74            child windows are painted.  This is the other half of allowing
75            child windows to be transparent.
76    */
77    ::com::sun::star::awt::XWindow createWindow (
78        [in] ::com::sun::star::awt::XWindow xParentWindow,
79        [in] boolean bCreateSystemChildWindow,
80        [in] boolean bInitiallyVisible,
81        [in] boolean bEnableChildTransparentMode,
82        [in] boolean bEnableParentClip);
83
84    /** Create a new canvas for the given window.  The new canvas is a
85        wrapper around the given shared canvas.  The wrapper only modifies
86        the origin in all output and clipping methods.
87        @param xUpdateCanvas
88            This canvas is used to call updateScreen() on.  May be <NULL/>
89        @param xUpdateWindow
90            The window that belongs to the update canvas.  May also be
91            <NULL/> (is expected to b <NULL/> whenever xUpdateCanvas is.)
92        @param xSharedCanvas
93            The canvas that is shared by the wrapper.
94        @param xSharedWindow
95            The window of the shared canvas.  This is used to determine the
96            proper offset.
97        @param xWindow
98            The canvas is created for this window.  Must not be <NULL/>
99    */
100    ::com::sun::star::rendering::XCanvas createSharedCanvas (
101        [in] ::com::sun::star::rendering::XSpriteCanvas xUpdateCanvas,
102        [in] ::com::sun::star::awt::XWindow xUpdateWindow,
103        [in] ::com::sun::star::rendering::XCanvas xSharedCanvas,
104        [in] ::com::sun::star::awt::XWindow xSharedWindow,
105        [in] ::com::sun::star::awt::XWindow xWindow);
106
107    /** Create a new canvas for the given window.
108        @param xWindow
109            The canvas is created for this window.  Must not be <NULL/>
110        @param nRequestedCanvasFeatureList
111            List of requested features that the new canvas should (has to)
112            provide.  Use only values from the <type>CanvasFeature</type>
113            constants group.
114        @param sOptionalCanvasServiceName
115            When an explicit service name is given then a new object of this
116            service is created.  This service name lets the caller select a
117            specific canvas implementation, e.g. with or without hardware
118            acceleration.
119    */
120    ::com::sun::star::rendering::XCanvas createCanvas (
121        [in] ::com::sun::star::awt::XWindow xWindow,
122        [in] short nRequestedCanvasFeatureList,
123        [in] string sOptionalCanvasServiceName);
124
125    /** Move the specified window to the top of its stacking order.  As a
126        result the window will be painted over all its overlapping
127        siblings.
128        @param xWindow
129            This window will be moved to the top of its stacking order.
130    */
131    void toTop (
132        [in] ::com::sun::star::awt::XWindow xWindow);
133
134    /** Load a bitmap from a file or other accessible resource that can be
135        located via a URL.
136        @param sURL
137            The URL of the bitmap.  For a file URL the bitmap is loaded from
138            the specified file.
139        @param xCanvas
140            The bitmap is created to be compatible, and possibly optimized,
141            for this canvas.
142    */
143    ::com::sun::star::rendering::XBitmap loadBitmap (
144        [in] string sURL,
145        [in] ::com::sun::star::rendering::XCanvas xCanvas);
146
147    /** Capture the mouse so that no other window will receive mouse events.
148        Note that this is a potentially dangerous method.  Not calling
149        releaseMouse eventually can lead to an unresponsive application.
150        @param xWindow
151            The window for which mouse events will be notified even when the
152            mouse pointer moves outside the window or over other windows.
153    */
154    void captureMouse (
155        [in] ::com::sun::star::awt::XWindow xWindow);
156
157    /** Release a previously captured mouse.
158        @param xWindow
159            The window from which the mouse will be released.
160    */
161    void releaseMouse (
162        [in] ::com::sun::star::awt::XWindow xWindow);
163
164    /** Return the bounding box of the given child window relative to the
165        direct or indirect parent window.
166    */
167    com::sun::star::awt::Rectangle getWindowExtentsRelative (
168        [in] ::com::sun::star::awt::XWindow xChildWindow,
169        [in] ::com::sun::star::awt::XWindow xParentWindow);
170};
171
172
173}; }; }; }; // ::com::sun::star::drawing
174
175#endif
176