1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <forms/property_handler.hxx>
24 #include <xmloff/xmltoken.hxx>
31 //= PropertyDescription
32 struct AttributeDescription
34 sal_uInt16 namespacePrefix
; // usually XML_NAMESPACE_FORM
35 ::xmloff::token::XMLTokenEnum attributeToken
;
37 AttributeDescription()
39 ,attributeToken( ::xmloff::token::XML_TOKEN_INVALID
)
44 const sal_uInt16 i_namespacePrefix
,
45 const ::xmloff::token::XMLTokenEnum i_attributeToken
47 :namespacePrefix( i_namespacePrefix
)
48 ,attributeToken( i_attributeToken
)
53 inline bool operator==( const AttributeDescription
& i_lhs
, const AttributeDescription
& i_rhs
)
55 return ( i_lhs
.namespacePrefix
== i_rhs
.namespacePrefix
)
56 && ( i_lhs
.attributeToken
== i_rhs
.attributeToken
);
59 //= PropertyDescription
60 struct PropertyDescription
62 /// is the name of the property
63 const OUString propertyName
;
64 /** denotes the attribute which represents the property. Note that multiple properties might comprise a single
67 /// is the factory for creating a handler for reading and writing the property
68 const PropertyHandlerFactory factory
;
69 /// the unique ID of the property. The property meta data table must not contain two entries with the same property ID
70 const PropertyId propertyId
;
71 const AttributeDescription attribute
;
76 ,propertyId( PID_INVALID
)
82 OUString i_propertyName
,
83 const sal_uInt16 i_namespacePrefix
,
84 const ::xmloff::token::XMLTokenEnum i_attributeToken
,
85 const PropertyHandlerFactory i_factory
,
86 const PropertyId i_propertyId
88 :propertyName(std::move( i_propertyName
))
90 ,propertyId( i_propertyId
)
91 ,attribute( i_namespacePrefix
, i_attributeToken
)
96 //= PropertyDescriptionList
97 typedef ::std::vector
< const PropertyDescription
* > PropertyDescriptionList
;
100 typedef ::std::vector
< PropertyDescriptionList
> PropertyGroups
;
102 } // namespace xmloff
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */