xref: /trunk/main/framework/inc/uiconfiguration/graphicnameaccess.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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             virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames();
51             virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName );
52 
53             // XElementAccess
54             virtual sal_Bool SAL_CALL hasElements();
55             virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  );
56 
57         private:
58             typedef BaseHash< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > NameGraphicHashMap;
59             NameGraphicHashMap m_aNameToElementMap;
60             ::com::sun::star::uno::Sequence< rtl::OUString > m_aSeq;
61     };
62 }
63 
64 #endif // __FRAMEWORK_UICONFIGURATION_GRAPHICNAMEACCESS_HXX_
65