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 INCLUDED_unotools_ITEMHOLDER1_HXX_
25 #define INCLUDED_unotools_ITEMHOLDER1_HXX_
26 
27 //-----------------------------------------------
28 // includes
29 
30 #include <unotools/itemholderbase.hxx>
31 #include <cppuhelper/implbase1.hxx>
32 #include <com/sun/star/lang/XEventListener.hpp>
33 
34 //-----------------------------------------------
35 // namespaces
36 
37 #ifdef css
38 #error "Cant use css as namespace alias."
39 #else
40 #define css ::com::sun::star
41 #endif
42 
43 //-----------------------------------------------
44 // definitions
45 
46 class ItemHolder1 : private ItemHolderMutexBase
47                   , public  ::cppu::WeakImplHelper1< css::lang::XEventListener >
48 {
49     //...........................................
50     // member
51     private:
52 
53         TItems m_lItems;
54 
55     //...........................................
56     // c++ interface
57     public:
58 
59         ItemHolder1();
60         virtual ~ItemHolder1();
61         static void holdConfigItem(EItem eItem);
62 
63     //...........................................
64     // uno interface
65     public:
66 
67         virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
68             throw(css::uno::RuntimeException);
69 
70     //...........................................
71     // helper
72     private:
73 
74         void impl_addItem(EItem eItem);
75         void impl_releaseAllItems();
76         void impl_newItem(TItemInfo& rItem);
77         void impl_deleteItem(TItemInfo& rItem);
78 };
79 
80 //-----------------------------------------------
81 // namespaces
82 
83 #undef css
84 
85 #endif // INCLUDED_unotools_ITEMHOLDER1_HXX_
86