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 ADC_DISPLAY_HTML_HD_CHLST_HXX
29 #define ADC_DISPLAY_HTML_HD_CHLST_HXX
30 
31 // BASE CLASSES
32 #include <ary/ary_disp.hxx>
33 #include <cosv/tpl/processor.hxx>
34 
35 // USED SERVICES
36 #include <ary/cpp/c_types4cpp.hxx>
37 #include "hdimpl.hxx"
38 
39 
40 
41 namespace ary
42 {
43     namespace cpp
44     {
45         class Namespace;
46         class Class;
47         class Enum;
48         class Typedef;
49         class Function;
50         class Variable;
51         class EnumValue;
52     }
53     namespace info
54     {
55         class DocuText;
56     }
57 }
58 
59 class Docu_Display;
60 class ProtectionArea;
61 
62 class ChildList_Display : public ary::Display,
63                           public csv::ConstProcessor<ary::cpp::Namespace>,
64                           public csv::ConstProcessor<ary::cpp::Class>,
65                           public csv::ConstProcessor<ary::cpp::Enum>,
66                           public csv::ConstProcessor<ary::cpp::Typedef>,
67                           public csv::ConstProcessor<ary::cpp::Function>,
68                           public csv::ConstProcessor<ary::cpp::Variable>,
69                           public csv::ConstProcessor<ary::cpp::EnumValue>,
70                           private HtmlDisplay_Impl
71 {
72   public:
73     struct Area_Result
74     {
75         bool &              rChildrenExist;
76         csi::xml::Element & rOut;
77 
78                             Area_Result(
79                                 bool &                  o_rChildrenExist,
80                                 csi::xml::Element &     o_rOut )
81                                 :   rChildrenExist(o_rChildrenExist),
82                                     rOut(o_rOut) {}
83     };
84 
85 
86 						ChildList_Display(
87                             OuputPage_Environment &
88                                                 io_rEnv );
89 						ChildList_Display(
90                             OuputPage_Environment &
91                                                 io_rEnv,
92                             const ary::cpp::Class &
93                                                 i_rClass );
94 						ChildList_Display(
95                             OuputPage_Environment &
96                                                 io_rEnv,
97                             const ary::cpp::Enum &
98                                                 i_rEnum );
99 
100 	virtual				~ChildList_Display();
101 
102     void                Run_Simple(
103                             Area_Result &       o_rResult,
104                             ary::SlotAccessId   i_nSlot,
105                             const char *        i_sListLabel,
106                             const char *        i_sListTitle );
107     void                Run_GlobalClasses(
108                             Area_Result &       o_rResult,
109                             ary::SlotAccessId   i_nSlot,
110                             const char *        i_sListLabel,
111                             const char *        i_sListTitle,
112                             ary::cpp::E_ClassKey
113                                                 i_eFilter );
114     void                Run_Members(
115                             Area_Result &       o_rResult_public,
116                             Area_Result &       o_rResult_protected,
117                             Area_Result &       o_rResult_private,
118                             ary::SlotAccessId   i_nSlot,
119                             const char *        i_sListLabel_public,
120                             const char *        i_sListLabel_protected,
121                             const char *        i_sListLabel_private,
122                             const char *        i_sListTitle );
123     void                Run_MemberClasses(
124                             Area_Result &       o_rResult_public,
125                             Area_Result &       o_rResult_protected,
126                             Area_Result &       o_rResult_private,
127                             ary::SlotAccessId   i_nSlot,
128                             const char *        i_sListLabel_public,
129                             const char *        i_sListLabel_protected,
130                             const char *        i_sListLabel_private,
131                             const char *        i_sListTitle,
132                             ary::cpp::E_ClassKey
133                                                 i_eFilter );
134   private:
135     // Interface csv::ConstProcessor<>:
136 	virtual void	  	do_Process(
137                             const ary::cpp::Namespace &
138                                                 i_rData );
139     /** i_rData is shown only, if it passes two filters:
140         it must have the right protection, checked with pFilter,
141         and the right class key (class,struct,union), checked with
142         pClassFilter. A not exsting filter allows i_rData to be
143         displayed.
144     */
145 	virtual void	  	do_Process(
146 							const ary::cpp::Class &
147 												i_rData );
148 	virtual void	  	do_Process(
149 							const ary::cpp::Enum &
150 												i_rData );
151 	virtual void	  	do_Process(
152 							const ary::cpp::Typedef &
153 												i_rData );
154 	virtual void	  	do_Process(
155 							const ary::cpp::Function &
156 												i_rData );
157 	virtual void	  	do_Process(
158 							const ary::cpp::Variable &
159 												i_rData );
160 	virtual void	  	do_Process(
161                             const ary::cpp::EnumValue &
162                                                 i_rData );
163   private:
164     // Interface ary::Display:
165     virtual void        do_StartSlot();
166     virtual void        do_FinishSlot();
167     virtual const ary::cpp::Gate *
168                         inq_Get_ReFinder() const;
169     // Locals
170     struct S_AreaCo;
171     void                Write_ListItem(
172                             const String &      i_sLeftText,
173                             const char *        i_sLink,
174                             const ary::info::DocuText &
175                                                 i_rRightText,
176                             csi::xml::Element & rOut );
177     const ary::AryGroup &
178                         ActiveParent();
179     ProtectionArea &    GetArea();
180     ProtectionArea &    GetArea(
181                             ary::cpp::E_Protection
182                                                 i_eProtection );
183     void                SetClassesFilter(
184                             ary::cpp::E_ClassKey
185                                                 i_eFilter )
186                                                 { peClassesFilter = new ary::cpp::E_ClassKey(i_eFilter); }
187     void                UnsetClassesFilter()    { peClassesFilter = 0; }
188 
189     // DATA
190     Dyn<Docu_Display>   pShortDocu_Display;
191     const ary::cpp::Class *
192                         pActiveParentClass;
193     const ary::cpp::Enum *
194                         pActiveParentEnum;
195 
196     Dyn<S_AreaCo>       pSglArea;
197     Dyn<S_AreaCo>       aMemberAreas[3];
198 
199     Dyn<ary::cpp::E_ClassKey>
200                         peClassesFilter;
201 };
202 
203 
204 
205 
206 #endif
207