Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / toolkit / source / awt / vclxpointer.cxx
blob316e4463845ab1a95f7a8f8bb957a6fa21986046
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <toolkit/awt/vclxpointer.hxx>
21 #include <toolkit/helper/macros.hxx>
22 #include <cppuhelper/typeprovider.hxx>
24 // ----------------------------------------------------
25 // class VCLXPointer
26 // ----------------------------------------------------
27 VCLXPointer::VCLXPointer()
31 VCLXPointer::~VCLXPointer()
35 // ::com::sun::star::uno::XInterface
36 ::com::sun::star::uno::Any VCLXPointer::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
38 ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
39 (static_cast< ::com::sun::star::awt::XPointer* >(this)),
40 (static_cast< ::com::sun::star::lang::XUnoTunnel* >(this)),
41 (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) );
42 return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
45 // ::com::sun::star::lang::XUnoTunnel
46 IMPL_XUNOTUNNEL( VCLXPointer )
48 // ::com::sun::star::lang::XTypeProvider
49 IMPL_XTYPEPROVIDER_START( VCLXPointer )
50 getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer>* ) NULL )
51 IMPL_XTYPEPROVIDER_END
53 void VCLXPointer::setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException)
55 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
57 maPointer = Pointer( (PointerStyle)nType );
60 sal_Int32 VCLXPointer::getType() throw(::com::sun::star::uno::RuntimeException)
62 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
64 return (sal_Int32)maPointer.GetStyle();
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */