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#ifndef __com_sun_star_frame_XDocumentTemplates_idl__
24#define __com_sun_star_frame_XDocumentTemplates_idl__
25
26#ifndef __com_sun_star_frame_XStorable_idl__
27#include <com/sun/star/frame/XStorable.idl>
28#endif
29
30#ifndef __com_sun_star_ucb_XContent_idl__
31#include <com/sun/star/ucb/XContent.idl>
32#endif
33
34//=============================================================================
35
36module com {  module sun {  module star {  module frame {
37
38//=============================================================================
39/** provides a high level api to organize document templates
40
41    <p>
42    Template informations are saved as links to the original content
43    and organized in groups. This data should be persistent and can be
44    updated by calling special method <member>XDocumentTemplates::update()</member>.
45    A real implementation of this interface can do that on top of
46    an ucb content provider. Method <member>XDocumentTemplates::getContent()</member>
47    force that.
48    </p>
49 */
50published interface XDocumentTemplates:  com::sun::star::uno::XInterface
51{
52	//-------------------------------------------------------------------------
53    /** privides access to the root of internal used hierarchy
54
55        <p>
56        This content can be used for accessing the groups directly.
57        </p>
58
59        @return
60            the ucb content for template configuration
61	 */
62    com::sun::star::ucb::XContent getContent();
63
64	//-------------------------------------------------------------------------
65	/** creates the template with the given name in the given group using the
66        data from the storable
67
68        @param GroupName
69            specifies the group
70
71        @param TemplateName
72            specifies the template
73
74        @param Storable
75            specifies the target
76
77        @return
78            <TRUE/> if operation was sucessfully
79            <br>
80            <FALSE/> otherwise
81
82        @see XDocumentTemplates::addTemplate()
83	 */
84    boolean storeTemplate(
85        [in] string GroupName,
86        [in] string TemplateName,
87        [in] XStorable Storable);
88
89	//-------------------------------------------------------------------------
90	/** creates the template with the given name in the given group using the
91        given URL
92
93        @param GroupName
94            specifies the group
95
96        @param TemplateName
97            specifies the template
98
99        @param SourceURL
100            specifies the position of template
101
102        @return
103            <TRUE/> if operation was sucessfully
104            <br>
105            <FALSE/> otherwise
106
107        @see XDocumentTemplates::storeTemplate()
108	 */
109    boolean addTemplate(
110        [in] string GroupName,
111        [in] string TemplateName,
112        [in] string SourceURL);
113
114	//-------------------------------------------------------------------------
115    /** remove a template from specified group
116
117        @param GroupName
118            specifies the group which include the template
119
120        @param TemplateName
121            specifies the template for delete
122
123        @return
124            <TRUE/> if operation was sucessfully
125            <br>
126            <FALSE/> otherwise
127	 */
128    boolean removeTemplate(
129        [in] string GroupName,
130        [in] string TemplateName);
131
132	//-------------------------------------------------------------------------
133    /** rename a template inside specified group
134
135        @param GroupName
136            specifies the group which include the template
137
138        @param TemplateName
139            specifies the template for renaming
140
141        @return
142            <TRUE/> if operation was sucessfully
143            <br>
144            <FALSE/> otherwise
145	 */
146    boolean renameTemplate(
147        [in] string GroupName,
148        [in] string OldTemplateName,
149        [in] string NewTemplateName);
150
151	//-------------------------------------------------------------------------
152    /** creates a new group
153
154		@param GroupName
155            the name of the group to be created
156
157		@return
158            <TRUE/> if operation was sucessfully
159            <br>
160            <FALSE/> otherwise
161	*/
162    boolean addGroup( [in] string GroupName );
163
164	//-------------------------------------------------------------------------
165    /** remove an existing group
166
167		@param GroupName
168            the name of the group to be removed
169
170		@return
171            <TRUE/> if operation was sucessfully
172            <br>
173            <FALSE/> otherwise
174	 */
175    boolean removeGroup( [in] string GroupName );
176
177	//-------------------------------------------------------------------------
178    /** rename an existing group
179
180        @param OldGroupName
181            the old name of the group
182
183        @param NewGroupName
184            the new name of the group
185
186		@return
187            <TRUE/> if operation was sucessfully
188            <br>
189            <FALSE/> otherwise
190	 */
191    boolean renameGroup(
192        [in] string OldGroupName,
193        [in] string NewGroupName);
194
195	//-------------------------------------------------------------------------
196    /** force an update for internal structures
197
198        <p>
199        Because the templates are well known by links and not as direct content
200        they can be outdated. An update force actualization of that to find
201        wrong links.
202        </p>
203	 */
204    [oneway] void update();
205};
206
207//=============================================================================
208
209}; }; }; };
210
211#endif
212