2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2001-02-06 10:51:27 +00:00
|
|
|
|
2013-10-23 19:30:56 +02:00
|
|
|
#ifndef INCLUDED_XMLOFF_SOURCE_TEXT_XMLAUTOTEXTEVENTEXPORT_HXX
|
|
|
|
#define INCLUDED_XMLOFF_SOURCE_TEXT_XMLAUTOTEXTEVENTEXPORT_HXX
|
2001-02-06 10:51:27 +00:00
|
|
|
|
2007-06-27 14:51:29 +00:00
|
|
|
#include <xmloff/xmlexp.hxx>
|
2001-02-06 10:51:27 +00:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
|
|
|
|
namespace com { namespace sun { namespace star {
|
2001-03-09 13:53:43 +00:00
|
|
|
namespace container { class XNameAccess; }
|
2001-02-06 10:51:27 +00:00
|
|
|
namespace frame { class XModel; }
|
|
|
|
namespace lang { class XMultiServiceFactory; }
|
|
|
|
namespace uno { template<class X> class Reference; }
|
|
|
|
namespace uno { template<class X> class Sequence; }
|
|
|
|
namespace uno { class XInterface; }
|
|
|
|
namespace uno { class Exception; }
|
|
|
|
namespace xml { namespace sax { class XDocumentHandler; } }
|
|
|
|
} } }
|
|
|
|
|
|
|
|
|
2001-03-09 13:53:43 +00:00
|
|
|
/**
|
|
|
|
* Component for the export of events attached to autotext blocks.
|
|
|
|
* Via the XInitialization interface it expects up to two strings, the
|
|
|
|
* first giving the file name (URL) of the autotext group, and the second
|
|
|
|
* identifying the autotext. If one of the strings is not given, it
|
|
|
|
* will export the whole group / all groups.
|
|
|
|
*/
|
2001-02-06 10:51:27 +00:00
|
|
|
class XMLAutoTextEventExport : public SvXMLExport
|
|
|
|
{
|
2001-03-09 13:53:43 +00:00
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::container::XNameAccess> xEvents;
|
2001-02-06 10:51:27 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString sEventType;
|
|
|
|
const OUString sNone;
|
2001-02-13 15:55:00 +00:00
|
|
|
|
|
|
|
|
2001-02-06 10:51:27 +00:00
|
|
|
public:
|
2001-03-09 13:53:43 +00:00
|
|
|
|
2004-05-03 12:36:56 +00:00
|
|
|
XMLAutoTextEventExport(
|
2014-01-08 14:11:58 +01:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, sal_uInt16 nFlags
|
2004-05-03 12:36:56 +00:00
|
|
|
);
|
|
|
|
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~XMLAutoTextEventExport();
|
2001-02-06 10:51:27 +00:00
|
|
|
|
2001-03-09 13:53:43 +00:00
|
|
|
// XInitialization
|
|
|
|
virtual void SAL_CALL initialize(
|
|
|
|
const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Any> & rArguments )
|
|
|
|
throw(
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2001-03-09 13:53:43 +00:00
|
|
|
|
2001-02-06 10:51:27 +00:00
|
|
|
protected:
|
2001-03-09 13:53:43 +00:00
|
|
|
|
|
|
|
/// export the events off all autotexts
|
2001-02-06 10:51:27 +00:00
|
|
|
virtual sal_uInt32 exportDoc(
|
2014-03-26 16:37:00 +01:00
|
|
|
enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID ) SAL_OVERRIDE;
|
2001-02-06 10:51:27 +00:00
|
|
|
|
|
|
|
/// does the document have any events ?
|
2001-03-09 13:53:43 +00:00
|
|
|
sal_Bool hasEvents();
|
2001-02-06 10:51:27 +00:00
|
|
|
|
2001-03-09 13:53:43 +00:00
|
|
|
/// export the events element
|
|
|
|
void exportEvents();
|
2001-02-06 10:51:27 +00:00
|
|
|
|
|
|
|
|
2001-03-09 13:53:43 +00:00
|
|
|
/// add the namespaces used by events
|
|
|
|
/// (to be called for the document element)
|
|
|
|
void addNamespaces();
|
2001-02-06 10:51:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
// methods without content:
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void _ExportMeta() SAL_OVERRIDE;
|
|
|
|
virtual void _ExportScripts() SAL_OVERRIDE;
|
|
|
|
virtual void _ExportFontDecls() SAL_OVERRIDE;
|
|
|
|
virtual void _ExportStyles( bool bUsed ) SAL_OVERRIDE ;
|
|
|
|
virtual void _ExportAutoStyles() SAL_OVERRIDE;
|
|
|
|
virtual void _ExportMasterStyles() SAL_OVERRIDE;
|
|
|
|
virtual void _ExportContent() SAL_OVERRIDE;
|
2001-02-06 10:51:27 +00:00
|
|
|
};
|
|
|
|
|
2001-03-09 13:53:43 +00:00
|
|
|
|
|
|
|
|
2001-02-06 10:51:27 +00:00
|
|
|
// global functions to support the component
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::com::sun::star::uno::Sequence< OUString > SAL_CALL
|
2001-02-06 10:51:27 +00:00
|
|
|
XMLAutoTextEventExport_getSupportedServiceNames()
|
|
|
|
throw();
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SAL_CALL XMLAutoTextEventExport_getImplementationName()
|
2001-02-06 10:51:27 +00:00
|
|
|
throw();
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
|
2004-07-13 07:30:04 +00:00
|
|
|
XMLAutoTextEventExportOOO_createInstance(
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::lang::XMultiServiceFactory > & )
|
|
|
|
throw( ::com::sun::star::uno::Exception );
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
::com::sun::star::uno::Sequence< OUString > SAL_CALL
|
2004-07-13 07:30:04 +00:00
|
|
|
XMLAutoTextEventExportOOO_getSupportedServiceNames()
|
|
|
|
throw();
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString SAL_CALL XMLAutoTextEventExportOOO_getImplementationName()
|
2004-07-13 07:30:04 +00:00
|
|
|
throw();
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
|
|
|
|
XMLAutoTextEventExportOOO_createInstance(
|
2001-02-06 10:51:27 +00:00
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::lang::XMultiServiceFactory > & )
|
|
|
|
throw( ::com::sun::star::uno::Exception );
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|