xref: /aoo41x/main/autodoc/source/ary/inc/slots.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ARY_SLOTS_HXX
29 #define ARY_SLOTS_HXX
30 
31 
32 // USED SERVICES
33 	// BASE CLASSES
34 #include <ary/ceslot.hxx>
35 	// COMPONENTS
36 	// PARAMETERS
37 #include <ary/ary_disp.hxx>
38 #include <ary/types.hxx>
39 #include <ary/sequentialids.hxx>
40 #include <ary/cpp/c_types4cpp.hxx>
41 #include <ary/cpp/c_slntry.hxx>
42 
43 
44 
45 namespace ary
46 {
47 
48 
49 class Slot_Null : public Slot
50 {
51   public:
52 	virtual			   	~Slot_Null();
53 
54     virtual void        StoreAt(
55                             Display &           o_rDestination ) const;
56     virtual uintt       Size() const;
57 
58   private:
59     virtual void        StoreEntries(
60                             Display &           o_rDestination ) const;
61 };
62 
63 class Slot_MapLocalCe : public Slot
64 {
65   public:
66                         Slot_MapLocalCe(
67                             const cpp::Map_LocalCe & i_rData );
68 	virtual			   	~Slot_MapLocalCe();
69     virtual uintt       Size() const;
70 
71   private:
72     virtual void        StoreEntries(
73                             Display &           o_rDestination ) const;
74     // DATA
75     const cpp::Map_LocalCe *
76                         pData;
77 };
78 
79 class Slot_MapOperations : public Slot
80 {
81   public:
82                         Slot_MapOperations(
83                             const std::multimap<String, cpp::Ce_id> &
84                                                 i_rData );
85 	virtual			   	~Slot_MapOperations();
86     virtual uintt       Size() const;
87 
88   private:
89     virtual void        StoreEntries(
90                             Display &           o_rDestination ) const;
91     // DATA
92     const std::multimap<String, cpp::Ce_id> *
93                         pData;
94 };
95 
96 class Slot_ListLocalCe : public Slot
97 {
98   public:
99                         Slot_ListLocalCe(
100                             const cpp::List_LocalCe &
101                                                 i_rData );
102 	virtual			   	~Slot_ListLocalCe();
103 
104     virtual uintt       Size() const;
105 
106   private:
107     virtual void        StoreEntries(
108                             Display &           o_rDestination ) const;
109     // DATA
110     const cpp::List_LocalCe *
111                         pData;
112 };
113 
114 template <class ID>
115 class Slot_SequentialIds : public Slot
116 {
117   public:
118                         Slot_SequentialIds(
119                             const SequentialIds<ID> &
120                                                 i_rData )
121                             :   pData(&i_rData) {}
122 	virtual			   	~Slot_SequentialIds();
123 
124     virtual uintt       Size() const;
125 
126   private:
127     virtual void        StoreEntries(
128                             Display &           o_rDestination ) const;
129     // DATA
130     const SequentialIds<ID> *
131                         pData;
132 };
133 
134 
135 template <class ID>
136 Slot_SequentialIds<ID>::~Slot_SequentialIds()
137 {
138 }
139 
140 template <class ID>
141 uintt
142 Slot_SequentialIds<ID>::Size() const
143 {
144  	return pData->Size();
145 }
146 
147 template <class ID>
148 void
149 Slot_SequentialIds<ID>::StoreEntries( Display     & o_rDestination ) const
150 {
151 	for ( typename SequentialIds<ID>::const_iterator it = pData->Begin();
152 		  it != pData->End();
153 		  ++it )
154 	{
155 		o_rDestination.DisplaySlot_Rid( (*it).Value() );
156 	}
157 }
158 
159 
160 
161 
162 }   // namespace ary
163 #endif
164