LibreOffice Module xmloff (master)  1
property_description.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_XMLOFF_SOURCE_FORMS_PROPERTY_DESCRIPTION_HXX
21 #define INCLUDED_XMLOFF_SOURCE_FORMS_PROPERTY_DESCRIPTION_HXX
22 
24 #include <xmloff/xmltoken.hxx>
25 
26 #include <vector>
27 
28 namespace xmloff
29 {
30 
31  //= PropertyDescription
33  {
34  sal_uInt16 namespacePrefix; // usually XML_NAMESPACE_FORM
36 
38  :namespacePrefix( 0 )
39  ,attributeToken( ::xmloff::token::XML_TOKEN_INVALID )
40  {
41  }
42 
44  const sal_uInt16 i_namespacePrefix,
46  )
47  :namespacePrefix( i_namespacePrefix )
48  ,attributeToken( i_attributeToken )
49  {
50  }
51  };
52 
53  inline bool operator==( const AttributeDescription& i_lhs, const AttributeDescription& i_rhs )
54  {
55  return ( i_lhs.namespacePrefix == i_rhs.namespacePrefix )
56  && ( i_lhs.attributeToken == i_rhs.attributeToken );
57  }
58 
59  //= PropertyDescription
61  {
63  const OUString propertyName;
72 
74  :propertyName()
75  ,attribute()
76  ,factory( nullptr )
77  ,propertyId( PID_INVALID )
78  {
79  }
80 
82  const 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
87  )
88  :propertyName( i_propertyName )
89  ,attribute( i_namespacePrefix, i_attributeToken )
90  ,factory( i_factory )
91  ,propertyId( i_propertyId )
92  {
93  }
94  };
95 
96  //= PropertyDescriptionList
97  typedef ::std::vector< const PropertyDescription* > PropertyDescriptionList;
98 
99  //= PropertyGroups
100  typedef ::std::vector< PropertyDescriptionList > PropertyGroups;
101 
102 } // namespace xmloff
103 
104 #endif // INCLUDED_XMLOFF_SOURCE_FORMS_PROPERTY_DESCRIPTION_HXX
105 
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::vector< PropertyDescriptionList > PropertyGroups
::std::vector< const PropertyDescription * > PropertyDescriptionList
const PropertyId propertyId
the unique ID of the property. The property meta data table must not contain two entries with the sam...
AttributeDescription(const sal_uInt16 i_namespacePrefix, const ::xmloff::token::XMLTokenEnum i_attributeToken)
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
PropertyDescription(const OUString &i_propertyName, const sal_uInt16 i_namespacePrefix, const ::xmloff::token::XMLTokenEnum i_attributeToken, const PropertyHandlerFactory i_factory, const PropertyId i_propertyId)
::xmloff::token::XMLTokenEnum attributeToken
const AttributeDescription attribute
denotes the attribute which represents the property.
PPropertyHandler(* PropertyHandlerFactory)(const PropertyId i_propertyId)
const OUString propertyName
is the name of the property
const PropertyHandlerFactory factory
is the factory for creating a handler for reading and writing the property
bool operator==(const AttributeDescription &i_lhs, const AttributeDescription &i_rhs)