1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMLAutoTextEventExport.hxx,v $
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 _XMLOFF_XMLAUTOTEXTEVENTEXPORT_HXX
32 #define _XMLOFF_XMLAUTOTEXTEVENTEXPORT_HXX
34 #include <xmloff/xmlexp.hxx>
39 namespace rtl
{ class OUString
; }
40 namespace com
{ namespace sun
{ namespace star
{
41 namespace container
{ class XNameAccess
; }
42 namespace frame
{ class XModel
; }
43 namespace lang
{ class XMultiServiceFactory
; }
44 namespace uno
{ template<class X
> class Reference
; }
45 namespace uno
{ template<class X
> class Sequence
; }
46 namespace uno
{ class XInterface
; }
47 namespace uno
{ class Exception
; }
48 namespace xml
{ namespace sax
{ class XDocumentHandler
; } }
53 * Component for the export of events attached to autotext blocks.
54 * Via the XInitialization interface it expects up to two strings, the
55 * first giving the file name (URL) of the autotext group, and the second
56 * identifying the autotext. If one of the strings is not given, it
57 * will export the whole group / all groups.
59 class XMLAutoTextEventExport
: public SvXMLExport
61 ::com::sun::star::uno::Reference
<
62 ::com::sun::star::container::XNameAccess
> xEvents
;
64 const ::rtl::OUString sEventType
;
65 const ::rtl::OUString sNone
;
71 //XMLAutoTextEventExport();
72 XMLAutoTextEventExport(
73 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
, sal_uInt16 nFlags
77 //XMLAutoTextEventExport(
78 // const ::rtl::OUString& rFileName,
79 // const ::com::sun::star::uno::Reference<
80 // ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
81 // const ::com::sun::star::uno::Reference<
82 // ::com::sun::star::frame::XModel > & rModel,
83 // const ::com::sun::star::uno::Reference<
84 // ::com::sun::star::container::XNameAccess > & rEvents);
85 XMLAutoTextEventExport(
86 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceFactory
,
87 const ::rtl::OUString
& rFileName
,
88 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XDocumentHandler
> & rHandler
,
89 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & rModel
,
90 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> & rEvents
, sal_uInt16 nFlags
);
92 ~XMLAutoTextEventExport();
95 virtual void SAL_CALL
initialize(
96 const ::com::sun::star::uno::Sequence
<
97 ::com::sun::star::uno::Any
> & rArguments
)
99 ::com::sun::star::uno::Exception
,
100 ::com::sun::star::uno::RuntimeException
);
104 /// export the events off all autotexts
105 virtual sal_uInt32
exportDoc(
106 enum ::xmloff::token::XMLTokenEnum eClass
= xmloff::token::XML_TOKEN_INVALID
);
108 /// does the document have any events ?
109 sal_Bool
hasEvents();
111 /// export the events element
115 /// add the namespaces used by events
116 /// (to be called for the document element)
117 void addNamespaces();
120 // methods without content:
121 virtual void _ExportMeta();
122 virtual void _ExportScripts();
123 virtual void _ExportFontDecls();
124 virtual void _ExportStyles( sal_Bool bUsed
) ;
125 virtual void _ExportAutoStyles();
126 virtual void _ExportMasterStyles();
127 virtual void _ExportChangeTracking();
128 virtual void _ExportContent();
133 // global functions to support the component
135 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
136 XMLAutoTextEventExport_getSupportedServiceNames()
139 ::rtl::OUString SAL_CALL
XMLAutoTextEventExport_getImplementationName()
142 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
143 XMLAutoTextEventExportOOO_createInstance(
144 const ::com::sun::star::uno::Reference
<
145 ::com::sun::star::lang::XMultiServiceFactory
> & )
146 throw( ::com::sun::star::uno::Exception
);
148 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
149 XMLAutoTextEventExportOOO_getSupportedServiceNames()
152 ::rtl::OUString SAL_CALL
XMLAutoTextEventExportOOO_getImplementationName()
155 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
156 XMLAutoTextEventExportOOO_createInstance(
157 const ::com::sun::star::uno::Reference
<
158 ::com::sun::star::lang::XMultiServiceFactory
> & )
159 throw( ::com::sun::star::uno::Exception
);