1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <svx/SvxShapeTypes.hxx>
22 #include <svx/AccessibleShape.hxx>
23 #include <svx/AccessibleGraphicShape.hxx>
24 #include <svx/AccessibleOLEShape.hxx>
25 #include <svx/AccessibleControlShape.hxx>
26 #include <svx/ShapeTypeHandler.hxx>
27 #include <AccessibleTableShape.hxx>
29 namespace accessibility
{
31 static rtl::Reference
<AccessibleShape
> CreateSvxAccessibleShape (
32 const AccessibleShapeInfo
& rShapeInfo
,
33 const AccessibleShapeTreeInfo
& rShapeTreeInfo
,
39 case DRAWING_3D_EXTRUDE
:
40 case DRAWING_3D_LATHE
:
41 case DRAWING_3D_SCENE
:
42 case DRAWING_3D_SPHERE
:
44 case DRAWING_CLOSED_BEZIER
:
45 case DRAWING_CLOSED_FREEHAND
:
46 case DRAWING_CONNECTOR
:
51 case DRAWING_OPEN_BEZIER
:
52 case DRAWING_OPEN_FREEHAND
:
54 case DRAWING_POLY_POLYGON
:
55 case DRAWING_POLY_LINE
:
56 case DRAWING_POLY_POLYGON_PATH
:
57 case DRAWING_POLY_LINE_PATH
:
58 case DRAWING_RECTANGLE
:
60 // Default accessibility shape for
61 // css::drawing::CustomShape (#i37790#)
63 // Default accessibility shape for
64 // css::drawing::MediaShape (#i85429#)
66 return new AccessibleShape (rShapeInfo
, rShapeTreeInfo
);
69 return new AccessibleControlShape (rShapeInfo
, rShapeTreeInfo
);
71 case DRAWING_GRAPHIC_OBJECT
:
72 return new AccessibleGraphicShape (rShapeInfo
, rShapeTreeInfo
);
78 return new AccessibleOLEShape (rShapeInfo
, rShapeTreeInfo
);
81 return new AccessibleTableShape( rShapeInfo
, rShapeTreeInfo
);
88 void RegisterDrawShapeTypes()
90 /** List of shape type descriptors corresponding to the
91 <type>SvxShapeTypes</type> enum.
93 static ShapeTypeDescriptor
const aSvxShapeTypeList
[] = {
94 ShapeTypeDescriptor ( DRAWING_TEXT
, u
"com.sun.star.drawing.TextShape"_ustr
,
95 CreateSvxAccessibleShape
),
96 ShapeTypeDescriptor (DRAWING_RECTANGLE
, u
"com.sun.star.drawing.RectangleShape"_ustr
,
97 CreateSvxAccessibleShape
),
98 ShapeTypeDescriptor ( DRAWING_ELLIPSE
, u
"com.sun.star.drawing.EllipseShape"_ustr
,
99 CreateSvxAccessibleShape
),
100 ShapeTypeDescriptor ( DRAWING_CONTROL
, u
"com.sun.star.drawing.ControlShape"_ustr
,
101 CreateSvxAccessibleShape
),
102 ShapeTypeDescriptor ( DRAWING_CONNECTOR
, u
"com.sun.star.drawing.ConnectorShape"_ustr
,
103 CreateSvxAccessibleShape
),
104 ShapeTypeDescriptor ( DRAWING_MEASURE
, u
"com.sun.star.drawing.MeasureShape"_ustr
,
105 CreateSvxAccessibleShape
),
106 ShapeTypeDescriptor ( DRAWING_LINE
, u
"com.sun.star.drawing.LineShape"_ustr
,
107 CreateSvxAccessibleShape
),
108 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON
, u
"com.sun.star.drawing.PolyPolygonShape"_ustr
,
109 CreateSvxAccessibleShape
),
110 ShapeTypeDescriptor ( DRAWING_POLY_LINE
, u
"com.sun.star.drawing.PolyLineShape"_ustr
,
111 CreateSvxAccessibleShape
),
112 ShapeTypeDescriptor ( DRAWING_OPEN_BEZIER
, u
"com.sun.star.drawing.OpenBezierShape"_ustr
,
113 CreateSvxAccessibleShape
),
114 ShapeTypeDescriptor ( DRAWING_CLOSED_BEZIER
, u
"com.sun.star.drawing.ClosedBezierShape"_ustr
,
115 CreateSvxAccessibleShape
),
116 ShapeTypeDescriptor ( DRAWING_OPEN_FREEHAND
, u
"com.sun.star.drawing.OpenFreeHandShape"_ustr
,
117 CreateSvxAccessibleShape
),
118 ShapeTypeDescriptor ( DRAWING_CLOSED_FREEHAND
, u
"com.sun.star.drawing.ClosedFreeHandShape"_ustr
,
119 CreateSvxAccessibleShape
),
120 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON_PATH
, u
"com.sun.star.drawing.PolyPolygonPathShape"_ustr
,
121 CreateSvxAccessibleShape
),
122 ShapeTypeDescriptor ( DRAWING_POLY_LINE_PATH
, u
"com.sun.star.drawing.PolyLinePathShape"_ustr
,
123 CreateSvxAccessibleShape
),
124 ShapeTypeDescriptor ( DRAWING_GRAPHIC_OBJECT
, u
"com.sun.star.drawing.GraphicObjectShape"_ustr
,
125 CreateSvxAccessibleShape
),
126 ShapeTypeDescriptor ( DRAWING_GROUP
, u
"com.sun.star.drawing.GroupShape"_ustr
,
127 CreateSvxAccessibleShape
),
128 ShapeTypeDescriptor ( DRAWING_OLE
, u
"com.sun.star.drawing.OLE2Shape"_ustr
,
129 CreateSvxAccessibleShape
),
130 ShapeTypeDescriptor ( DRAWING_PAGE
, u
"com.sun.star.drawing.PageShape"_ustr
,
131 CreateSvxAccessibleShape
),
132 ShapeTypeDescriptor ( DRAWING_CAPTION
, u
"com.sun.star.drawing.CaptionShape"_ustr
,
133 CreateSvxAccessibleShape
),
134 ShapeTypeDescriptor ( DRAWING_FRAME
, u
"com.sun.star.drawing.FrameShape"_ustr
,
135 CreateSvxAccessibleShape
),
136 ShapeTypeDescriptor ( DRAWING_PLUGIN
, u
"com.sun.star.drawing.PluginShape"_ustr
,
137 CreateSvxAccessibleShape
),
138 ShapeTypeDescriptor ( DRAWING_APPLET
, u
"com.sun.star.drawing.AppletShape"_ustr
,
139 CreateSvxAccessibleShape
),
140 ShapeTypeDescriptor ( DRAWING_3D_SCENE
, u
"com.sun.star.drawing.Shape3DSceneObject"_ustr
,
141 CreateSvxAccessibleShape
),
142 ShapeTypeDescriptor ( DRAWING_3D_CUBE
, u
"com.sun.star.drawing.Shape3DCubeObject"_ustr
,
143 CreateSvxAccessibleShape
),
144 ShapeTypeDescriptor ( DRAWING_3D_SPHERE
, u
"com.sun.star.drawing.Shape3DSphereObject"_ustr
,
145 CreateSvxAccessibleShape
),
146 ShapeTypeDescriptor ( DRAWING_3D_LATHE
, u
"com.sun.star.drawing.Shape3DLatheObject"_ustr
,
147 CreateSvxAccessibleShape
),
148 ShapeTypeDescriptor ( DRAWING_3D_EXTRUDE
, u
"com.sun.star.drawing.Shape3DExtrudeObject"_ustr
,
149 CreateSvxAccessibleShape
),
150 ShapeTypeDescriptor ( DRAWING_CUSTOM
, u
"com.sun.star.drawing.CustomShape"_ustr
,
151 CreateSvxAccessibleShape
),
152 ShapeTypeDescriptor ( DRAWING_TABLE
, u
"com.sun.star.drawing.TableShape"_ustr
,
153 CreateSvxAccessibleShape
),
154 ShapeTypeDescriptor ( DRAWING_MEDIA
, u
"com.sun.star.drawing.MediaShape"_ustr
,
155 CreateSvxAccessibleShape
),
159 // Crash while inserting callout with activated accessibility (#i37790#)
160 ShapeTypeHandler::Instance().AddShapeTypeList ( DRAWING_END
, aSvxShapeTypeList
);
163 } // end of namespace accessibility
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */