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_NAVIBAR_HXX
25 #define ADC_DISPLAY_HTML_NAVIBAR_HXX
26 
27 // BASE CLASSES
28 #include "hdimpl.hxx"
29 
30 namespace ary
31 {
32 namespace cpp
33 {
34     class CodeEntity;
35 }
36 namespace loc
37 {
38     class File;
39 }
40 }
41 
42 
43 
44 
45 /** Creates a HTML navigation bar wth the following parts:
46 
47     A main bar with fixed items.
48     Zero to several subbars with user defined items, depending of
49     the contents of the page.
50 
51     The main bar contains those items:
52 
53     Overview | Namespace | Class | Tree | Project | File | Index | Help
54 */
55 class NavigationBar
56 {
57   public:
58     enum E_GlobalLocation
59     {
60         LOC_Overview,
61         LOC_AllDefs,
62         LOC_Index,
63         LOC_Help
64     };
65     enum E_CeGatheringType
66     {
67         CEGT_operations,
68         CEGT_data
69     };
70 
71     /// Used for Overview, Index and Help.
72 						NavigationBar(
73 							const OuputPage_Environment &
74                                                 i_rEnv,
75                             E_GlobalLocation    i_eLocation );
76     /// Used for all Ces except operations and data.
77 						NavigationBar(
78 							const OuputPage_Environment &
79                                                 i_rEnv,
80                             const ary::cpp::CodeEntity &
81                                                 i_rCe );
82     /** Used for operations and data.
83     */
84 						NavigationBar(
85 							const OuputPage_Environment &
86                                                 i_rEnv,
87                             E_CeGatheringType   i_eCeGatheringType );
88 	                    ~NavigationBar();
89 
90 	void	  	        MakeSubRow(
91 							const char *		i_sTitle );
92 	void	  	        AddItem(                /// Items are added to last made sub-row.
93 							const char *		i_sName,
94                             const char *        i_sLink,
95                             bool                i_bValid );
96     /** This writes the main bar and the pSubRowTable to o_rOut.
97         The pSubRowsTable stays in memory and can be filled later,
98         when all SubRow items are known.
99     */
100     void                Write(
101                             csi::xml::Element & o_rOut,
102                             bool                i_bWithSubRows = false ) const;
103     void                Write_SubRows() const;
104 
105   private:
106     struct CheshireCat;
107     Dyn<CheshireCat>    pi;
108     csi::html::Table *  pSubRowsTable;
109 };
110 
111 
112 
113 
114 #endif
115