xref: /aoo4110/main/sfx2/source/inc/doctemplates.hxx (revision b1cdbd2c)
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 
24 #ifndef _SFX_DOCTEMPLATES_HXX_
25 #define _SFX_DOCTEMPLATES_HXX_
26 
27 #include <cppuhelper/weak.hxx>
28 #include <cppuhelper/implbase3.hxx>
29 #include <com/sun/star/container/XNameAccess.hpp>
30 #include <com/sun/star/frame/XDocumentTemplates.hpp>
31 #include <com/sun/star/frame/XStorable.hpp>
32 #include <com/sun/star/frame/XModel.hpp>
33 #include <com/sun/star/lang/Locale.hpp>
34 #include <com/sun/star/lang/XLocalizable.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/ucb/XContent.hpp>
38 #include <com/sun/star/beans/PropertyValue.hpp>
39 #include <com/sun/star/uno/RuntimeException.hpp>
40 #include <com/sun/star/uno/XInterface.hpp>
41 #include <ucbhelper/content.hxx>
42 #include <sfx2/sfxuno.hxx>
43 
44 //--------------------------------------------------------------------------------------------------------
45 
46 #define UNOLOCALE                   ::com::sun::star::lang::Locale
47 #define REFERENCE					::com::sun::star::uno::Reference
48 #define RUNTIMEEXCEPTION			::com::sun::star::uno::RuntimeException
49 #define PROPERTYVALUE				::com::sun::star::beans::PropertyValue
50 #define XCONTENT					::com::sun::star::ucb::XContent
51 #define XDOCUMENTTEMPLATES			::com::sun::star::frame::XDocumentTemplates
52 #define XINTERFACE					::com::sun::star::uno::XInterface
53 #define XLOCALIZABLE				::com::sun::star::lang::XLocalizable
54 #define XMODEL						::com::sun::star::frame::XModel
55 #define XMULTISERVICEFACTORY		::com::sun::star::lang::XMultiServiceFactory
56 #define XNAMEACCESS					::com::sun::star::container::XNameAccess
57 #define XSERVICEINFO				::com::sun::star::lang::XServiceInfo
58 #define XSTORABLE					::com::sun::star::frame::XStorable
59 
60 //--------------------------------------------------------------------------------------------------------
61 
62 class SfxDocTplService_Impl;
63 
64 class SfxDocTplService: public ::cppu::WeakImplHelper3< XLOCALIZABLE, XDOCUMENTTEMPLATES, XSERVICEINFO >
65 {
66 	SfxDocTplService_Impl		*pImp;
67 
68 public:
69 									SFX_DECL_XSERVICEINFO
70 
71 									SfxDocTplService( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
72 								   ~SfxDocTplService();
73 
74 	// --- XLocalizable ---
75     void SAL_CALL                   setLocale( const UNOLOCALE & eLocale ) throw( RUNTIMEEXCEPTION );
76     UNOLOCALE SAL_CALL              getLocale() throw( RUNTIMEEXCEPTION );
77 
78 	// --- XDocumentTemplates ---
79     REFERENCE< XCONTENT > SAL_CALL	getContent() throw( RUNTIMEEXCEPTION );
80     sal_Bool SAL_CALL				storeTemplate( const ::rtl::OUString& GroupName,
81 												   const ::rtl::OUString& TemplateName,
82 												   const REFERENCE< XSTORABLE >& Storable ) throw( RUNTIMEEXCEPTION );
83     sal_Bool SAL_CALL				addTemplate( const ::rtl::OUString& GroupName,
84 												 const ::rtl::OUString& TemplateName,
85 												 const ::rtl::OUString& SourceURL ) throw( RUNTIMEEXCEPTION );
86     sal_Bool SAL_CALL				removeTemplate( const ::rtl::OUString& GroupName,
87 													const ::rtl::OUString& TemplateName ) throw( RUNTIMEEXCEPTION );
88     sal_Bool SAL_CALL				renameTemplate( const ::rtl::OUString& GroupName,
89 													const ::rtl::OUString& OldTemplateName,
90 													const ::rtl::OUString& NewTemplateName ) throw( RUNTIMEEXCEPTION );
91     sal_Bool SAL_CALL				addGroup( const ::rtl::OUString& GroupName ) throw( RUNTIMEEXCEPTION );
92     sal_Bool SAL_CALL				removeGroup( const ::rtl::OUString& GroupName ) throw( RUNTIMEEXCEPTION );
93     sal_Bool SAL_CALL				renameGroup( const ::rtl::OUString& OldGroupName,
94 												 const ::rtl::OUString& NewGroupName ) throw( RUNTIMEEXCEPTION );
95     void SAL_CALL					update() throw( RUNTIMEEXCEPTION );
96 };
97 
98 #endif
99