fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / xmloff / source / forms / property_description.hxx
blob170b23d52269493749ff369cd96acee8f4383fd5
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 XMLOFF_PROPERTY_DESCRIPTION_HXX
21 #define XMLOFF_PROPERTY_DESCRIPTION_HXX
23 #include "forms/property_handler.hxx"
24 #include "property_group.hxx"
26 #include "xmloff/xmltoken.hxx"
28 #include <vector>
29 #include <list>
31 //......................................................................................................................
32 namespace xmloff
34 //......................................................................................................................
36 //==================================================================================================================
37 //= PropertyDescription
38 //==================================================================================================================
39 struct AttributeDescription
41 sal_uInt16 namespacePrefix; // usually XML_NAMESPACE_FORM
42 ::xmloff::token::XMLTokenEnum attributeToken;
44 AttributeDescription()
45 :namespacePrefix( 0 )
46 ,attributeToken( ::xmloff::token::XML_TOKEN_INVALID )
50 AttributeDescription(
51 const sal_uInt16 i_namespacePrefix,
52 const ::xmloff::token::XMLTokenEnum i_attributeToken
54 :namespacePrefix( i_namespacePrefix )
55 ,attributeToken( i_attributeToken )
60 //..................................................................................................................
61 inline bool operator==( const AttributeDescription& i_lhs, const AttributeDescription& i_rhs )
63 return ( i_lhs.namespacePrefix == i_rhs.namespacePrefix )
64 && ( i_lhs.attributeToken == i_rhs.attributeToken );
67 //==================================================================================================================
68 //= PropertyDescription
69 //==================================================================================================================
70 struct PropertyDescription
72 /// is the name of the property
73 const OUString propertyName;
74 /** denotes the attribute which represents the property. Note that multiple properties might comprise a single
75 attribute value.
77 const AttributeDescription attribute;
78 /// is the factory for creating a handler for reading and writing the property
79 const PropertyHandlerFactory factory;
80 /// the unique ID of the property. The property meta data table must not contain two entries with the same property ID
81 const PropertyId propertyId;
82 /** the group which the property belongs to. Multiple properties belonging to the same group will, all together,
83 define the attribute value to be written into the ODF file.
85 Consequently, properties which have the same |propertyGroup| value must also have the same |attribute|
86 and the same |factory| value, with the only exception being NO_GROUP properties.
88 Note that the other direction is not given: It is perfectly legitimate to map the same attribute to different
89 (disjunct) property groups.
91 const PropertyGroup propertyGroup;
93 PropertyDescription()
94 :propertyName()
95 ,attribute()
96 ,factory( NULL )
97 ,propertyId( PID_INVALID )
98 ,propertyGroup( NO_GROUP )
102 PropertyDescription(
103 const OUString& i_propertyName,
104 const sal_uInt16 i_namespacePrefix,
105 const ::xmloff::token::XMLTokenEnum i_attributeToken,
106 const PropertyHandlerFactory i_factory,
107 const PropertyId i_propertyId,
108 const PropertyGroup i_propertyGroup
110 :propertyName( i_propertyName )
111 ,attribute( i_namespacePrefix, i_attributeToken )
112 ,factory( i_factory )
113 ,propertyId( i_propertyId )
114 ,propertyGroup( i_propertyGroup )
119 //==================================================================================================================
120 //= PropertyDescriptionList
121 //==================================================================================================================
122 typedef ::std::vector< const PropertyDescription* > PropertyDescriptionList;
124 //==================================================================================================================
125 //= PropertyGroups
126 //==================================================================================================================
127 typedef ::std::list< PropertyDescriptionList > PropertyGroups;
129 //......................................................................................................................
130 } // namespace xmloff
131 //......................................................................................................................
133 #endif // XMLOFF_PROPERTY_DESCRIPTION_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */