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