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 "accembedded.hxx"
35 : :
36 : : using namespace ::com::sun::star;
37 : : using namespace ::com::sun::star::lang;
38 : : using namespace ::com::sun::star::accessibility;
39 : : using ::rtl::OUString;
40 : :
41 : : const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextEmbeddedObject";
42 : : const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
43 : :
44 : 0 : SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
45 : : SwAccessibleMap* pInitMap,
46 : : const SwFlyFrm* pFlyFrm ) :
47 : 0 : SwAccessibleNoTextFrame( pInitMap, AccessibleRole::EMBEDDED_OBJECT, pFlyFrm )
48 : : {
49 : 0 : }
50 : :
51 : 0 : SwAccessibleEmbeddedObject::~SwAccessibleEmbeddedObject()
52 : : {
53 [ # # ]: 0 : }
54 : :
55 : 0 : OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
56 : : throw( uno::RuntimeException )
57 : : {
58 : 0 : return OUString(RTL_CONSTASCII_USTRINGPARAM(sImplementationName));
59 : : }
60 : :
61 : 0 : sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(
62 : : const ::rtl::OUString& sTestServiceName)
63 : : throw (uno::RuntimeException)
64 : : {
65 : : return sTestServiceName.equalsAsciiL( sServiceName,
66 : 0 : sizeof(sServiceName)-1 ) ||
67 : : sTestServiceName.equalsAsciiL( sAccessibleServiceName,
68 [ # # ][ # # ]: 0 : sizeof(sAccessibleServiceName)-1 );
69 : : }
70 : :
71 : 0 : uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames()
72 : : throw( uno::RuntimeException )
73 : : {
74 : 0 : uno::Sequence< OUString > aRet(2);
75 [ # # ]: 0 : OUString* pArray = aRet.getArray();
76 [ # # ]: 0 : pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sServiceName) );
77 [ # # ]: 0 : pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleServiceName) );
78 : 0 : return aRet;
79 : : }
80 : :
81 : : namespace
82 : : {
83 : : class theSwAccessibleEmbeddedObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleEmbeddedObjectImplementationId > {};
84 : : }
85 : :
86 : 0 : uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
87 : : throw(uno::RuntimeException)
88 : : {
89 : 0 : return theSwAccessibleEmbeddedObjectImplementationId::get().getSeq();
90 : : }
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|