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_HI_FACTORY_HXX
25 #define ADC_DISPLAY_HI_FACTORY_HXX
26 
27 
28 // USED SERVICES
29     // BASE CLASSES
30 #include <toolkit/htmlfactory.hxx>
31     // COMPONENTS
32     // PARAMETERS
33 #include <ary/stdconstiter.hxx>
34 #include <ary/idl/i_types4idl.hxx>
35 #include <toolkit/out_position.hxx>
36 
37 
38 namespace ary
39 {
40 namespace idl
41 {
42     class Module;
43 }
44 namespace doc
45 {
46     class OldIdlDocu;
47 }
48 }
49 
50 
51 class HtmlEnvironment_Idl;
52 class LinkHelper;
53 class HF_NaviSubRow;
54 class HF_TitleTable;
55 class HF_SubTitleTable;
56 
57 
58 class HtmlFactory_Idl : public HtmlFactory<HtmlEnvironment_Idl>
59 {
60   public:
61     enum E_MemberViewType
62     {
63         viewtype_summary,   // the summary of the members
64         viewtype_details,   // the details of the members
65         viewtype_complete   // everything
66     };
67 
68     enum E_DocType
69     {
70         doctype_summaryOnly,    // only the summary
71         doctype_complete        // the complete documentation
72     };
73 
74   public:
75     typedef ary::idl::CodeEntity                client;
76     typedef ary::idl::Ce_id                     ce_id;
77     typedef ary::idl::Type_id                   type_id;
78     typedef ary::doc::OldIdlDocu                ce_info;
79 
80     typedef ary::Dyn_StdConstIterator<ce_id>    dyn_ce_list;
81     typedef ary::Dyn_StdConstIterator<type_id>  dyn_type_list;
82     typedef ary::StdConstIterator<ce_id>        ce_list;
83     typedef ary::StdConstIterator<type_id>      type_list;
84 
85     typedef HtmlEnvironment_Idl                 Environment;
86     typedef output::Position                    OutPosition;
87 
88   protected:
HtmlFactory_Idl(Environment & io_rEnv,Xml::Element * o_pOut=0)89                         HtmlFactory_Idl(
90                             Environment &       io_rEnv,
91                             Xml::Element *      o_pOut = 0 )
92                             :   HtmlFactory<Environment>(io_rEnv, o_pOut)
93                             { }
~HtmlFactory_Idl()94     virtual             ~HtmlFactory_Idl() {}
95 
96     /** The default version only calls ->produce_InternalLink().
97         This may be overwritten by derived classes.
98     */
99     virtual void        produce_SummaryDeclaration(
100                             Xml::Element &      o_row,
101                             const client &      i_ce ) const;
102     void                produce_InternalLink(
103                             Xml::Element &      o_row,
104                             const client &      i_ce ) const;
105     void                produce_ShortDoc(
106                             Xml::Element &      o_row,
107                             const client &      i_ce ) const;
108 
109     // KORR_FUTURE: Does not belong here (implementation inheritance)!
110     void                produce_Bases(
111                                 Xml::Element &   o_screen,
112                                 const client &   i_ce,
113                                 const String &   i_sLabel ) const;
114     void                produce_Members(
115                             ce_list &               it_list,
116                             const String &          i_summaryTitle,
117                             const String &          i_summaryLabel,
118                             const String &          i_detailsTitle,
119                             const String &          i_detailsLabel,
120                             const E_MemberViewType  i_viewType = viewtype_complete ) const;
121 
122     void                produce_Title(
123                             HF_TitleTable &     o_title,
124                             const String &      i_label,
125                             const client &      i_ce ) const;
126     void                get_Annotations(
127                             StreamStr &         o_out,
128                             const client &      i_ce ) const;
129 
130     /// Writes complete docu in standard format.
131     void                write_Docu(
132                             Xml::Element &      o_screen,
133                             const client &      i_ce ) const;
134 
135     void                write_ManualLinks(
136                             Xml::Element &      o_screen,
137                             const client &      i_ce ) const;
138   private:
139     // Dummy does nothing
140     virtual void        produce_MemberDetails(
141                             HF_SubTitleTable &  o_table,
142                             const client &      i_ce ) const;
143     void                recursive_ShowBases(
144                             Xml::Element &      o_screen,
145                             type_id             i_baseType,
146                             int &               io_nDepth ) const;
baseOf(const client & i_ce) const147     type_id             baseOf(
148                             const client &      i_ce ) const
149                                                 { return inq_BaseOf(i_ce); }
150     virtual type_id     inq_BaseOf(
151                             const client &      i_ce ) const;
152 };
153 
154 
155 extern const String
156     C_sCellStyle_SummaryLeft;
157 extern const String
158     C_sCellStyle_SummaryRight;
159 extern const String
160     C_sCellStyle_MDetail;
161 extern const String
162     C_sMemberTitle;
163 
164 
165 #endif
166