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 #ifndef _TOOLKIT_AWT_VCLXPOINTER_HXX_ 25 #define _TOOLKIT_AWT_VCLXPOINTER_HXX_ 26 27 28 #include <com/sun/star/awt/XPointer.hpp> 29 #include <com/sun/star/lang/XTypeProvider.hpp> 30 #include <com/sun/star/lang/XUnoTunnel.hpp> 31 #include <cppuhelper/weak.hxx> 32 #include <osl/mutex.hxx> 33 34 #include <vcl/pointr.hxx> 35 36 // ---------------------------------------------------- 37 // class VCLXPointer 38 // ---------------------------------------------------- 39 40 class VCLXPointer : public ::com::sun::star::awt::XPointer, 41 public ::com::sun::star::lang::XTypeProvider, 42 public ::com::sun::star::lang::XUnoTunnel, 43 public ::cppu::OWeakObject 44 { 45 private: 46 ::osl::Mutex maMutex; 47 Pointer maPointer; 48 49 protected: GetMutex()50 ::osl::Mutex& GetMutex() { return maMutex; } 51 52 public: 53 VCLXPointer(); 54 ~VCLXPointer(); 55 GetPointer() const56 const Pointer& GetPointer() const { return maPointer; } 57 58 // ::com::sun::star::uno::XInterface 59 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); acquire()60 void SAL_CALL acquire() throw() { OWeakObject::acquire(); } release()61 void SAL_CALL release() throw() { OWeakObject::release(); } 62 63 // ::com::sun::star::lang::XUnoTunnel 64 static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); 65 static VCLXPointer* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); 66 sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); 67 68 // ::com::sun::star::lang::XTypeProvider 69 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); 70 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); 71 72 // ::com::sun::star::awt::XPointer 73 void SAL_CALL setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException); 74 sal_Int32 SAL_CALL getType( ) throw(::com::sun::star::uno::RuntimeException); 75 }; 76 77 78 79 80 #endif // _TOOLKIT_AWT_VCLXPOINTER_HXX_ 81 82