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 _STOC_TDMGR_TDENUMERATION_HXX 25 #define _STOC_TDMGR_TDENUMERATION_HXX 26 27 #include <stack> 28 #include <osl/mutex.hxx> 29 #include <com/sun/star/reflection/XTypeDescriptionEnumeration.hpp> 30 #include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp> 31 #include <cppuhelper/implbase1.hxx> 32 33 namespace stoc_tdmgr 34 { 35 36 typedef std::stack< com::sun::star::uno::Reference< 37 com::sun::star::reflection::XTypeDescriptionEnumerationAccess > > 38 TDEnumerationAccessStack; 39 40 class TypeDescriptionEnumerationImpl 41 : public cppu::WeakImplHelper1< 42 com::sun::star::reflection::XTypeDescriptionEnumeration > 43 { 44 public: 45 TypeDescriptionEnumerationImpl( 46 const rtl::OUString & rModuleName, 47 const com::sun::star::uno::Sequence< 48 com::sun::star::uno::TypeClass > & rTypes, 49 com::sun::star::reflection::TypeDescriptionSearchDepth eDepth, 50 const TDEnumerationAccessStack & rTDEAS ); 51 virtual ~TypeDescriptionEnumerationImpl(); 52 53 // XEnumeration (base of XTypeDescriptionEnumeration) 54 virtual sal_Bool SAL_CALL hasMoreElements(); 55 virtual ::com::sun::star::uno::Any SAL_CALL nextElement(); 56 57 // XTypeDescriptionEnumeration 58 virtual ::com::sun::star::uno::Reference< 59 ::com::sun::star::reflection::XTypeDescription > SAL_CALL 60 nextTypeDescription(); 61 62 private: 63 com::sun::star::uno::Reference< 64 com::sun::star::reflection::XTypeDescriptionEnumeration > 65 queryCurrentChildEnumeration(); 66 67 osl::Mutex m_aMutex; 68 rtl::OUString m_aModuleName; 69 com::sun::star::uno::Sequence< com::sun::star::uno::TypeClass > m_aTypes; 70 com::sun::star::reflection::TypeDescriptionSearchDepth m_eDepth; 71 TDEnumerationAccessStack m_aChildren; 72 com::sun::star::uno::Reference< 73 com::sun::star::reflection::XTypeDescriptionEnumeration > m_xEnum; 74 }; 75 76 } // namespace stoc_tdmgr 77 78 #endif /* _STOC_TDMGR_TDENUMERATION_HXX */ 79