1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26
27 #include "SdShapeTypes.hxx"
28 #include "AccessiblePresentationShape.hxx"
29 #include "AccessiblePresentationGraphicShape.hxx"
30 #include "AccessiblePresentationOLEShape.hxx"
31 #include <rtl/ustring.h>
32
33 namespace accessibility {
34
35 AccessibleShape*
CreateSdAccessibleShape(const AccessibleShapeInfo & rShapeInfo,const AccessibleShapeTreeInfo & rShapeTreeInfo,ShapeTypeId nId)36 CreateSdAccessibleShape (
37 const AccessibleShapeInfo& rShapeInfo,
38 const AccessibleShapeTreeInfo& rShapeTreeInfo,
39 ShapeTypeId nId)
40 {
41 switch (nId)
42 {
43 case PRESENTATION_TITLE:
44 case PRESENTATION_OUTLINER:
45 case PRESENTATION_SUBTITLE:
46 case PRESENTATION_PAGE:
47 case PRESENTATION_NOTES:
48 case PRESENTATION_HANDOUT:
49 case PRESENTATION_HEADER:
50 case PRESENTATION_FOOTER:
51 case PRESENTATION_DATETIME:
52 case PRESENTATION_PAGENUMBER:
53 return new AccessiblePresentationShape (rShapeInfo, rShapeTreeInfo);
54
55 case PRESENTATION_GRAPHIC_OBJECT:
56 return new AccessiblePresentationGraphicShape (rShapeInfo, rShapeTreeInfo);
57
58 case PRESENTATION_OLE:
59 case PRESENTATION_CHART:
60 case PRESENTATION_TABLE:
61 return new AccessiblePresentationOLEShape (rShapeInfo, rShapeTreeInfo);
62
63 default:
64 return new AccessibleShape (rShapeInfo, rShapeTreeInfo);
65 }
66 }
67
68
69
70
71 ShapeTypeDescriptor aSdShapeTypeList[] = {
72 ShapeTypeDescriptor (
73 PRESENTATION_OUTLINER,
74 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.OutlinerShape"),
75 CreateSdAccessibleShape ),
76 ShapeTypeDescriptor (
77 PRESENTATION_SUBTITLE,
78 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.SubtitleShape"),
79 CreateSdAccessibleShape ),
80 ShapeTypeDescriptor (
81 PRESENTATION_GRAPHIC_OBJECT,
82 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.GraphicObjectShape"),
83 CreateSdAccessibleShape ),
84 ShapeTypeDescriptor (
85 PRESENTATION_PAGE,
86 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.PageShape"),
87 CreateSdAccessibleShape ),
88 ShapeTypeDescriptor (
89 PRESENTATION_OLE,
90 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.OLE2Shape"),
91 CreateSdAccessibleShape ),
92 ShapeTypeDescriptor (
93 PRESENTATION_CHART,
94 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.ChartShape"),
95 CreateSdAccessibleShape ),
96 ShapeTypeDescriptor (
97 PRESENTATION_TABLE,
98 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.TableShape"),
99 CreateSdAccessibleShape ),
100 ShapeTypeDescriptor (
101 PRESENTATION_NOTES,
102 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.NotesShape"),
103 CreateSdAccessibleShape ),
104 ShapeTypeDescriptor (
105 PRESENTATION_TITLE,
106 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.TitleTextShape"),
107 CreateSdAccessibleShape ),
108 ShapeTypeDescriptor (
109 PRESENTATION_HANDOUT,
110 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.HandoutShape"),
111 CreateSdAccessibleShape ),
112 ShapeTypeDescriptor (
113 PRESENTATION_HEADER,
114 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.HeaderShape"),
115 CreateSdAccessibleShape ),
116 ShapeTypeDescriptor (
117 PRESENTATION_FOOTER,
118 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.FooterShape"),
119 CreateSdAccessibleShape ),
120 ShapeTypeDescriptor (
121 PRESENTATION_DATETIME,
122 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.DateTimeShape"),
123 CreateSdAccessibleShape ),
124 ShapeTypeDescriptor (
125 PRESENTATION_PAGENUMBER,
126 ::rtl::OUString::createFromAscii ("com.sun.star.presentation.SlideNumberShape"),
127 CreateSdAccessibleShape )
128 };
129
130
131
132
RegisterImpressShapeTypes(void)133 void RegisterImpressShapeTypes (void)
134 {
135 ShapeTypeHandler::Instance().AddShapeTypeList (
136 PRESENTATION_PAGENUMBER - PRESENTATION_OUTLINER + 1,
137 aSdShapeTypeList);
138 }
139
140
141
142
143 } // end of namespace accessibility
144