Bump version to 24.04.3.4
[LibreOffice.git] / oox / source / docprop / docprophandler.hxx
blobcdefa8c9a03cbe6df583c5c97f1702fc56668c0b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_OOX_SOURCE_DOCPROP_DOCPROPHANDLER_HXX
21 #define INCLUDED_OOX_SOURCE_DOCPROP_DOCPROPHANDLER_HXX
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <com/sun/star/document/XDocumentProperties.hpp>
25 #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
27 #include <cppuhelper/implbase.hxx>
29 #include <oox/token/namespaces.hxx>
31 namespace oox::docprop {
33 #define COREPR_TOKEN( token ) (::oox::NMSP_packageMetaCorePr | XML_##token)
34 #define CUSTPR_TOKEN( token ) (::oox::NMSP_officeCustomPr | XML_##token)
35 #define EXTPR_TOKEN( token ) (::oox::NMSP_officeExtPr | XML_##token)
36 #define VT_TOKEN( token ) (::oox::NMSP_officeDocPropsVT | XML_##token)
37 #define DC_TOKEN( token ) (::oox::NMSP_dc | XML_##token)
38 #define DCT_TOKEN( token ) (::oox::NMSP_dcTerms | XML_##token)
40 class OOXMLDocPropHandler : public ::cppu::WeakImplHelper< css::xml::sax::XFastDocumentHandler >
42 css::uno::Reference< css::document::XDocumentProperties > m_xDocProp;
44 sal_Int32 m_nState;
45 sal_Int32 m_nBlock;
46 sal_Int32 m_nType;
48 sal_Int32 m_nInBlock;
50 enum { NONE, INSERTED } m_CustomStringPropertyState;
51 OUString m_aCustomPropertyName;
53 public:
54 explicit OOXMLDocPropHandler( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::document::XDocumentProperties >& rDocProp );
56 virtual ~OOXMLDocPropHandler() override;
58 void InitNew();
59 void AddCustomProperty( const css::uno::Any& aAny );
61 static css::util::DateTime GetDateTimeFromW3CDTF( std::u16string_view aChars );
62 static css::uno::Sequence< OUString > GetKeywordsSet( std::u16string_view aChars );
63 void UpdateDocStatistic( std::u16string_view aChars );
65 // com.sun.star.xml.sax.XFastDocumentHandler
67 virtual void SAL_CALL startDocument() override;
68 virtual void SAL_CALL endDocument() override;
69 virtual void SAL_CALL processingInstruction( const OUString& rTarget, const OUString& rData ) override;
70 virtual void SAL_CALL setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& rxLocator ) override;
72 // com.sun.star.xml.sax.XFastContextHandler
74 virtual void SAL_CALL startFastElement( ::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override;
75 virtual void SAL_CALL startUnknownElement( const OUString& Namespace, const OUString& Name, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override;
76 virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) override;
77 virtual void SAL_CALL endUnknownElement( const OUString& Namespace, const OUString& Name ) override;
78 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override;
79 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString& Namespace, const OUString& Name, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override;
80 virtual void SAL_CALL characters( const OUString& aChars ) override;
84 } // namespace oox::core
86 #endif
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */