xref: /trunk/main/offapi/com/sun/star/sheet/XNamedRanges.idl (revision 7871dc3ea494bf86c742e1f4dfc9c6e20f5bcb2a)
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_sheet_XNamedRanges_idl__
25#define __com_sun_star_sheet_XNamedRanges_idl__
26
27#ifndef __com_sun_star_container_XNameAccess_idl__
28#include <com/sun/star/container/XNameAccess.idl>
29#endif
30
31#ifndef __com_sun_star_table_CellAddress_idl__
32#include <com/sun/star/table/CellAddress.idl>
33#endif
34
35#ifndef __com_sun_star_table_CellRangeAddress_idl__
36#include <com/sun/star/table/CellRangeAddress.idl>
37#endif
38
39#ifndef __com_sun_star_sheet_Border_idl__
40#include <com/sun/star/sheet/Border.idl>
41#endif
42
43//=============================================================================
44
45module com {  module sun {  module star {  module sheet {
46
47//=============================================================================
48
49/** provides access to the members in a collection of named ranges and to
50    insert and remove them.
51
52    @see com::sun::star::sheet::NamedRanges
53    @see com::sun::star::sheet::NamedRange
54 */
55published interface XNamedRanges: com::sun::star::container::XNameAccess
56{
57    //-------------------------------------------------------------------------
58
59    /** adds a new named range to the collection.
60
61        @param aName
62            the new name of the named range.
63
64        @param aContent
65            the formula expression.
66
67            <p>A cell range address is one possible content of a named
68            range.</p>
69
70        @param aPosition
71            specifies the base address for relative cell references.
72
73        @param nType
74            a combination of flags that specify the type of a named range,
75            as defined in <type>NamedRangeFlag</type>.
76
77            <p>This parameter will be zero for any common named range.</p>
78     */
79    void addNewByName(
80            [in] string aName,
81            [in] string aContent,
82            [in] com::sun::star::table::CellAddress aPosition,
83            [in] long nType );
84
85    //-------------------------------------------------------------------------
86
87    /** creates named cell ranges from titles in a cell range.
88
89        <p>The names for the named ranges are taken from title cells in the
90        top or bottom row, or from the cells of the left or right column
91        of the range (depending on the parameter <const>aBorder</const>.
92        The named ranges refer to single columns or rows in the inner
93        part of the original range, excluding the labels.</p>
94
95        <p>Example: The source range is A1:B3. The named ranges shall be
96        created using row titles. This requires <member>Border::TOP</member>
97        for the second parameter. The method creates two named ranges. The
98        name of the first is equal to the content of cell A1 and contains the
99        range $Sheet.$A$2:$A$3 (excluding the title cell). The latter named
100        range is named using cell B1 and contains the cell range address
101        $Sheet.$B$2:$B$3.</p>
102
103        @param aSource
104            the cell range used to create the named ranges.
105
106        @param aBorder
107            specifies the location of the title cells.
108     */
109    void addNewFromTitles(
110            [in] com::sun::star::table::CellRangeAddress aSource,
111            [in] com::sun::star::sheet::Border aBorder );
112
113    //-------------------------------------------------------------------------
114
115    /** removes a named range from the collection.
116     */
117    void removeByName( [in] string aName );
118
119    //-------------------------------------------------------------------------
120
121    /** writes a list of all named ranges into the document.
122
123        <p>The first column of the list contains the names. The second
124        column contains the contents of the named ranges.</p>
125
126        @param aOutputPosition
127            specifies the top left cell of the output range.
128     */
129    void outputList( [in] com::sun::star::table::CellAddress aOutputPosition );
130
131};
132
133//=============================================================================
134
135}; }; }; };
136
137#endif
138
139