1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_frame_XDocumentTemplates_idl__
28#define __com_sun_star_frame_XDocumentTemplates_idl__
29
30#ifndef __com_sun_star_frame_XStorable_idl__
31#include <com/sun/star/frame/XStorable.idl>
32#endif
33
34#ifndef __com_sun_star_ucb_XContent_idl__
35#include <com/sun/star/ucb/XContent.idl>
36#endif
37
38//=============================================================================
39
40module com {  module sun {  module star {  module frame {
41
42//=============================================================================
43/** provides a high level api to organize document templates
44
45    <p>
46    Template informations are saved as links to the original content
47    and organized in groups. This data should be persistent and can be
48    updated by calling special method <member>XDocumentTemplates::update()</member>.
49    A real implementation of this interface can do that on top of
50    an ucb content provider. Method <member>XDocumentTemplates::getContent()</member>
51    force that.
52    </p>
53 */
54published interface XDocumentTemplates:  com::sun::star::uno::XInterface
55{
56	//-------------------------------------------------------------------------
57    /** privides access to the root of internal used hierarchy
58
59        <p>
60        This content can be used for accessing the groups directly.
61        </p>
62
63        @return
64            the ucb content for template configuration
65	 */
66    com::sun::star::ucb::XContent getContent();
67
68	//-------------------------------------------------------------------------
69	/** creates the template with the given name in the given group using the
70        data from the storable
71
72        @param GroupName
73            specifies the group
74
75        @param TemplateName
76            specifies the template
77
78        @param Storable
79            specifies the target
80
81        @return
82            <TRUE/> if operation was sucessfully
83            <br>
84            <FALSE/> otherwise
85
86        @see XDocumentTemplates::addTemplate()
87	 */
88    boolean storeTemplate(
89        [in] string GroupName,
90        [in] string TemplateName,
91        [in] XStorable Storable);
92
93	//-------------------------------------------------------------------------
94	/** creates the template with the given name in the given group using the
95        given URL
96
97        @param GroupName
98            specifies the group
99
100        @param TemplateName
101            specifies the template
102
103        @param SourceURL
104            specifies the position of template
105
106        @return
107            <TRUE/> if operation was sucessfully
108            <br>
109            <FALSE/> otherwise
110
111        @see XDocumentTemplates::storeTemplate()
112	 */
113    boolean addTemplate(
114        [in] string GroupName,
115        [in] string TemplateName,
116        [in] string SourceURL);
117
118	//-------------------------------------------------------------------------
119    /** remove a template from specified group
120
121        @param GroupName
122            specifies the group which include the template
123
124        @param TemplateName
125            specifies the template for delete
126
127        @return
128            <TRUE/> if operation was sucessfully
129            <br>
130            <FALSE/> otherwise
131	 */
132    boolean removeTemplate(
133        [in] string GroupName,
134        [in] string TemplateName);
135
136	//-------------------------------------------------------------------------
137    /** rename a template inside specified group
138
139        @param GroupName
140            specifies the group which include the template
141
142        @param TemplateName
143            specifies the template for renaming
144
145        @return
146            <TRUE/> if operation was sucessfully
147            <br>
148            <FALSE/> otherwise
149	 */
150    boolean renameTemplate(
151        [in] string GroupName,
152        [in] string OldTemplateName,
153        [in] string NewTemplateName);
154
155	//-------------------------------------------------------------------------
156    /** creates a new group
157
158		@param GroupName
159            the name of the group to be created
160
161		@return
162            <TRUE/> if operation was sucessfully
163            <br>
164            <FALSE/> otherwise
165	*/
166    boolean addGroup( [in] string GroupName );
167
168	//-------------------------------------------------------------------------
169    /** remove an existing group
170
171		@param GroupName
172            the name of the group to be removed
173
174		@return
175            <TRUE/> if operation was sucessfully
176            <br>
177            <FALSE/> otherwise
178	 */
179    boolean removeGroup( [in] string GroupName );
180
181	//-------------------------------------------------------------------------
182    /** rename an existing group
183
184        @param OldGroupName
185            the old name of the group
186
187        @param NewGroupName
188            the new name of the group
189
190		@return
191            <TRUE/> if operation was sucessfully
192            <br>
193            <FALSE/> otherwise
194	 */
195    boolean renameGroup(
196        [in] string OldGroupName,
197        [in] string NewGroupName);
198
199	//-------------------------------------------------------------------------
200    /** force an update for internal structures
201
202        <p>
203        Because the templates are well known by links and not as direct content
204        they can be outdated. An update force actualization of that to find
205        wrong links.
206        </p>
207	 */
208    [oneway] void update();
209};
210
211//=============================================================================
212
213}; }; }; };
214
215#endif
216