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