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_framework_XPaneBorderPainter_idl__
25#define __com_sun_star_drawing_framework_XPaneBorderPainter_idl__
26
27#ifndef __com_sun_star_awt_Rectangle_idl__
28#include <com/sun/star/awt/Rectangle.idl>
29#endif
30#ifndef __com_sun_star_awt_Point_idl__
31#include <com/sun/star/awt/Point.idl>
32#endif
33#ifndef __com_sun_star_rendering_XCanvas_idl__
34#include <com/sun/star/rendering/XCanvas.idl>
35#endif
36
37module com { module sun { module star { module drawing { module framework {
38
39/** See XPaneBorderPainter and its addBorder() and removeBorder() methods
40    for an explanation of the border type and its values.
41*/
42published enum BorderType
43{
44    INNER_BORDER,
45    OUTER_BORDER,
46    TOTAL_BORDER
47};
48
49
50/** Paint the border around a rectangular region, typically a pane.
51
52    <p>Calling objects have to be able to derive inner bounding boxs of the
53    border from the outer ones and inner ones from outer ones.  This
54    conversion and the painting of the border involves three rectangles.
55    The inner and outer bounding box of the border.  This is a logical
56    bounding box which the paint methods may paint over.  The center box is
57    the third rectangle.  This is the actual border between outer and inner
58    background color or bitmap and it is used for placing the bitmaps that are used
59    paint the border.  The inner sides and corners are places relative to
60    this center box, i.e. when not further offsets are given then the upper
61    left corner bitmap is painted with its lower right at the upper left of
62    the center box.</p>
63*/
64published interface XPaneBorderPainter
65{
66    /** Enlarge the given rectangle by the size of the specified part of the
67        border.  This method can be used to convert an inner bounding box
68        into the center box or the outer bounding box.
69        @param sPaneBorderStyleName
70            The pane style defines the sizes of the border.
71        @param aRectangle
72            This rectangle will be converted into a larger one.  This should
73            be the center box or the inner bounding box of the border.
74        @param eBorderType
75            The part of the border to add to the given rectangle.
76            Use INNER_BORDER to convert an inner bounding box into the
77            center box or TOTAL_BORDER to convert it into the outer bounding
78            box.  OUTER_BORDER can be used to convert the center box into
79            the outer bounding box.
80    */
81    ::com::sun::star::awt::Rectangle addBorder (
82        [in] string sPaneBorderStyleName,
83        [in] ::com::sun::star::awt::Rectangle aRectangle,
84        [in] BorderType eBorderType);
85
86    /** Shring the given rectangle by the size of the specified part of the
87        border.  This method can be used to convert an outer bounding box
88        into the center box or the inner bounding box.
89        @param sPaneBorderStyleName
90            The pane style defines the sizes of the border.
91        @param aRectangle
92            This rectangle will be converted into a smaller one that lies
93            inside it.  It should be the center box or the outer bounding
94            box of the border.
95        @param eBorderType
96            The part of the border to remove from the given rectangle.
97            Use OUTER_BORDER to convert an outer bounding box into the
98            center box or TOTAL_BORDER to convert it into the inner bounding
99            box.  INNER_BORDER can be used to convert the center box into
100            the inner bounding box.
101    */
102    ::com::sun::star::awt::Rectangle removeBorder (
103        [in] string sPaneBorderStyleName,
104        [in] ::com::sun::star::awt::Rectangle aRectangle,
105        [in] BorderType eBorderType);
106
107    /** Paint the border around a pane.
108        @param sPaneBorderStyleName
109            The pane style to use for painting the border.
110        @param xCanvas
111            The canvas onto which the border is painted.
112        @param aOuterBorderRectangle
113            The outer bounding box of the border.  Use addBorder to convert
114            the bounding box of a pane (the inner bounding box of the
115            border) into this outer bounding box of the border.
116        @param aRepaintArea
117            The area in which the border has to be repainted.  The clip
118            rectangle.
119        @param sTitle
120            The pane title.  Supply an empty string for panes without
121            title.  It is the responsibility of the caller to supply a title
122            only for pane border styles that support a title.
123    */
124    void paintBorder (
125        [in] string sPaneBorderStyleName,
126        [in] ::com::sun::star::rendering::XCanvas xCanvas,
127        [in] ::com::sun::star::awt::Rectangle aOuterBorderRectangle,
128        [in] ::com::sun::star::awt::Rectangle aRepaintArea,
129        [in] string sTitle);
130
131    /** Paint the border around a pane where the border includes a callout
132        that is anchored at the given point.  Most arguments have the same
133        meaning as in the <method>paintBorder</method>.
134        @param aCalloutAnchor
135            The anchor point of the callout.  It is usually located outside
136            the border.
137    */
138    void paintBorderWithCallout (
139        [in] string sPaneBorderStyleName,
140        [in] ::com::sun::star::rendering::XCanvas xCanvas,
141        [in] ::com::sun::star::awt::Rectangle aOuterBorderRectangle,
142        [in] ::com::sun::star::awt::Rectangle aRepaintArea,
143        [in] string sTitle,
144        [in] ::com::sun::star::awt::Point aCalloutAnchor);
145
146    /** Return the offset of a callout anchor with respect to the outer
147        border.  This value is used when the callout is realized by a fixed
148        bitmap in order to determine the size and/or location of the outer
149        border for a given callout.
150    */
151    ::com::sun::star::awt::Point getCalloutOffset (
152        [in] string sPaneBorderStyleName);
153};
154
155}; }; }; }; }; // ::com::sun::star::drawing::framework
156
157#endif
158