LibreOffice Module svx (master) 1
SvxShapeTypes.cxx
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#include <svx/SvxShapeTypes.hxx>
28
29namespace accessibility {
30
32 const AccessibleShapeInfo& rShapeInfo,
33 const AccessibleShapeTreeInfo& rShapeTreeInfo,
34 ShapeTypeId nId)
35{
36 switch (nId)
37 {
38 case DRAWING_3D_CUBE:
43 case DRAWING_CAPTION:
47 case DRAWING_ELLIPSE:
48 case DRAWING_GROUP:
49 case DRAWING_LINE:
50 case DRAWING_MEASURE:
53 case DRAWING_PAGE:
59 case DRAWING_TEXT:
60 // Default accessibility shape for
61 // css::drawing::CustomShape (#i37790#)
62 case DRAWING_CUSTOM:
63 // Default accessibility shape for
64 // css::drawing::MediaShape (#i85429#)
65 case DRAWING_MEDIA:
66 return new AccessibleShape (rShapeInfo, rShapeTreeInfo);
67
68 case DRAWING_CONTROL:
69 return new AccessibleControlShape (rShapeInfo, rShapeTreeInfo);
70
72 return new AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo);
73
74 case DRAWING_APPLET:
75 case DRAWING_FRAME:
76 case DRAWING_OLE:
77 case DRAWING_PLUGIN:
78 return new AccessibleOLEShape (rShapeInfo, rShapeTreeInfo);
79
80 case DRAWING_TABLE:
81 return new AccessibleTableShape( rShapeInfo, rShapeTreeInfo );
82
83 default:
84 return nullptr;
85 }
86}
87
89{
93 static ShapeTypeDescriptor const aSvxShapeTypeList[] = {
94 ShapeTypeDescriptor ( DRAWING_TEXT, "com.sun.star.drawing.TextShape",
96 ShapeTypeDescriptor (DRAWING_RECTANGLE, "com.sun.star.drawing.RectangleShape",
98 ShapeTypeDescriptor ( DRAWING_ELLIPSE, "com.sun.star.drawing.EllipseShape",
100 ShapeTypeDescriptor ( DRAWING_CONTROL, "com.sun.star.drawing.ControlShape",
102 ShapeTypeDescriptor ( DRAWING_CONNECTOR, "com.sun.star.drawing.ConnectorShape",
104 ShapeTypeDescriptor ( DRAWING_MEASURE, "com.sun.star.drawing.MeasureShape",
106 ShapeTypeDescriptor ( DRAWING_LINE, "com.sun.star.drawing.LineShape",
108 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON, "com.sun.star.drawing.PolyPolygonShape",
110 ShapeTypeDescriptor ( DRAWING_POLY_LINE, "com.sun.star.drawing.PolyLineShape",
112 ShapeTypeDescriptor ( DRAWING_OPEN_BEZIER, "com.sun.star.drawing.OpenBezierShape",
114 ShapeTypeDescriptor ( DRAWING_CLOSED_BEZIER, "com.sun.star.drawing.ClosedBezierShape",
116 ShapeTypeDescriptor ( DRAWING_OPEN_FREEHAND, "com.sun.star.drawing.OpenFreeHandShape",
118 ShapeTypeDescriptor ( DRAWING_CLOSED_FREEHAND, "com.sun.star.drawing.ClosedFreeHandShape",
120 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON_PATH, "com.sun.star.drawing.PolyPolygonPathShape",
122 ShapeTypeDescriptor ( DRAWING_POLY_LINE_PATH, "com.sun.star.drawing.PolyLinePathShape",
124 ShapeTypeDescriptor ( DRAWING_GRAPHIC_OBJECT, "com.sun.star.drawing.GraphicObjectShape",
126 ShapeTypeDescriptor ( DRAWING_GROUP, "com.sun.star.drawing.GroupShape",
128 ShapeTypeDescriptor ( DRAWING_OLE, "com.sun.star.drawing.OLE2Shape",
130 ShapeTypeDescriptor ( DRAWING_PAGE, "com.sun.star.drawing.PageShape",
132 ShapeTypeDescriptor ( DRAWING_CAPTION, "com.sun.star.drawing.CaptionShape",
134 ShapeTypeDescriptor ( DRAWING_FRAME, "com.sun.star.drawing.FrameShape",
136 ShapeTypeDescriptor ( DRAWING_PLUGIN, "com.sun.star.drawing.PluginShape",
138 ShapeTypeDescriptor ( DRAWING_APPLET, "com.sun.star.drawing.AppletShape",
140 ShapeTypeDescriptor ( DRAWING_3D_SCENE, "com.sun.star.drawing.Shape3DSceneObject",
142 ShapeTypeDescriptor ( DRAWING_3D_CUBE, "com.sun.star.drawing.Shape3DCubeObject",
144 ShapeTypeDescriptor ( DRAWING_3D_SPHERE, "com.sun.star.drawing.Shape3DSphereObject",
146 ShapeTypeDescriptor ( DRAWING_3D_LATHE, "com.sun.star.drawing.Shape3DLatheObject",
148 ShapeTypeDescriptor ( DRAWING_3D_EXTRUDE, "com.sun.star.drawing.Shape3DExtrudeObject",
150 ShapeTypeDescriptor ( DRAWING_CUSTOM, "com.sun.star.drawing.CustomShape",
152 ShapeTypeDescriptor ( DRAWING_TABLE, "com.sun.star.drawing.TableShape",
154 ShapeTypeDescriptor ( DRAWING_MEDIA, "com.sun.star.drawing.MediaShape",
156
157 };
158
159 // Crash while inserting callout with activated accessibility (#i37790#)
161}
162
163} // end of namespace accessibility
164
165/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@descr This class makes graphic shapes accessible.
@descr This class makes OLE objects accessible.
@descr This class is a container for the information specific for a single shape that is passed to th...
This class bundles all information that is passed down the tree of accessible shapes so that each sha...
This base class provides a base implementation for all shapes.
void AddShapeTypeList(int nDescriptorCount, ShapeTypeDescriptor const aDescriptorList[])
Add new shape types to the internal tables.
static ShapeTypeHandler & Instance()
This function returns a reference to the only instance of this class.
int ShapeTypeId
Use an integer to represent shape type ids.
static rtl::Reference< AccessibleShape > CreateSvxAccessibleShape(const AccessibleShapeInfo &rShapeInfo, const AccessibleShapeTreeInfo &rShapeTreeInfo, ShapeTypeId nId)
void RegisterDrawShapeTypes()
Register the SVX draw shape types with the ShapeTypeHandler singleton.
sal_Int16 nId
Each shape type is described by listing its id, its service name and a function which creates a new a...