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_util_XStringAbbreviation_idl__
25#define __com_sun_star_util_XStringAbbreviation_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31module com { module sun { module star { module util {
32     published interface XStringWidth;
33}; }; }; };
34
35module com { module sun { module star { module util {
36
37//============================================================================
38/** Abbreviate arbitrary strings.
39
40    <p>It is expected that there will be different implementations of this
41    interface, that each expect strings conforming to a certain structure
42    (e.g., URIs, platform-specific file paths, or newsgroup names).  The
43    abbreviation algorithms will then take into account the structural
44    information.</p>
45
46    @see XStringWidth
47 */
48published interface XStringAbbreviation: com::sun::star::uno::XInterface
49{
50    //------------------------------------------------------------------------
51    /** Abbreviate a string, so that the resulting abbreviated string is not
52        wider than some given width.
53
54        <p>The width of a string is an abstract concept here, measured via
55        an <type>XStringWidth</type> interface.  Examples are the number of
56        characters in the string (<type>XStringWidth</type> will measure the
57        string's length), or the width in pixel when displayed with a specific
58        font (which <type>XStringWidth</type> would encapsulate).</p>
59
60        @param xStringWidth
61        The interface that makes concrete the abstract notion of string width.
62
63        @param nWidth
64        The resulting abbreviated string's width will be no larger than this.
65
66        @param aString
67        The string that is abbreviated.
68
69        @returns
70        an abbreviated string.
71     */
72    string abbreviateString([in] XStringWidth xStringWidth,
73                            [in] long nWidth,
74                            [in] string aString);
75};
76
77}; }; }; };
78
79#endif
80