/*************************************************************************
 *
 *  $RCSfile: XDocumentTemplates.idl,v $
 *
 *  $Revision: 1.5 $
 *
 *  last change: $Author: mi $ $Date: 2002/10/03 13:05:23 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library 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 for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (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.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#ifndef __com_sun_star_frame_XDocumentTemplates_idl__
#define __com_sun_star_frame_XDocumentTemplates_idl__

#ifndef __com_sun_star_frame_XStorable_idl__
#include <com/sun/star/frame/XStorable.idl>
#endif

#ifndef __com_sun_star_ucb_XContent_idl__
#include <com/sun/star/ucb/XContent.idl>
#endif

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

module com {  module sun {  module star {  module frame {

//=============================================================================
/** provides a high level api to organize document templates

    <p>
    Template informations are saved as links to the original content
    and organized in groups. This data should be persistent and can be
    updated by calling special method <member>XDocumentTemplates::update()</member>.
    A real implementation of this interface can do that on top of
    an ucb content provider. Method <member>XDocumentTemplates::getContent()</member>
    force that.
    </p>
 */
interface XDocumentTemplates:  com::sun::star::uno::XInterface
{
	//-------------------------------------------------------------------------
    /** privides access to the root of internal used hierarchy

        <p>
        This content can be used for accessing the groups directly.
        </p>

        @return
            the ucb content for template configuration
	 */
    com::sun::star::ucb::XContent getContent();

	//-------------------------------------------------------------------------
	/** creates the template with the given name in the given group using the
        data from the storable

        @param GroupName
            specifies the group

        @param TemplateName
            specifies the template

        @param Storable
            specifies the target

        @return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise

        @see XDocumentTemplates::addTemplate()
	 */
    boolean storeTemplate(
        [in] string GroupName,
        [in] string TemplateName,
        [in] XStorable Storable);

	//-------------------------------------------------------------------------
	/** creates the template with the given name in the given group using the
        given URL

        @param GroupName
            specifies the group

        @param TemplateName
            specifies the template

        @param SourceURL
            specifies the position of template

        @return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise

        @see XDocumentTemplates::storeTemplate()
	 */
    boolean addTemplate(
        [in] string GroupName,
        [in] string TemplateName,
        [in] string SourceURL);

	//-------------------------------------------------------------------------
    /** remove a template from specified group

        @param GroupName
            specifies the group which include the template

        @param TemplateName
            specifies the template for delete

        @return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise
	 */
    boolean removeTemplate(
        [in] string GroupName,
        [in] string TemplateName);

	//-------------------------------------------------------------------------
    /** rename a template inside specified group

        @param GroupName
            specifies the group which include the template

        @param TemplateName
            specifies the template for renaming

        @return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise
	 */
    boolean renameTemplate(
        [in] string GroupName,
        [in] string OldTemplateName,
        [in] string NewTemplateName);

	//-------------------------------------------------------------------------
    /** creates a new group

		@param GroupName
            the name of the group to be created

		@return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise
	*/
    boolean addGroup( [in] string GroupName );

	//-------------------------------------------------------------------------
    /** remove an existing group

		@param GroupName
            the name of the group to be removed

		@return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise
	 */
    boolean removeGroup( [in] string GroupName );

	//-------------------------------------------------------------------------
    /** rename an existing group

        @param OldGroupName
            the old name of the group

        @param NewGroupName
            the new name of the group

		@return
            <TRUE/> if operation was sucessfully
            <br>
            <FALSE/> otherwise
	 */
    boolean renameGroup(
        [in] string OldGroupName,
        [in] string NewGroupName);

	//-------------------------------------------------------------------------
    /** force an update for internal structures

        <p>
        Because the templates are well known by links and not as direct content
        they can be outdated. An update force actualization of that to find
        wrong links.
        </p>
	 */
    [oneway] void update();
};

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

}; }; }; };

#endif
