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