merge the formfield patch from ooo-build
[ooovba.git] / sfx2 / source / inc / doctemplates.hxx
blobf1937e40e5dbcf46686bdd490d2ced98ac8e30c1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: doctemplates.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SFX_DOCTEMPLATES_HXX_
32 #define _SFX_DOCTEMPLATES_HXX_
34 #include <cppuhelper/weak.hxx>
35 #include <cppuhelper/implbase3.hxx>
36 #include <com/sun/star/container/XNameAccess.hpp>
37 #include <com/sun/star/frame/XDocumentTemplates.hpp>
38 #include <com/sun/star/frame/XStorable.hpp>
39 #include <com/sun/star/frame/XModel.hpp>
40 #include <com/sun/star/lang/Locale.hpp>
41 #include <com/sun/star/lang/XLocalizable.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44 #include <com/sun/star/ucb/XContent.hpp>
45 #include <com/sun/star/beans/PropertyValue.hpp>
46 #include <com/sun/star/uno/RuntimeException.hpp>
47 #include <com/sun/star/uno/XInterface.hpp>
48 #include <ucbhelper/content.hxx>
49 #include <sfx2/sfxuno.hxx>
51 //--------------------------------------------------------------------------------------------------------
53 #define UNOLOCALE ::com::sun::star::lang::Locale
54 #define REFERENCE ::com::sun::star::uno::Reference
55 #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
56 #define PROPERTYVALUE ::com::sun::star::beans::PropertyValue
57 #define XCONTENT ::com::sun::star::ucb::XContent
58 #define XDOCUMENTTEMPLATES ::com::sun::star::frame::XDocumentTemplates
59 #define XINTERFACE ::com::sun::star::uno::XInterface
60 #define XLOCALIZABLE ::com::sun::star::lang::XLocalizable
61 #define XMODEL ::com::sun::star::frame::XModel
62 #define XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory
63 #define XNAMEACCESS ::com::sun::star::container::XNameAccess
64 #define XSERVICEINFO ::com::sun::star::lang::XServiceInfo
65 #define XSTORABLE ::com::sun::star::frame::XStorable
67 //--------------------------------------------------------------------------------------------------------
69 class SfxDocTplService_Impl;
71 class SfxDocTplService: public ::cppu::WeakImplHelper3< XLOCALIZABLE, XDOCUMENTTEMPLATES, XSERVICEINFO >
73 SfxDocTplService_Impl *pImp;
75 public:
76 SFX_DECL_XSERVICEINFO
78 SfxDocTplService( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
79 ~SfxDocTplService();
81 // --- XLocalizable ---
82 void SAL_CALL setLocale( const UNOLOCALE & eLocale ) throw( RUNTIMEEXCEPTION );
83 UNOLOCALE SAL_CALL getLocale() throw( RUNTIMEEXCEPTION );
85 // --- XDocumentTemplates ---
86 REFERENCE< XCONTENT > SAL_CALL getContent() throw( RUNTIMEEXCEPTION );
87 sal_Bool SAL_CALL storeTemplate( const ::rtl::OUString& GroupName,
88 const ::rtl::OUString& TemplateName,
89 const REFERENCE< XSTORABLE >& Storable ) throw( RUNTIMEEXCEPTION );
90 sal_Bool SAL_CALL addTemplate( const ::rtl::OUString& GroupName,
91 const ::rtl::OUString& TemplateName,
92 const ::rtl::OUString& SourceURL ) throw( RUNTIMEEXCEPTION );
93 sal_Bool SAL_CALL removeTemplate( const ::rtl::OUString& GroupName,
94 const ::rtl::OUString& TemplateName ) throw( RUNTIMEEXCEPTION );
95 sal_Bool SAL_CALL renameTemplate( const ::rtl::OUString& GroupName,
96 const ::rtl::OUString& OldTemplateName,
97 const ::rtl::OUString& NewTemplateName ) throw( RUNTIMEEXCEPTION );
98 sal_Bool SAL_CALL addGroup( const ::rtl::OUString& GroupName ) throw( RUNTIMEEXCEPTION );
99 sal_Bool SAL_CALL removeGroup( const ::rtl::OUString& GroupName ) throw( RUNTIMEEXCEPTION );
100 sal_Bool SAL_CALL renameGroup( const ::rtl::OUString& OldGroupName,
101 const ::rtl::OUString& NewGroupName ) throw( RUNTIMEEXCEPTION );
102 void SAL_CALL update() throw( RUNTIMEEXCEPTION );
105 #endif