Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / svx / source / accessibility / SvxShapeTypes.cxx
blob1f1346a8e27e7d5fa6bf02eb6cb4ad36ce382344
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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,
33 ShapeTypeId nId)
35 switch (nId)
37 case DRAWING_3D_CUBE:
38 case DRAWING_3D_EXTRUDE:
39 case DRAWING_3D_LATHE:
40 case DRAWING_3D_SCENE:
41 case DRAWING_3D_SPHERE:
42 case DRAWING_CAPTION:
43 case DRAWING_CLOSED_BEZIER:
44 case DRAWING_CLOSED_FREEHAND:
45 case DRAWING_CONNECTOR:
46 case DRAWING_ELLIPSE:
47 case DRAWING_GROUP:
48 case DRAWING_LINE:
49 case DRAWING_MEASURE:
50 case DRAWING_OPEN_BEZIER:
51 case DRAWING_OPEN_FREEHAND:
52 case DRAWING_PAGE:
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:
58 case DRAWING_TEXT:
59 // Default accessiblility shape for
60 // com::sun::star::drawing::CustomShape (#i37790#)
61 case DRAWING_CUSTOM:
62 // Default accessiblility shape for
63 // com::sun::star::drawing::MediaShape (#i85429#)
64 case DRAWING_MEDIA:
65 return new AccessibleShape (rShapeInfo, rShapeTreeInfo);
67 case DRAWING_CONTROL:
68 return new AccessibleControlShape (rShapeInfo, rShapeTreeInfo);
70 case DRAWING_GRAPHIC_OBJECT:
71 return new AccessibleGraphicShape (rShapeInfo, rShapeTreeInfo);
73 case DRAWING_APPLET:
74 case DRAWING_FRAME:
75 case DRAWING_OLE:
76 case DRAWING_PLUGIN:
77 return new AccessibleOLEShape (rShapeInfo, rShapeTreeInfo);
79 case DRAWING_TABLE:
80 return new AccessibleTableShape( rShapeInfo, rShapeTreeInfo );
82 default:
83 return NULL;
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: */