1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef _SFX_DOCTEMPLATES_HXX_
29 #define _SFX_DOCTEMPLATES_HXX_
31 #include <cppuhelper/weak.hxx>
32 #include <cppuhelper/implbase3.hxx>
33 #include <com/sun/star/container/XNameAccess.hpp>
34 #include <com/sun/star/frame/XDocumentTemplates.hpp>
35 #include <com/sun/star/frame/XStorable.hpp>
36 #include <com/sun/star/frame/XModel.hpp>
37 #include <com/sun/star/lang/Locale.hpp>
38 #include <com/sun/star/lang/XLocalizable.hpp>
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
41 #include <com/sun/star/ucb/XContent.hpp>
42 #include <com/sun/star/beans/PropertyValue.hpp>
43 #include <com/sun/star/uno/RuntimeException.hpp>
44 #include <com/sun/star/uno/XInterface.hpp>
45 #include <ucbhelper/content.hxx>
46 #include <sfx2/sfxuno.hxx>
48 //--------------------------------------------------------------------------------------------------------
50 #define UNOLOCALE ::com::sun::star::lang::Locale
51 #define REFERENCE ::com::sun::star::uno::Reference
52 #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
53 #define PROPERTYVALUE ::com::sun::star::beans::PropertyValue
54 #define XCONTENT ::com::sun::star::ucb::XContent
55 #define XDOCUMENTTEMPLATES ::com::sun::star::frame::XDocumentTemplates
56 #define XINTERFACE ::com::sun::star::uno::XInterface
57 #define XLOCALIZABLE ::com::sun::star::lang::XLocalizable
58 #define XMODEL ::com::sun::star::frame::XModel
59 #define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory
60 #define XNAMEACCESS ::com::sun::star::container::XNameAccess
61 #define XSERVICEINFO ::com::sun::star::lang::XServiceInfo
62 #define XSTORABLE ::com::sun::star::frame::XStorable
64 //--------------------------------------------------------------------------------------------------------
66 class SfxDocTplService_Impl
;
68 class SfxDocTplService
: public ::cppu::WeakImplHelper3
< XLOCALIZABLE
, XDOCUMENTTEMPLATES
, XSERVICEINFO
>
70 SfxDocTplService_Impl
*pImp
;
75 SfxDocTplService( const REFERENCE
< ::com::sun::star::lang::XMultiServiceFactory
>& xFactory
);
78 // --- XLocalizable ---
79 void SAL_CALL
setLocale( const UNOLOCALE
& eLocale
) throw( RUNTIMEEXCEPTION
);
80 UNOLOCALE SAL_CALL
getLocale() throw( RUNTIMEEXCEPTION
);
82 // --- XDocumentTemplates ---
83 REFERENCE
< XCONTENT
> SAL_CALL
getContent() throw( RUNTIMEEXCEPTION
);
84 sal_Bool SAL_CALL
storeTemplate( const ::rtl::OUString
& GroupName
,
85 const ::rtl::OUString
& TemplateName
,
86 const REFERENCE
< XSTORABLE
>& Storable
) throw( RUNTIMEEXCEPTION
);
87 sal_Bool SAL_CALL
addTemplate( const ::rtl::OUString
& GroupName
,
88 const ::rtl::OUString
& TemplateName
,
89 const ::rtl::OUString
& SourceURL
) throw( RUNTIMEEXCEPTION
);
90 sal_Bool SAL_CALL
removeTemplate( const ::rtl::OUString
& GroupName
,
91 const ::rtl::OUString
& TemplateName
) throw( RUNTIMEEXCEPTION
);
92 sal_Bool SAL_CALL
renameTemplate( const ::rtl::OUString
& GroupName
,
93 const ::rtl::OUString
& OldTemplateName
,
94 const ::rtl::OUString
& NewTemplateName
) throw( RUNTIMEEXCEPTION
);
95 sal_Bool SAL_CALL
addGroup( const ::rtl::OUString
& GroupName
) throw( RUNTIMEEXCEPTION
);
96 sal_Bool SAL_CALL
removeGroup( const ::rtl::OUString
& GroupName
) throw( RUNTIMEEXCEPTION
);
97 sal_Bool SAL_CALL
renameGroup( const ::rtl::OUString
& OldGroupName
,
98 const ::rtl::OUString
& NewGroupName
) throw( RUNTIMEEXCEPTION
);
99 void SAL_CALL
update() throw( RUNTIMEEXCEPTION
);