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