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
, "com.sun.star.drawing.TextShape",
95 CreateSvxAccessibleShape
),
96 ShapeTypeDescriptor (DRAWING_RECTANGLE
, "com.sun.star.drawing.RectangleShape",
97 CreateSvxAccessibleShape
),
98 ShapeTypeDescriptor ( DRAWING_ELLIPSE
, "com.sun.star.drawing.EllipseShape",
99 CreateSvxAccessibleShape
),
100 ShapeTypeDescriptor ( DRAWING_CONTROL
, "com.sun.star.drawing.ControlShape",
101 CreateSvxAccessibleShape
),
102 ShapeTypeDescriptor ( DRAWING_CONNECTOR
, "com.sun.star.drawing.ConnectorShape",
103 CreateSvxAccessibleShape
),
104 ShapeTypeDescriptor ( DRAWING_MEASURE
, "com.sun.star.drawing.MeasureShape",
105 CreateSvxAccessibleShape
),
106 ShapeTypeDescriptor ( DRAWING_LINE
, "com.sun.star.drawing.LineShape",
107 CreateSvxAccessibleShape
),
108 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON
, "com.sun.star.drawing.PolyPolygonShape",
109 CreateSvxAccessibleShape
),
110 ShapeTypeDescriptor ( DRAWING_POLY_LINE
, "com.sun.star.drawing.PolyLineShape",
111 CreateSvxAccessibleShape
),
112 ShapeTypeDescriptor ( DRAWING_OPEN_BEZIER
, "com.sun.star.drawing.OpenBezierShape",
113 CreateSvxAccessibleShape
),
114 ShapeTypeDescriptor ( DRAWING_CLOSED_BEZIER
, "com.sun.star.drawing.ClosedBezierShape",
115 CreateSvxAccessibleShape
),
116 ShapeTypeDescriptor ( DRAWING_OPEN_FREEHAND
, "com.sun.star.drawing.OpenFreeHandShape",
117 CreateSvxAccessibleShape
),
118 ShapeTypeDescriptor ( DRAWING_CLOSED_FREEHAND
, "com.sun.star.drawing.ClosedFreeHandShape",
119 CreateSvxAccessibleShape
),
120 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON_PATH
, "com.sun.star.drawing.PolyPolygonPathShape",
121 CreateSvxAccessibleShape
),
122 ShapeTypeDescriptor ( DRAWING_POLY_LINE_PATH
, "com.sun.star.drawing.PolyLinePathShape",
123 CreateSvxAccessibleShape
),
124 ShapeTypeDescriptor ( DRAWING_GRAPHIC_OBJECT
, "com.sun.star.drawing.GraphicObjectShape",
125 CreateSvxAccessibleShape
),
126 ShapeTypeDescriptor ( DRAWING_GROUP
, "com.sun.star.drawing.GroupShape",
127 CreateSvxAccessibleShape
),
128 ShapeTypeDescriptor ( DRAWING_OLE
, "com.sun.star.drawing.OLE2Shape",
129 CreateSvxAccessibleShape
),
130 ShapeTypeDescriptor ( DRAWING_PAGE
, "com.sun.star.drawing.PageShape",
131 CreateSvxAccessibleShape
),
132 ShapeTypeDescriptor ( DRAWING_CAPTION
, "com.sun.star.drawing.CaptionShape",
133 CreateSvxAccessibleShape
),
134 ShapeTypeDescriptor ( DRAWING_FRAME
, "com.sun.star.drawing.FrameShape",
135 CreateSvxAccessibleShape
),
136 ShapeTypeDescriptor ( DRAWING_PLUGIN
, "com.sun.star.drawing.PluginShape",
137 CreateSvxAccessibleShape
),
138 ShapeTypeDescriptor ( DRAWING_APPLET
, "com.sun.star.drawing.AppletShape",
139 CreateSvxAccessibleShape
),
140 ShapeTypeDescriptor ( DRAWING_3D_SCENE
, "com.sun.star.drawing.Shape3DSceneObject",
141 CreateSvxAccessibleShape
),
142 ShapeTypeDescriptor ( DRAWING_3D_CUBE
, "com.sun.star.drawing.Shape3DCubeObject",
143 CreateSvxAccessibleShape
),
144 ShapeTypeDescriptor ( DRAWING_3D_SPHERE
, "com.sun.star.drawing.Shape3DSphereObject",
145 CreateSvxAccessibleShape
),
146 ShapeTypeDescriptor ( DRAWING_3D_LATHE
, "com.sun.star.drawing.Shape3DLatheObject",
147 CreateSvxAccessibleShape
),
148 ShapeTypeDescriptor ( DRAWING_3D_EXTRUDE
, "com.sun.star.drawing.Shape3DExtrudeObject",
149 CreateSvxAccessibleShape
),
150 ShapeTypeDescriptor ( DRAWING_CUSTOM
, "com.sun.star.drawing.CustomShape",
151 CreateSvxAccessibleShape
),
152 ShapeTypeDescriptor ( DRAWING_TABLE
, "com.sun.star.drawing.TableShape",
153 CreateSvxAccessibleShape
),
154 ShapeTypeDescriptor ( DRAWING_MEDIA
, "com.sun.star.drawing.MediaShape",
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: */