xref: /AOO41X/main/offapi/com/sun/star/drawing/framework/XPaneBorderPainter.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_drawing_framework_XPaneBorderPainter_idl__
25cdf0e10cSrcweir#define __com_sun_star_drawing_framework_XPaneBorderPainter_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_awt_Rectangle_idl__
28cdf0e10cSrcweir#include <com/sun/star/awt/Rectangle.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir#ifndef __com_sun_star_awt_Point_idl__
31cdf0e10cSrcweir#include <com/sun/star/awt/Point.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir#ifndef __com_sun_star_rendering_XCanvas_idl__
34cdf0e10cSrcweir#include <com/sun/star/rendering/XCanvas.idl>
35cdf0e10cSrcweir#endif
36cdf0e10cSrcweir
37cdf0e10cSrcweirmodule com { module sun { module star { module drawing { module framework {
38cdf0e10cSrcweir
39cdf0e10cSrcweir/** See XPaneBorderPainter and its addBorder() and removeBorder() methods
40cdf0e10cSrcweir    for an explanation of the border type and its values.
41cdf0e10cSrcweir*/
42cdf0e10cSrcweirpublished enum BorderType
43cdf0e10cSrcweir{
44cdf0e10cSrcweir    INNER_BORDER,
45cdf0e10cSrcweir    OUTER_BORDER,
46cdf0e10cSrcweir    TOTAL_BORDER
47cdf0e10cSrcweir};
48cdf0e10cSrcweir
49cdf0e10cSrcweir
50cdf0e10cSrcweir/** Paint the border around a rectangular region, typically a pane.
51cdf0e10cSrcweir
52cdf0e10cSrcweir    <p>Calling objects have to be able to derive inner bounding boxs of the
53cdf0e10cSrcweir    border from the outer ones and inner ones from outer ones.  This
54cdf0e10cSrcweir    conversion and the painting of the border involves three rectangles.
55cdf0e10cSrcweir    The inner and outer bounding box of the border.  This is a logical
56cdf0e10cSrcweir    bounding box which the paint methods may paint over.  The center box is
57cdf0e10cSrcweir    the third rectangle.  This is the actual border between outer and inner
58cdf0e10cSrcweir    background color or bitmap and it is used for placing the bitmaps that are used
59cdf0e10cSrcweir    paint the border.  The inner sides and corners are places relative to
60cdf0e10cSrcweir    this center box, i.e. when not further offsets are given then the upper
61cdf0e10cSrcweir    left corner bitmap is painted with its lower right at the upper left of
62cdf0e10cSrcweir    the center box.</p>
63cdf0e10cSrcweir*/
64cdf0e10cSrcweirpublished interface XPaneBorderPainter
65cdf0e10cSrcweir{
66cdf0e10cSrcweir    /** Enlarge the given rectangle by the size of the specified part of the
67cdf0e10cSrcweir        border.  This method can be used to convert an inner bounding box
68cdf0e10cSrcweir        into the center box or the outer bounding box.
69cdf0e10cSrcweir        @param sPaneBorderStyleName
70cdf0e10cSrcweir            The pane style defines the sizes of the border.
71cdf0e10cSrcweir        @param aRectangle
72cdf0e10cSrcweir            This rectangle will be converted into a larger one.  This should
73cdf0e10cSrcweir            be the center box or the inner bounding box of the border.
74cdf0e10cSrcweir        @param eBorderType
75cdf0e10cSrcweir            The part of the border to add to the given rectangle.
76cdf0e10cSrcweir            Use INNER_BORDER to convert an inner bounding box into the
77cdf0e10cSrcweir            center box or TOTAL_BORDER to convert it into the outer bounding
78cdf0e10cSrcweir            box.  OUTER_BORDER can be used to convert the center box into
79cdf0e10cSrcweir            the outer bounding box.
80cdf0e10cSrcweir    */
81cdf0e10cSrcweir    ::com::sun::star::awt::Rectangle addBorder (
82cdf0e10cSrcweir        [in] string sPaneBorderStyleName,
83cdf0e10cSrcweir        [in] ::com::sun::star::awt::Rectangle aRectangle,
84cdf0e10cSrcweir        [in] BorderType eBorderType);
85cdf0e10cSrcweir
86cdf0e10cSrcweir    /** Shring the given rectangle by the size of the specified part of the
87cdf0e10cSrcweir        border.  This method can be used to convert an outer bounding box
88cdf0e10cSrcweir        into the center box or the inner bounding box.
89cdf0e10cSrcweir        @param sPaneBorderStyleName
90cdf0e10cSrcweir            The pane style defines the sizes of the border.
91cdf0e10cSrcweir        @param aRectangle
92cdf0e10cSrcweir            This rectangle will be converted into a smaller one that lies
93cdf0e10cSrcweir            inside it.  It should be the center box or the outer bounding
94cdf0e10cSrcweir            box of the border.
95cdf0e10cSrcweir        @param eBorderType
96cdf0e10cSrcweir            The part of the border to remove from the given rectangle.
97cdf0e10cSrcweir            Use OUTER_BORDER to convert an outer bounding box into the
98cdf0e10cSrcweir            center box or TOTAL_BORDER to convert it into the inner bounding
99cdf0e10cSrcweir            box.  INNER_BORDER can be used to convert the center box into
100cdf0e10cSrcweir            the inner bounding box.
101cdf0e10cSrcweir    */
102cdf0e10cSrcweir    ::com::sun::star::awt::Rectangle removeBorder (
103cdf0e10cSrcweir        [in] string sPaneBorderStyleName,
104cdf0e10cSrcweir        [in] ::com::sun::star::awt::Rectangle aRectangle,
105cdf0e10cSrcweir        [in] BorderType eBorderType);
106cdf0e10cSrcweir
107cdf0e10cSrcweir    /** Paint the border around a pane.
108cdf0e10cSrcweir        @param sPaneBorderStyleName
109cdf0e10cSrcweir            The pane style to use for painting the border.
110cdf0e10cSrcweir        @param xCanvas
111cdf0e10cSrcweir            The canvas onto which the border is painted.
112cdf0e10cSrcweir        @param aOuterBorderRectangle
113cdf0e10cSrcweir            The outer bounding box of the border.  Use addBorder to convert
114cdf0e10cSrcweir            the bounding box of a pane (the inner bounding box of the
115cdf0e10cSrcweir            border) into this outer bounding box of the border.
116cdf0e10cSrcweir        @param aRepaintArea
117cdf0e10cSrcweir            The area in which the border has to be repainted.  The clip
118cdf0e10cSrcweir            rectangle.
119cdf0e10cSrcweir        @param sTitle
120cdf0e10cSrcweir            The pane title.  Supply an empty string for panes without
121cdf0e10cSrcweir            title.  It is the responsibility of the caller to supply a title
122cdf0e10cSrcweir            only for pane border styles that support a title.
123cdf0e10cSrcweir    */
124cdf0e10cSrcweir    void paintBorder (
125cdf0e10cSrcweir        [in] string sPaneBorderStyleName,
126cdf0e10cSrcweir        [in] ::com::sun::star::rendering::XCanvas xCanvas,
127cdf0e10cSrcweir        [in] ::com::sun::star::awt::Rectangle aOuterBorderRectangle,
128cdf0e10cSrcweir        [in] ::com::sun::star::awt::Rectangle aRepaintArea,
129cdf0e10cSrcweir        [in] string sTitle);
130cdf0e10cSrcweir
131cdf0e10cSrcweir    /** Paint the border around a pane where the border includes a callout
132cdf0e10cSrcweir        that is anchored at the given point.  Most arguments have the same
133cdf0e10cSrcweir        meaning as in the <method>paintBorder</method>.
134cdf0e10cSrcweir        @param aCalloutAnchor
135cdf0e10cSrcweir            The anchor point of the callout.  It is usually located outside
136cdf0e10cSrcweir            the border.
137cdf0e10cSrcweir    */
138cdf0e10cSrcweir    void paintBorderWithCallout (
139cdf0e10cSrcweir        [in] string sPaneBorderStyleName,
140cdf0e10cSrcweir        [in] ::com::sun::star::rendering::XCanvas xCanvas,
141cdf0e10cSrcweir        [in] ::com::sun::star::awt::Rectangle aOuterBorderRectangle,
142cdf0e10cSrcweir        [in] ::com::sun::star::awt::Rectangle aRepaintArea,
143cdf0e10cSrcweir        [in] string sTitle,
144cdf0e10cSrcweir        [in] ::com::sun::star::awt::Point aCalloutAnchor);
145cdf0e10cSrcweir
146cdf0e10cSrcweir    /** Return the offset of a callout anchor with respect to the outer
147cdf0e10cSrcweir        border.  This value is used when the callout is realized by a fixed
148cdf0e10cSrcweir        bitmap in order to determine the size and/or location of the outer
149cdf0e10cSrcweir        border for a given callout.
150cdf0e10cSrcweir    */
151cdf0e10cSrcweir    ::com::sun::star::awt::Point getCalloutOffset (
152cdf0e10cSrcweir        [in] string sPaneBorderStyleName);
153cdf0e10cSrcweir};
154cdf0e10cSrcweir
155cdf0e10cSrcweir}; }; }; }; }; // ::com::sun::star::drawing::framework
156cdf0e10cSrcweir
157cdf0e10cSrcweir#endif
158