/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef __com_sun_star_sheet_XNamedRanges_idl__
#define __com_sun_star_sheet_XNamedRanges_idl__

#include <com/sun/star/container/XNameAccess.idl>
#include <com/sun/star/table/CellAddress.idl>
#include <com/sun/star/table/CellRangeAddress.idl>
#include <com/sun/star/sheet/Border.idl>


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 NamedRangeFlag.

            <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 aBorder.
        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 Border::TOP
        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

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
