update dev300-m58
[ooovba.git] / sw / source / core / access / accgraphic.cxx
blobb9f23015bf32ae15837fc6eb639809a7c1273df6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: accgraphic.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
35 #include <vcl/svapp.hxx>
36 #include <com/sun/star/accessibility/AccessibleRole.hpp>
37 #include <com/sun/star/uno/RuntimeException.hpp>
38 #include <rtl/uuid.h>
39 #include <flyfrm.hxx>
40 #include "accgraphic.hxx"
42 using namespace ::com::sun::star;
43 using namespace ::com::sun::star::lang;
44 using namespace ::com::sun::star::uno;
45 using namespace ::com::sun::star::accessibility;
46 using ::rtl::OUString;
48 const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextGraphicObject";
49 const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleGraphic";
51 SwAccessibleGraphic::SwAccessibleGraphic(
52 SwAccessibleMap* pInitMap,
53 const SwFlyFrm* pFlyFrm ) :
54 SwAccessibleNoTextFrame( pInitMap, AccessibleRole::GRAPHIC, pFlyFrm )
58 SwAccessibleGraphic::~SwAccessibleGraphic()
62 OUString SAL_CALL SwAccessibleGraphic::getImplementationName()
63 throw( RuntimeException )
65 return OUString(RTL_CONSTASCII_USTRINGPARAM(sImplementationName));
68 sal_Bool SAL_CALL SwAccessibleGraphic::supportsService(
69 const ::rtl::OUString& sTestServiceName)
70 throw (uno::RuntimeException)
72 return sTestServiceName.equalsAsciiL( sServiceName,
73 sizeof(sServiceName)-1 ) ||
74 sTestServiceName.equalsAsciiL( sAccessibleServiceName,
75 sizeof(sAccessibleServiceName)-1 );
78 Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
79 throw( uno::RuntimeException )
81 Sequence< OUString > aRet(2);
82 OUString* pArray = aRet.getArray();
83 pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sServiceName) );
84 pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleServiceName) );
85 return aRet;
88 Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
89 throw(RuntimeException)
91 vos::OGuard aGuard(Application::GetSolarMutex());
92 static Sequence< sal_Int8 > aId( 16 );
93 static sal_Bool bInit = sal_False;
94 if(!bInit)
96 rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
97 bInit = sal_True;
99 return aId;