1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_toolkit.hxx"
26 
27 
28 #include <toolkit/awt/vclxpointer.hxx>
29 #include <toolkit/helper/macros.hxx>
30 #include <cppuhelper/typeprovider.hxx>
31 
32 //	----------------------------------------------------
33 //	class VCLXPointer
34 //	----------------------------------------------------
VCLXPointer()35 VCLXPointer::VCLXPointer()
36 {
37 }
38 
~VCLXPointer()39 VCLXPointer::~VCLXPointer()
40 {
41 }
42 
43 // ::com::sun::star::uno::XInterface
queryInterface(const::com::sun::star::uno::Type & rType)44 ::com::sun::star::uno::Any VCLXPointer::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
45 {
46 	::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
47 										SAL_STATIC_CAST( ::com::sun::star::awt::XPointer*, this ),
48 										SAL_STATIC_CAST( ::com::sun::star::lang::XUnoTunnel*, this ),
49 										SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
50 	return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
51 }
52 
53 // ::com::sun::star::lang::XUnoTunnel
54 IMPL_XUNOTUNNEL( VCLXPointer )
55 
56 // ::com::sun::star::lang::XTypeProvider
IMPL_XTYPEPROVIDER_START(VCLXPointer)57 IMPL_XTYPEPROVIDER_START( VCLXPointer )
58 	getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer>* ) NULL )
59 IMPL_XTYPEPROVIDER_END
60 
61 void VCLXPointer::setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException)
62 {
63 	::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
64 
65 	maPointer = Pointer( (PointerStyle)nType );
66 }
67 
getType()68 sal_Int32 VCLXPointer::getType() throw(::com::sun::star::uno::RuntimeException)
69 {
70 	::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
71 
72 	return (sal_Int32)maPointer.GetStyle();
73 }
74 
75 
76 
77