LibreOffice Module svx (master)  1
DescriptionGenerator.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 
21 #ifndef INCLUDED_SVX_DESCRIPTIONGENERATOR_HXX
22 #define INCLUDED_SVX_DESCRIPTIONGENERATOR_HXX
23 
24 #include <com/sun/star/uno/Reference.hxx>
25 #include <rtl/ustrbuf.hxx>
26 #include <svx/svxdllapi.h>
27 
28 namespace com::sun::star::beans { class XPropertySet; }
29 namespace com::sun::star::drawing { class XShape; }
30 
31 
32 namespace accessibility {
33 
42 {
43 public:
44  enum class PropertyType {
45  Color,
46  Integer
47  };
48 
56  DescriptionGenerator (const css::uno::Reference<
57  css::drawing::XShape>& xShape);
58 
60 
67  void Initialize (const OUString& sPrefix);
68 
76  void Initialize(const char* pResourceId);
77 
83  OUString operator() (void);
84 
98  void AddProperty (const OUString& sPropertyName,
99  PropertyType aType);
100 
106  void AppendString (const OUString& sString);
107 
108 private:
110  css::uno::Reference< css::drawing::XShape> mxShape;
111 
113  css::uno::Reference< css::beans::XPropertySet> mxSet;
114 
116  OUStringBuffer msDescription;
117 
122 
125  void AddColor (const OUString& sPropertyName,
126  const OUString& sLocalizedName);
127 
130  void AddInteger (const OUString& sPropertyName,
131  const OUString& sLocalizedName);
132 };
133 
134 
135 } // end of namespace accessibility
136 
137 
138 #endif
139 
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUStringBuffer msDescription
The description string that is build.
void AddColor(const OUString &sPropertyName, const OUString &sLocalizedName)
Add a property value formatted as color to the description string.
OUString sPrefix
css::uno::Reference< css::beans::XPropertySet > mxSet
Reference to the shape's property set.
OUString operator()(void)
Returns the description string and then resets it.
class SAL_NO_VTABLE XPropertySet
Definition: xmlexchg.hxx:31
void Initialize(const OUString &sPrefix)
Initialize the description with the given prefix followed by the shape style in parentheses and a col...
bool mbIsFirstProperty
This flag is used to determine whether to insert a separator e.g.
css::uno::Reference< css::drawing::XShape > mxShape
Reference to the shape from which the properties are extracted.
This class creates description strings for shapes.
DescriptionGenerator(const css::uno::Reference< css::drawing::XShape > &xShape)
Creates a new description generator with an empty description string.
void AppendString(const OUString &sString)
Append the given string as is to the current description.
void AddProperty(const OUString &sPropertyName, PropertyType aType)
Add the given property name and its associated value to the description string.
PropertyType
void AddInteger(const OUString &sPropertyName, const OUString &sLocalizedName)
Add a property value formatted as integer to the description string.