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 __FRAMEWORK_UICONFIGURATION_GRAPHICNAMEACCESS_HXX_
25 #define __FRAMEWORK_UICONFIGURATION_GRAPHICNAMEACCESS_HXX_
26 
27 #include <stdtypes.h>
28 
29 //_________________________________________________________________________________________________________________
30 //	interface includes
31 //_________________________________________________________________________________________________________________
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HXX_
34 #include <com/sun/star/graphic/XGraphic.hpp>
35 #endif
36 #include <cppuhelper/implbase1.hxx>
37 
38 namespace framework
39 {
40     class GraphicNameAccess : public ::cppu::WeakImplHelper1< ::com::sun::star::container::XNameAccess >
41     {
42         public:
43             GraphicNameAccess();
44             virtual ~GraphicNameAccess();
45 
46             void addElement( const rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rElement );
47 
48             // XNameAccess
49 		    virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
50 			    throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException,
51 				    ::com::sun::star::uno::RuntimeException);
52 		    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
53 			    throw(::com::sun::star::uno::RuntimeException);
54 		    virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
55 			    throw(::com::sun::star::uno::RuntimeException);
56 
57 		    // XElementAccess
58 		    virtual sal_Bool SAL_CALL hasElements()
59 			    throw(::com::sun::star::uno::RuntimeException);
60 		    virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  )
61 			    throw(::com::sun::star::uno::RuntimeException);
62 
63         private:
64             typedef BaseHash< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > NameGraphicHashMap;
65             NameGraphicHashMap m_aNameToElementMap;
66             ::com::sun::star::uno::Sequence< rtl::OUString > m_aSeq;
67 	};
68 }
69 
70 #endif // __FRAMEWORK_UICONFIGURATION_GRAPHICNAMEACCESS_HXX_
71