Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <vcl/svapp.hxx>
30 : : #include <com/sun/star/accessibility/AccessibleRole.hpp>
31 : : #include <com/sun/star/uno/RuntimeException.hpp>
32 : : #include <comphelper/servicehelper.hxx>
33 : : #include <flyfrm.hxx>
34 : : #include "accgraphic.hxx"
35 : :
36 : : using namespace ::com::sun::star;
37 : : using namespace ::com::sun::star::lang;
38 : : using namespace ::com::sun::star::uno;
39 : : using namespace ::com::sun::star::accessibility;
40 : : using ::rtl::OUString;
41 : :
42 : : const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextGraphicObject";
43 : : const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleGraphic";
44 : :
45 : 2 : SwAccessibleGraphic::SwAccessibleGraphic(
46 : : SwAccessibleMap* pInitMap,
47 : : const SwFlyFrm* pFlyFrm ) :
48 : 2 : SwAccessibleNoTextFrame( pInitMap, AccessibleRole::GRAPHIC, pFlyFrm )
49 : : {
50 : 2 : }
51 : :
52 : 2 : SwAccessibleGraphic::~SwAccessibleGraphic()
53 : : {
54 [ - + ]: 4 : }
55 : :
56 : 2 : OUString SAL_CALL SwAccessibleGraphic::getImplementationName()
57 : : throw( RuntimeException )
58 : : {
59 : 2 : return OUString(RTL_CONSTASCII_USTRINGPARAM(sImplementationName));
60 : : }
61 : :
62 : 0 : sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(
63 : : const ::rtl::OUString& sTestServiceName)
64 : : throw (uno::RuntimeException)
65 : : {
66 : : return sTestServiceName.equalsAsciiL( sServiceName,
67 : 0 : sizeof(sServiceName)-1 ) ||
68 : : sTestServiceName.equalsAsciiL( sAccessibleServiceName,
69 [ # # ][ # # ]: 0 : sizeof(sAccessibleServiceName)-1 );
70 : : }
71 : :
72 : 0 : Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
73 : : throw( uno::RuntimeException )
74 : : {
75 : 0 : Sequence< OUString > aRet(2);
76 [ # # ]: 0 : OUString* pArray = aRet.getArray();
77 [ # # ]: 0 : pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sServiceName) );
78 [ # # ]: 0 : pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleServiceName) );
79 : 0 : return aRet;
80 : : }
81 : :
82 : : namespace
83 : : {
84 : : class theSwAccessibleGraphicImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleGraphicImplementationId > {};
85 : : }
86 : :
87 : 0 : Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
88 : : throw(RuntimeException)
89 : : {
90 : 0 : return theSwAccessibleGraphicImplementationId::get().getSeq();
91 : : }
92 : :
93 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|