LibreOffice Module svx (master) 1
|
@descr This class is a singleton that has the purpose to transform between service names of shapes and associated enum values and to create new accessible objects for given shapes. More...
#include <ShapeTypeHandler.hxx>
Public Types | |
enum | { UNKNOWN_SHAPE_TYPE = 0 } |
Public Member Functions | |
ShapeTypeId | GetTypeId (const OUString &aServiceName) const |
Determines the type id of a shape with the given service name. More... | |
ShapeTypeId | GetTypeId (const css::uno::Reference< css::drawing::XShape > &rxShape) const |
Determines the type id of the specified shape. More... | |
rtl::Reference< AccessibleShape > | CreateAccessibleObject (const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo) const |
Create a new accessible object for the given shape. More... | |
void | AddShapeTypeList (int nDescriptorCount, ShapeTypeDescriptor const aDescriptorList[]) |
Add new shape types to the internal tables. More... | |
Static Public Member Functions | |
static ShapeTypeHandler & | Instance () |
This function returns a reference to the only instance of this class. More... | |
static OUString | CreateAccessibleBaseName (const css::uno::Reference< css::drawing::XShape > &rxShape) |
get the accessible base name for an object More... | |
Private Types | |
typedef std::unordered_map< OUString, ShapeTypeId > | tServiceNameToSlotId |
This hash map allows the fast look up of a type descriptor for a given service name. More... | |
Private Member Functions | |
ShapeTypeHandler () | |
Create the single instance of this class and initialize its list of type descriptors with an entry of an unknown type. More... | |
ShapeTypeHandler (const ShapeTypeHandler &aHandler) | |
ShapeTypeHandler & | operator= (const ShapeTypeHandler &aHandler) |
~ShapeTypeHandler () | |
This destructor is never called at the moment. More... | |
SVX_DLLPRIVATE tools::Long | GetSlotId (const OUString &aServiceName) const |
Determine the slot id of the specified shape type. More... | |
SVX_DLLPRIVATE tools::Long | GetSlotId (const css::uno::Reference< css::drawing::XShape > &rxShape) const |
Determine the slot id of the specified shape type. More... | |
Private Attributes | |
::std::vector< ShapeTypeDescriptor > | maShapeTypeDescriptorList |
List of shape type descriptors. More... | |
tServiceNameToSlotId | maServiceNameToSlotId |
Static Private Attributes | |
static ShapeTypeHandler * | instance = nullptr |
Pointer to the only instance of this class. More... | |
@descr This class is a singleton that has the purpose to transform between service names of shapes and associated enum values and to create new accessible objects for given shapes.
Definition at line 79 of file ShapeTypeHandler.hxx.
|
private |
This hash map allows the fast look up of a type descriptor for a given service name.
Definition at line 171 of file ShapeTypeHandler.hxx.
anonymous enum |
Enumerator | |
---|---|
UNKNOWN_SHAPE_TYPE |
Definition at line 82 of file ShapeTypeHandler.hxx.
|
private |
Create the single instance of this class and initialize its list of type descriptors with an entry of an unknown type.
Definition at line 123 of file ShapeTypeHandler.cxx.
References accessibility::CreateEmptyShapeReference(), maServiceNameToSlotId, maShapeTypeDescriptorList, and UNKNOWN_SHAPE_TYPE.
Referenced by Instance().
|
private |
|
private |
This destructor is never called at the moment.
But because this class is a singleton this is not a problem.
Definition at line 135 of file ShapeTypeHandler.cxx.
References instance.
void accessibility::ShapeTypeHandler::AddShapeTypeList | ( | int | nDescriptorCount, |
ShapeTypeDescriptor const | aDescriptorList[] | ||
) |
Add new shape types to the internal tables.
Each new shape type is described by one shape type descriptor. See ShapeTypeDescriptor for more details.
nDescriptorCount | Number of new shape types. |
aDescriptorList | Array of new shape type descriptors. |
Definition at line 146 of file ShapeTypeHandler.cxx.
References i, accessibility::ShapeTypeDescriptor::maCreateFunction, maServiceNameToSlotId, maShapeTypeDescriptorList, accessibility::ShapeTypeDescriptor::mnShapeTypeId, and accessibility::ShapeTypeDescriptor::msServiceName.
Referenced by accessibility::RegisterDrawShapeTypes().
|
static |
get the accessible base name for an object
css::uno::RuntimeException |
Definition at line 191 of file ShapeTypeHandler.cxx.
References accessibility::DRAWING_3D_CUBE, accessibility::DRAWING_3D_EXTRUDE, accessibility::DRAWING_3D_LATHE, accessibility::DRAWING_3D_SCENE, accessibility::DRAWING_3D_SPHERE, accessibility::DRAWING_CAPTION, accessibility::DRAWING_CLOSED_BEZIER, accessibility::DRAWING_CLOSED_FREEHAND, accessibility::DRAWING_CONNECTOR, accessibility::DRAWING_CONTROL, accessibility::DRAWING_CUSTOM, accessibility::DRAWING_ELLIPSE, accessibility::DRAWING_GROUP, accessibility::DRAWING_LINE, accessibility::DRAWING_MEASURE, accessibility::DRAWING_OPEN_BEZIER, accessibility::DRAWING_OPEN_FREEHAND, accessibility::DRAWING_PAGE, accessibility::DRAWING_POLY_LINE, accessibility::DRAWING_POLY_LINE_PATH, accessibility::DRAWING_POLY_POLYGON, accessibility::DRAWING_POLY_POLYGON_PATH, accessibility::DRAWING_RECTANGLE, accessibility::DRAWING_TEXT, SdrObject::getSdrObjectFromXShape(), GetTypeId(), Instance(), sName, and SvxResId().
Referenced by accessibility::AccessibleShape::CreateAccessibleBaseName(), and accessibility::AccessibleShape::GetStyle().
rtl::Reference< AccessibleShape > accessibility::ShapeTypeHandler::CreateAccessibleObject | ( | const AccessibleShapeInfo & | rShapeInfo, |
const AccessibleShapeTreeInfo & | rShapeTreeInfo | ||
) | const |
Create a new accessible object for the given shape.
This factory method determines the type descriptor for the type of the given shape, then calls the descriptor's create function, and finally initializes the new object.
rShapeInfo | Bundle of information passed to the new accessible shape. |
rShapeTreeInfo | Bundle of information passed down the shape tree. |
XAccessible
interface. This pointer may be NULL if the specified shape is of unknown type. Definition at line 106 of file ShapeTypeHandler.cxx.
References GetSlotId(), maShapeTypeDescriptorList, and accessibility::AccessibleShapeInfo::mxShape.
|
private |
Determine the slot id of the specified shape type.
With this id internal methods can access the associated type descriptor.
rxShape | Shape for which to return the slot id. |
|
private |
Determine the slot id of the specified shape type.
With this id internal methods can access the associated type descriptor.
aServiceName | Service name of the shape for which to return the slot id. |
Definition at line 170 of file ShapeTypeHandler.cxx.
References I, and maServiceNameToSlotId.
Referenced by CreateAccessibleObject().
ShapeTypeId accessibility::ShapeTypeHandler::GetTypeId | ( | const css::uno::Reference< css::drawing::XShape > & | rxShape | ) | const |
Determines the type id of the specified shape.
xShape | Reference to the shape for which to return the type id. |
ShapeTypeId accessibility::ShapeTypeHandler::GetTypeId | ( | const OUString & | aServiceName | ) | const |
Determines the type id of a shape with the given service name.
The given service name is first transformed into a slot id that identifies the place of the type descriptor.
aServiceName | Service name of the shape for which to return the type id. |
From that descriptor the shape type id is returned.
Definition at line 77 of file ShapeTypeHandler.cxx.
References I, maServiceNameToSlotId, and maShapeTypeDescriptorList.
Referenced by accessibility::AccessibleControlShape::CreateAccessibleBaseName(), accessibility::AccessibleGraphicShape::CreateAccessibleBaseName(), accessibility::AccessibleOLEShape::CreateAccessibleBaseName(), CreateAccessibleBaseName(), and accessibility::AccessibleControlShape::CreateAccessibleDescription().
|
static |
This function returns a reference to the only instance of this class.
Use this instance to retrieve a shape's type and service name.
Definition at line 52 of file ShapeTypeHandler.cxx.
References instance, accessibility::RegisterDrawShapeTypes(), and ShapeTypeHandler().
Referenced by accessibility::AccessibleControlShape::CreateAccessibleBaseName(), accessibility::AccessibleGraphicShape::CreateAccessibleBaseName(), accessibility::AccessibleOLEShape::CreateAccessibleBaseName(), CreateAccessibleBaseName(), accessibility::AccessibleControlShape::CreateAccessibleDescription(), accessibility::ChildrenManagerImpl::GetAccControlShapeFromModel(), accessibility::AccessibleShape::getAccessibleRole(), accessibility::RegisterDrawShapeTypes(), and accessibility::AccessibleShape::UpdateStates().
|
private |
|
staticprivate |
Pointer to the only instance of this class.
Definition at line 159 of file ShapeTypeHandler.hxx.
Referenced by Instance(), and ~ShapeTypeHandler().
|
mutableprivate |
Definition at line 172 of file ShapeTypeHandler.hxx.
Referenced by AddShapeTypeList(), GetSlotId(), GetTypeId(), and ShapeTypeHandler().
|
private |
List of shape type descriptors.
This list is normally build up in several steps when libraries that implement shapes are loaded and call the addShapeTypeList method. After that no modifications of the list take place.
Definition at line 166 of file ShapeTypeHandler.hxx.
Referenced by AddShapeTypeList(), CreateAccessibleObject(), GetTypeId(), and ShapeTypeHandler().