merge the formfield patch from ooo-build
[ooovba.git] / sw / source / core / access / accembedded.cxx
blob857c80b9eaba3661da34e5794c4136fc70620afe
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: accembedded.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 "accembedded.hxx"
42 using namespace ::com::sun::star;
43 using namespace ::com::sun::star::lang;
44 using namespace ::com::sun::star::accessibility;
45 using ::rtl::OUString;
47 const sal_Char sServiceName[] = "com.sun.star.text.AccessibleTextEmbeddedObject";
48 const sal_Char sImplementationName[] = "com.sun.star.comp.Writer.SwAccessibleEmbeddedObject";
50 SwAccessibleEmbeddedObject::SwAccessibleEmbeddedObject(
51 SwAccessibleMap* pInitMap,
52 const SwFlyFrm* pFlyFrm ) :
53 SwAccessibleNoTextFrame( pInitMap, AccessibleRole::EMBEDDED_OBJECT, pFlyFrm )
57 SwAccessibleEmbeddedObject::~SwAccessibleEmbeddedObject()
61 OUString SAL_CALL SwAccessibleEmbeddedObject::getImplementationName()
62 throw( uno::RuntimeException )
64 return OUString(RTL_CONSTASCII_USTRINGPARAM(sImplementationName));
67 sal_Bool SAL_CALL SwAccessibleEmbeddedObject::supportsService(
68 const ::rtl::OUString& sTestServiceName)
69 throw (uno::RuntimeException)
71 return sTestServiceName.equalsAsciiL( sServiceName,
72 sizeof(sServiceName)-1 ) ||
73 sTestServiceName.equalsAsciiL( sAccessibleServiceName,
74 sizeof(sAccessibleServiceName)-1 );
77 uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServiceNames()
78 throw( uno::RuntimeException )
80 uno::Sequence< OUString > aRet(2);
81 OUString* pArray = aRet.getArray();
82 pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sServiceName) );
83 pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleServiceName) );
84 return aRet;
88 uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
89 throw(uno::RuntimeException)
91 vos::OGuard aGuard(Application::GetSolarMutex());
92 static uno::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;