summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/sheet/XNamedRanges.idl
blob: 7fbbf843b39b012b67fbace2223ef8ffc4c6baa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: XNamedRanges.idl,v $
 * $Revision: 1.11 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifndef __com_sun_star_sheet_XNamedRanges_idl__
#define __com_sun_star_sheet_XNamedRanges_idl__

#ifndef __com_sun_star_container_XNameAccess_idl__
#include <com/sun/star/container/XNameAccess.idl>
#endif

#ifndef __com_sun_star_table_CellAddress_idl__
#include <com/sun/star/table/CellAddress.idl>
#endif

#ifndef __com_sun_star_table_CellRangeAddress_idl__
#include <com/sun/star/table/CellRangeAddress.idl>
#endif

#ifndef __com_sun_star_sheet_Border_idl__
#include <com/sun/star/sheet/Border.idl>
#endif

//=============================================================================

module com {  module sun {  module star {  module sheet {

//=============================================================================

/** provides access to the members in a collection of named ranges and to
    insert and remove them.

    @see com::sun::star::sheet::NamedRanges
    @see com::sun::star::sheet::NamedRange
 */
published interface XNamedRanges: com::sun::star::container::XNameAccess
{
    //-------------------------------------------------------------------------

    /** adds a new named range to the collection.

        @param aName
            the new name of the named range.

        @param aContent
            the formula expression.

            <p>A cell range address is one possible content of a named
            range.</p>

        @param aPosition
            specifies the base address for relative cell references.

        @param nType
            a combination of flags that specify the type of a named range,
            as defined in <type>NamedRangeFlag</type>.

            <p>This parameter will be zero for any common named range.</p>
     */
    void addNewByName(
            [in] string aName,
            [in] string aContent,
            [in] com::sun::star::table::CellAddress aPosition,
            [in] long nType );

    //-------------------------------------------------------------------------

    /** creates named cell ranges from titles in a cell range.

        <p>The names for the named ranges are taken from title cells in the
        top or bottom row, or from the cells of the left or right column
        of the range (depending on the parameter <const>aBorder</const>.
        The named ranges refer to single columns or rows in the inner
        part of the original range, excluding the labels.</p>

        <p>Example: The source range is A1:B3. The named ranges shall be
        created using row titles. This requires <member>Border::TOP</member>
        for the second parameter. The method creates two named ranges. The
        name of the first is equal to the content of cell A1 and contains the
        range $Sheet.$A$2:$A$3 (excluding the title cell). The latter named
        range is named using cell B1 and contains the cell range address
        $Sheet.$B$2:$B$3.</p>

        @param aSource
            the cell range used to create the named ranges.

        @param aBorder
            specifies the location of the title cells.
     */
    void addNewFromTitles(
            [in] com::sun::star::table::CellRangeAddress aSource,
            [in] com::sun::star::sheet::Border aBorder );

    //-------------------------------------------------------------------------

    /** removes a named range from the collection.
     */
    void removeByName( [in] string aName );

    //-------------------------------------------------------------------------

    /** writes a list of all named ranges into the document.

        <p>The first column of the list contains the names. The second
        column contains the contents of the named ranges.</p>

        @param aOutputPosition
            specifies the top left cell of the output range.
     */
    void outputList( [in] com::sun::star::table::CellAddress aOutputPosition );

};

//=============================================================================

}; }; }; };

#endif