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 <AccessibleTableShape.hxx>
28 namespace accessibility
{
30 AccessibleShape
* CreateSvxAccessibleShape (
31 const AccessibleShapeInfo
& rShapeInfo
,
32 const AccessibleShapeTreeInfo
& rShapeTreeInfo
,
38 case DRAWING_3D_EXTRUDE
:
39 case DRAWING_3D_LATHE
:
40 case DRAWING_3D_SCENE
:
41 case DRAWING_3D_SPHERE
:
43 case DRAWING_CLOSED_BEZIER
:
44 case DRAWING_CLOSED_FREEHAND
:
45 case DRAWING_CONNECTOR
:
50 case DRAWING_OPEN_BEZIER
:
51 case DRAWING_OPEN_FREEHAND
:
53 case DRAWING_POLY_POLYGON
:
54 case DRAWING_POLY_LINE
:
55 case DRAWING_POLY_POLYGON_PATH
:
56 case DRAWING_POLY_LINE_PATH
:
57 case DRAWING_RECTANGLE
:
59 // Default accessiblility shape for
60 // com::sun::star::drawing::CustomShape (#i37790#)
62 // Default accessiblility shape for
63 // com::sun::star::drawing::MediaShape (#i85429#)
65 return new AccessibleShape (rShapeInfo
, rShapeTreeInfo
);
68 return new AccessibleControlShape (rShapeInfo
, rShapeTreeInfo
);
70 case DRAWING_GRAPHIC_OBJECT
:
71 return new AccessibleGraphicShape (rShapeInfo
, rShapeTreeInfo
);
77 return new AccessibleOLEShape (rShapeInfo
, rShapeTreeInfo
);
80 return new AccessibleTableShape( rShapeInfo
, rShapeTreeInfo
);
87 void RegisterDrawShapeTypes (void)
89 /** List of shape type descriptors corresponding to the
90 <type>SvxShapeTypes</type> enum.
92 ShapeTypeDescriptor aSvxShapeTypeList
[] = {
93 ShapeTypeDescriptor ( DRAWING_TEXT
, "com.sun.star.drawing.TextShape",
94 CreateSvxAccessibleShape
),
95 ShapeTypeDescriptor (DRAWING_RECTANGLE
, "com.sun.star.drawing.RectangleShape",
96 CreateSvxAccessibleShape
),
97 ShapeTypeDescriptor ( DRAWING_ELLIPSE
, "com.sun.star.drawing.EllipseShape",
98 CreateSvxAccessibleShape
),
99 ShapeTypeDescriptor ( DRAWING_CONTROL
, "com.sun.star.drawing.ControlShape",
100 CreateSvxAccessibleShape
),
101 ShapeTypeDescriptor ( DRAWING_CONNECTOR
, "com.sun.star.drawing.ConnectorShape",
102 CreateSvxAccessibleShape
),
103 ShapeTypeDescriptor ( DRAWING_MEASURE
, "com.sun.star.drawing.MeasureShape",
104 CreateSvxAccessibleShape
),
105 ShapeTypeDescriptor ( DRAWING_LINE
, "com.sun.star.drawing.LineShape",
106 CreateSvxAccessibleShape
),
107 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON
, "com.sun.star.drawing.PolyPolygonShape",
108 CreateSvxAccessibleShape
),
109 ShapeTypeDescriptor ( DRAWING_POLY_LINE
, "com.sun.star.drawing.PolyLineShape",
110 CreateSvxAccessibleShape
),
111 ShapeTypeDescriptor ( DRAWING_OPEN_BEZIER
, "com.sun.star.drawing.OpenBezierShape",
112 CreateSvxAccessibleShape
),
113 ShapeTypeDescriptor ( DRAWING_CLOSED_BEZIER
, "com.sun.star.drawing.ClosedBezierShape",
114 CreateSvxAccessibleShape
),
115 ShapeTypeDescriptor ( DRAWING_OPEN_FREEHAND
, "com.sun.star.drawing.OpenFreeHandShape",
116 CreateSvxAccessibleShape
),
117 ShapeTypeDescriptor ( DRAWING_CLOSED_FREEHAND
, "com.sun.star.drawing.ClosedFreeHandShape",
118 CreateSvxAccessibleShape
),
119 ShapeTypeDescriptor ( DRAWING_POLY_POLYGON_PATH
, "com.sun.star.drawing.PolyPolygonPathShape",
120 CreateSvxAccessibleShape
),
121 ShapeTypeDescriptor ( DRAWING_POLY_LINE_PATH
, "com.sun.star.drawing.PolyLinePathShape",
122 CreateSvxAccessibleShape
),
123 ShapeTypeDescriptor ( DRAWING_GRAPHIC_OBJECT
, "com.sun.star.drawing.GraphicObjectShape",
124 CreateSvxAccessibleShape
),
125 ShapeTypeDescriptor ( DRAWING_GROUP
, "com.sun.star.drawing.GroupShape",
126 CreateSvxAccessibleShape
),
127 ShapeTypeDescriptor ( DRAWING_OLE
, "com.sun.star.drawing.OLE2Shape",
128 CreateSvxAccessibleShape
),
129 ShapeTypeDescriptor ( DRAWING_PAGE
, "com.sun.star.drawing.PageShape",
130 CreateSvxAccessibleShape
),
131 ShapeTypeDescriptor ( DRAWING_CAPTION
, "com.sun.star.drawing.CaptionShape",
132 CreateSvxAccessibleShape
),
133 ShapeTypeDescriptor ( DRAWING_FRAME
, "com.sun.star.drawing.FrameShape",
134 CreateSvxAccessibleShape
),
135 ShapeTypeDescriptor ( DRAWING_PLUGIN
, "com.sun.star.drawing.PluginShape",
136 CreateSvxAccessibleShape
),
137 ShapeTypeDescriptor ( DRAWING_APPLET
, "com.sun.star.drawing.AppletShape",
138 CreateSvxAccessibleShape
),
139 ShapeTypeDescriptor ( DRAWING_3D_SCENE
, "com.sun.star.drawing.Shape3DSceneObject",
140 CreateSvxAccessibleShape
),
141 ShapeTypeDescriptor ( DRAWING_3D_CUBE
, "com.sun.star.drawing.Shape3DCubeObject",
142 CreateSvxAccessibleShape
),
143 ShapeTypeDescriptor ( DRAWING_3D_SPHERE
, "com.sun.star.drawing.Shape3DSphereObject",
144 CreateSvxAccessibleShape
),
145 ShapeTypeDescriptor ( DRAWING_3D_LATHE
, "com.sun.star.drawing.Shape3DLatheObject",
146 CreateSvxAccessibleShape
),
147 ShapeTypeDescriptor ( DRAWING_3D_EXTRUDE
, "com.sun.star.drawing.Shape3DExtrudeObject",
148 CreateSvxAccessibleShape
),
149 ShapeTypeDescriptor ( DRAWING_CUSTOM
, "com.sun.star.drawing.CustomShape",
150 CreateSvxAccessibleShape
),
151 ShapeTypeDescriptor ( DRAWING_TABLE
, "com.sun.star.drawing.TableShape",
152 CreateSvxAccessibleShape
),
153 ShapeTypeDescriptor ( DRAWING_MEDIA
, "com.sun.star.drawing.MediaShape",
154 CreateSvxAccessibleShape
),
158 // Crash while inserting callout with activated accesibility (#i37790#)
159 ShapeTypeHandler::Instance().AddShapeTypeList ( DRAWING_END
, aSvxShapeTypeList
);
162 } // end of namespace accessibility
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */