xref: /aoo42x/main/sfx2/source/inc/doctemplates.hxx (revision 353d8f4d)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SFX_DOCTEMPLATES_HXX_
25cdf0e10cSrcweir #define _SFX_DOCTEMPLATES_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
28cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
29cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
30cdf0e10cSrcweir #include <com/sun/star/frame/XDocumentTemplates.hpp>
31cdf0e10cSrcweir #include <com/sun/star/frame/XStorable.hpp>
32cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
33cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
34cdf0e10cSrcweir #include <com/sun/star/lang/XLocalizable.hpp>
35cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
36cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37cdf0e10cSrcweir #include <com/sun/star/ucb/XContent.hpp>
38cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
39cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp>
40cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp>
41cdf0e10cSrcweir #include <ucbhelper/content.hxx>
42cdf0e10cSrcweir #include <sfx2/sfxuno.hxx>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define UNOLOCALE                   ::com::sun::star::lang::Locale
47cdf0e10cSrcweir #define REFERENCE					::com::sun::star::uno::Reference
48cdf0e10cSrcweir #define RUNTIMEEXCEPTION			::com::sun::star::uno::RuntimeException
49cdf0e10cSrcweir #define PROPERTYVALUE				::com::sun::star::beans::PropertyValue
50cdf0e10cSrcweir #define XCONTENT					::com::sun::star::ucb::XContent
51cdf0e10cSrcweir #define XDOCUMENTTEMPLATES			::com::sun::star::frame::XDocumentTemplates
52cdf0e10cSrcweir #define XINTERFACE					::com::sun::star::uno::XInterface
53cdf0e10cSrcweir #define XLOCALIZABLE				::com::sun::star::lang::XLocalizable
54cdf0e10cSrcweir #define XMODEL						::com::sun::star::frame::XModel
55cdf0e10cSrcweir #define XMULTISERVICEFACTORY		::com::sun::star::lang::XMultiServiceFactory
56cdf0e10cSrcweir #define XNAMEACCESS					::com::sun::star::container::XNameAccess
57cdf0e10cSrcweir #define XSERVICEINFO				::com::sun::star::lang::XServiceInfo
58cdf0e10cSrcweir #define XSTORABLE					::com::sun::star::frame::XStorable
59cdf0e10cSrcweir 
60cdf0e10cSrcweir //--------------------------------------------------------------------------------------------------------
61cdf0e10cSrcweir 
62cdf0e10cSrcweir class SfxDocTplService_Impl;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir class SfxDocTplService: public ::cppu::WeakImplHelper3< XLOCALIZABLE, XDOCUMENTTEMPLATES, XSERVICEINFO >
65cdf0e10cSrcweir {
66cdf0e10cSrcweir 	SfxDocTplService_Impl		*pImp;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir public:
69cdf0e10cSrcweir 									SFX_DECL_XSERVICEINFO
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 									SfxDocTplService( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
72cdf0e10cSrcweir 								   ~SfxDocTplService();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	// --- XLocalizable ---
75cdf0e10cSrcweir     void SAL_CALL                   setLocale( const UNOLOCALE & eLocale ) throw( RUNTIMEEXCEPTION );
76cdf0e10cSrcweir     UNOLOCALE SAL_CALL              getLocale() throw( RUNTIMEEXCEPTION );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	// --- XDocumentTemplates ---
79cdf0e10cSrcweir     REFERENCE< XCONTENT > SAL_CALL	getContent() throw( RUNTIMEEXCEPTION );
80cdf0e10cSrcweir     sal_Bool SAL_CALL				storeTemplate( const ::rtl::OUString& GroupName,
81cdf0e10cSrcweir 												   const ::rtl::OUString& TemplateName,
82cdf0e10cSrcweir 												   const REFERENCE< XSTORABLE >& Storable ) throw( RUNTIMEEXCEPTION );
83cdf0e10cSrcweir     sal_Bool SAL_CALL				addTemplate( const ::rtl::OUString& GroupName,
84cdf0e10cSrcweir 												 const ::rtl::OUString& TemplateName,
85cdf0e10cSrcweir 												 const ::rtl::OUString& SourceURL ) throw( RUNTIMEEXCEPTION );
86cdf0e10cSrcweir     sal_Bool SAL_CALL				removeTemplate( const ::rtl::OUString& GroupName,
87cdf0e10cSrcweir 													const ::rtl::OUString& TemplateName ) throw( RUNTIMEEXCEPTION );
88cdf0e10cSrcweir     sal_Bool SAL_CALL				renameTemplate( const ::rtl::OUString& GroupName,
89cdf0e10cSrcweir 													const ::rtl::OUString& OldTemplateName,
90cdf0e10cSrcweir 													const ::rtl::OUString& NewTemplateName ) throw( RUNTIMEEXCEPTION );
91cdf0e10cSrcweir     sal_Bool SAL_CALL				addGroup( const ::rtl::OUString& GroupName ) throw( RUNTIMEEXCEPTION );
92cdf0e10cSrcweir     sal_Bool SAL_CALL				removeGroup( const ::rtl::OUString& GroupName ) throw( RUNTIMEEXCEPTION );
93cdf0e10cSrcweir     sal_Bool SAL_CALL				renameGroup( const ::rtl::OUString& OldGroupName,
94cdf0e10cSrcweir 												 const ::rtl::OUString& NewGroupName ) throw( RUNTIMEEXCEPTION );
95cdf0e10cSrcweir     void SAL_CALL					update() throw( RUNTIMEEXCEPTION );
96cdf0e10cSrcweir };
97cdf0e10cSrcweir 
98cdf0e10cSrcweir #endif
99