Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #include "SdShapeTypes.hxx"
22 : #include "AccessiblePresentationShape.hxx"
23 : #include "AccessiblePresentationGraphicShape.hxx"
24 : #include "AccessiblePresentationOLEShape.hxx"
25 : #include <rtl/ustring.hxx>
26 :
27 : namespace accessibility {
28 :
29 : AccessibleShape*
30 0 : CreateSdAccessibleShape (
31 : const AccessibleShapeInfo& rShapeInfo,
32 : const AccessibleShapeTreeInfo& rShapeTreeInfo,
33 : ShapeTypeId nId)
34 : {
35 0 : switch (nId)
36 : {
37 : case PRESENTATION_TITLE:
38 : case PRESENTATION_OUTLINER:
39 : case PRESENTATION_SUBTITLE:
40 : case PRESENTATION_PAGE:
41 : case PRESENTATION_NOTES:
42 : case PRESENTATION_HANDOUT:
43 : case PRESENTATION_HEADER:
44 : case PRESENTATION_FOOTER:
45 : case PRESENTATION_DATETIME:
46 : case PRESENTATION_PAGENUMBER:
47 0 : return new AccessiblePresentationShape (rShapeInfo, rShapeTreeInfo);
48 :
49 : case PRESENTATION_GRAPHIC_OBJECT:
50 0 : return new AccessiblePresentationGraphicShape (rShapeInfo, rShapeTreeInfo);
51 :
52 : case PRESENTATION_OLE:
53 : case PRESENTATION_CHART:
54 : case PRESENTATION_TABLE:
55 0 : return new AccessiblePresentationOLEShape (rShapeInfo, rShapeTreeInfo);
56 :
57 : default:
58 0 : return new AccessibleShape (rShapeInfo, rShapeTreeInfo);
59 : }
60 : }
61 :
62 16 : void RegisterImpressShapeTypes (void)
63 : {
64 : /** List of shape type descriptors corresponding to the
65 : <type>SdShapeTypes</type> enum.
66 : */
67 : ShapeTypeDescriptor aSdShapeTypeList[] = {
68 : ShapeTypeDescriptor (
69 : PRESENTATION_OUTLINER,
70 : "com.sun.star.presentation.OutlinerShape",
71 : CreateSdAccessibleShape ),
72 : ShapeTypeDescriptor (
73 : PRESENTATION_SUBTITLE,
74 : "com.sun.star.presentation.SubtitleShape",
75 : CreateSdAccessibleShape ),
76 : ShapeTypeDescriptor (
77 : PRESENTATION_GRAPHIC_OBJECT,
78 : "com.sun.star.presentation.GraphicObjectShape",
79 : CreateSdAccessibleShape ),
80 : ShapeTypeDescriptor (
81 : PRESENTATION_PAGE,
82 : "com.sun.star.presentation.PageShape",
83 : CreateSdAccessibleShape ),
84 : ShapeTypeDescriptor (
85 : PRESENTATION_OLE,
86 : "com.sun.star.presentation.OLE2Shape",
87 : CreateSdAccessibleShape ),
88 : ShapeTypeDescriptor (
89 : PRESENTATION_CHART,
90 : "com.sun.star.presentation.ChartShape",
91 : CreateSdAccessibleShape ),
92 : ShapeTypeDescriptor (
93 : PRESENTATION_TABLE,
94 : "com.sun.star.presentation.TableShape",
95 : CreateSdAccessibleShape ),
96 : ShapeTypeDescriptor (
97 : PRESENTATION_NOTES,
98 : "com.sun.star.presentation.NotesShape",
99 : CreateSdAccessibleShape ),
100 : ShapeTypeDescriptor (
101 : PRESENTATION_TITLE,
102 : "com.sun.star.presentation.TitleTextShape",
103 : CreateSdAccessibleShape ),
104 : ShapeTypeDescriptor (
105 : PRESENTATION_HANDOUT,
106 : "com.sun.star.presentation.HandoutShape",
107 : CreateSdAccessibleShape ),
108 : ShapeTypeDescriptor (
109 : PRESENTATION_HEADER,
110 : "com.sun.star.presentation.HeaderShape",
111 : CreateSdAccessibleShape ),
112 : ShapeTypeDescriptor (
113 : PRESENTATION_FOOTER,
114 : "com.sun.star.presentation.FooterShape",
115 : CreateSdAccessibleShape ),
116 : ShapeTypeDescriptor (
117 : PRESENTATION_DATETIME,
118 : "com.sun.star.presentation.DateTimeShape",
119 : CreateSdAccessibleShape ),
120 : ShapeTypeDescriptor (
121 : PRESENTATION_PAGENUMBER,
122 : "com.sun.star.presentation.SlideNumberShape",
123 : CreateSdAccessibleShape )
124 240 : };
125 :
126 16 : ShapeTypeHandler::Instance().AddShapeTypeList (
127 : PRESENTATION_PAGENUMBER - PRESENTATION_OUTLINER + 1,
128 240 : aSdShapeTypeList);
129 16 : }
130 :
131 : } // end of namespace accessibility
132 :
133 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|