1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_sheet_XNamedRanges_idl__
25cdf0e10cSrcweir#define __com_sun_star_sheet_XNamedRanges_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_container_XNameAccess_idl__
28cdf0e10cSrcweir#include <com/sun/star/container/XNameAccess.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir#ifndef __com_sun_star_table_CellAddress_idl__
32cdf0e10cSrcweir#include <com/sun/star/table/CellAddress.idl>
33cdf0e10cSrcweir#endif
34cdf0e10cSrcweir
35cdf0e10cSrcweir#ifndef __com_sun_star_table_CellRangeAddress_idl__
36cdf0e10cSrcweir#include <com/sun/star/table/CellRangeAddress.idl>
37cdf0e10cSrcweir#endif
38cdf0e10cSrcweir
39cdf0e10cSrcweir#ifndef __com_sun_star_sheet_Border_idl__
40cdf0e10cSrcweir#include <com/sun/star/sheet/Border.idl>
41cdf0e10cSrcweir#endif
42cdf0e10cSrcweir
43cdf0e10cSrcweir//=============================================================================
44cdf0e10cSrcweir
45cdf0e10cSrcweirmodule com {  module sun {  module star {  module sheet {
46cdf0e10cSrcweir
47*dffa72deSWang Lei
48cdf0e10cSrcweir//=============================================================================
49cdf0e10cSrcweir
50cdf0e10cSrcweir/** provides access to the members in a collection of named ranges and to
51cdf0e10cSrcweir	insert and remove them.
52cdf0e10cSrcweir
53cdf0e10cSrcweir	@see com::sun::star::sheet::NamedRanges
54cdf0e10cSrcweir	@see com::sun::star::sheet::NamedRange
55cdf0e10cSrcweir */
56cdf0e10cSrcweirpublished interface XNamedRanges: com::sun::star::container::XNameAccess
57cdf0e10cSrcweir{
58cdf0e10cSrcweir	//-------------------------------------------------------------------------
59cdf0e10cSrcweir
60cdf0e10cSrcweir	/** adds a new named range to the collection.
61cdf0e10cSrcweir
62cdf0e10cSrcweir		@param aName
63cdf0e10cSrcweir			the new name of the named range.
64cdf0e10cSrcweir
65cdf0e10cSrcweir		@param aContent
66cdf0e10cSrcweir			the formula expression.
67cdf0e10cSrcweir
68cdf0e10cSrcweir			<p>A cell range address is one possible content of a named
69cdf0e10cSrcweir			range.</p>
70cdf0e10cSrcweir
71cdf0e10cSrcweir		@param aPosition
72cdf0e10cSrcweir			specifies the base address for relative cell references.
73cdf0e10cSrcweir
74cdf0e10cSrcweir		@param nType
75cdf0e10cSrcweir			a combination of flags that specify the type of a named range,
76cdf0e10cSrcweir			as defined in <type>NamedRangeFlag</type>.
77cdf0e10cSrcweir
78cdf0e10cSrcweir			<p>This parameter will be zero for any common named range.</p>
79cdf0e10cSrcweir	 */
80cdf0e10cSrcweir	void addNewByName(
81cdf0e10cSrcweir			[in] string aName,
82cdf0e10cSrcweir			[in] string aContent,
83cdf0e10cSrcweir			[in] com::sun::star::table::CellAddress aPosition,
84cdf0e10cSrcweir			[in] long nType );
85cdf0e10cSrcweir
86cdf0e10cSrcweir	//-------------------------------------------------------------------------
87cdf0e10cSrcweir
88cdf0e10cSrcweir	/** creates named cell ranges from titles in a cell range.
89cdf0e10cSrcweir
90cdf0e10cSrcweir		<p>The names for the named ranges are taken from title cells in the
91cdf0e10cSrcweir		top or bottom row, or from the cells of the left or right column
92cdf0e10cSrcweir		of the range (depending on the parameter <const>aBorder</const>.
93cdf0e10cSrcweir		The named ranges refer to single columns or rows in the inner
94cdf0e10cSrcweir		part of the original range, excluding the labels.</p>
95cdf0e10cSrcweir
96cdf0e10cSrcweir		<p>Example: The source range is A1:B3. The named ranges shall be
97cdf0e10cSrcweir		created using row titles. This requires <member>Border::TOP</member>
98cdf0e10cSrcweir		for the second parameter. The method creates two named ranges. The
99cdf0e10cSrcweir		name of the first is equal to the content of cell A1 and contains the
100cdf0e10cSrcweir		range $Sheet.$A$2:$A$3 (excluding the title cell). The latter named
101cdf0e10cSrcweir		range is named using cell B1 and contains the cell range address
102cdf0e10cSrcweir		$Sheet.$B$2:$B$3.</p>
103cdf0e10cSrcweir
104cdf0e10cSrcweir		@param aSource
105cdf0e10cSrcweir			the cell range used to create the named ranges.
106cdf0e10cSrcweir
107cdf0e10cSrcweir		@param aBorder
108cdf0e10cSrcweir			specifies the location of the title cells.
109cdf0e10cSrcweir	 */
110cdf0e10cSrcweir	void addNewFromTitles(
111cdf0e10cSrcweir			[in] com::sun::star::table::CellRangeAddress aSource,
112cdf0e10cSrcweir			[in] com::sun::star::sheet::Border aBorder );
113cdf0e10cSrcweir
114cdf0e10cSrcweir	//-------------------------------------------------------------------------
115cdf0e10cSrcweir
116cdf0e10cSrcweir	/** removes a named range from the collection.
117cdf0e10cSrcweir	 */
118cdf0e10cSrcweir	void removeByName( [in] string aName );
119cdf0e10cSrcweir
120cdf0e10cSrcweir	//-------------------------------------------------------------------------
121cdf0e10cSrcweir
122cdf0e10cSrcweir	/** writes a list of all named ranges into the document.
123cdf0e10cSrcweir
124cdf0e10cSrcweir		<p>The first column of the list contains the names. The second
125cdf0e10cSrcweir		column contains the contents of the named ranges.</p>
126cdf0e10cSrcweir
127cdf0e10cSrcweir		@param aOutputPosition
128cdf0e10cSrcweir			specifies the top left cell of the output range.
129cdf0e10cSrcweir	 */
130cdf0e10cSrcweir	void outputList( [in] com::sun::star::table::CellAddress aOutputPosition );
131*dffa72deSWang Lei
132cdf0e10cSrcweir
133cdf0e10cSrcweir};
134cdf0e10cSrcweir
135cdf0e10cSrcweir//=============================================================================
136cdf0e10cSrcweir
137cdf0e10cSrcweir}; }; }; };
138cdf0e10cSrcweir
139cdf0e10cSrcweir#endif
140cdf0e10cSrcweir
141