1*1c78a5d6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1c78a5d6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1c78a5d6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1c78a5d6SAndrew Rist  * distributed with this work for additional information
6*1c78a5d6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1c78a5d6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1c78a5d6SAndrew Rist  * "License"); you may not use this file except in compliance
9*1c78a5d6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1c78a5d6SAndrew Rist  *
11*1c78a5d6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1c78a5d6SAndrew Rist  *
13*1c78a5d6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1c78a5d6SAndrew Rist  * software distributed under the License is distributed on an
15*1c78a5d6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1c78a5d6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1c78a5d6SAndrew Rist  * specific language governing permissions and limitations
18*1c78a5d6SAndrew Rist  * under the License.
19*1c78a5d6SAndrew Rist  *
20*1c78a5d6SAndrew Rist  *************************************************************/
21*1c78a5d6SAndrew Rist 
22*1c78a5d6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef ADC_DISPLAY_HI_ENV_HXX
25cdf0e10cSrcweir #define ADC_DISPLAY_HI_ENV_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir // USED SERVICES
29cdf0e10cSrcweir     // BASE CLASSES
30cdf0e10cSrcweir     // COMPONENTS
31cdf0e10cSrcweir #include <cosv/ploc.hxx>
32cdf0e10cSrcweir #include <cosv/ploc_dir.hxx>
33cdf0e10cSrcweir     // PARAMETERS
34cdf0e10cSrcweir #include <toolkit/out_position.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace ary
37cdf0e10cSrcweir {
38cdf0e10cSrcweir namespace idl
39cdf0e10cSrcweir {
40cdf0e10cSrcweir     class Gate;
41cdf0e10cSrcweir     class CodeEntity;
42cdf0e10cSrcweir }
43cdf0e10cSrcweir }
44cdf0e10cSrcweir namespace display
45cdf0e10cSrcweir {
46cdf0e10cSrcweir     class CorporateFrame;
47cdf0e10cSrcweir }
48cdf0e10cSrcweir namespace output
49cdf0e10cSrcweir {
50cdf0e10cSrcweir     class Tree;
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir class AryAccess;
54cdf0e10cSrcweir class LinkHelper;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir /** @resp
57cdf0e10cSrcweir     Provides enviroment information to the HTML factory
58cdf0e10cSrcweir     classes.
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     @descr
61cdf0e10cSrcweir     All information that is not included in the data, especially
62cdf0e10cSrcweir     about the layout of the output tree and the access to
63cdf0e10cSrcweir     information from the repository are provided here.
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     @see HtmlFactory
66cdf0e10cSrcweir */
67cdf0e10cSrcweir class HtmlEnvironment_Idl
68cdf0e10cSrcweir {
69cdf0e10cSrcweir   public:
70cdf0e10cSrcweir     // LIFECYCLE
71cdf0e10cSrcweir                         HtmlEnvironment_Idl(
72cdf0e10cSrcweir                             const csv::ploc::Path &
73cdf0e10cSrcweir                                                 io_rOutputDir,
74cdf0e10cSrcweir                             const ary::idl::Gate &
75cdf0e10cSrcweir                                                 i_rGate,
76cdf0e10cSrcweir                             const display::CorporateFrame &
77cdf0e10cSrcweir                                                 i_rLayout );
78cdf0e10cSrcweir                         ~HtmlEnvironment_Idl();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     // OPERATIONS
81cdf0e10cSrcweir     void                Goto_Directory(
82cdf0e10cSrcweir                             output::Position    i_pos,
83cdf0e10cSrcweir                             bool                i_bCreateDirectoryIfNecessary );
84cdf0e10cSrcweir     void                Goto_DirectoryLevelDown(
85cdf0e10cSrcweir                             const String &      i_subDirName,
86cdf0e10cSrcweir                             bool                i_bCreateDirectoryIfNecessary );
87cdf0e10cSrcweir     void                Goto_DirectoryLevelUp();
88cdf0e10cSrcweir     void                Set_CurFile(
89cdf0e10cSrcweir                             const String &      i_fileName );
Set_CurPageCe(const ary::idl::CodeEntity * i_ce)90cdf0e10cSrcweir     void                Set_CurPageCe(
91cdf0e10cSrcweir                             const ary::idl::CodeEntity *
92cdf0e10cSrcweir                                                 i_ce )
93cdf0e10cSrcweir                                                 { pCurPageCe = i_ce; }
94cdf0e10cSrcweir     // INQUIRY
95cdf0e10cSrcweir     const ary::idl::Gate &
Gate() const96cdf0e10cSrcweir                         Gate() const            { return *pGate; }
Data() const97cdf0e10cSrcweir     const AryAccess &   Data() const            { return *pData; }
98cdf0e10cSrcweir     const char *        Link2Manual(
99cdf0e10cSrcweir                             const String &      i_link ) const;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     /// This may be reimplemented for removing dead links to members.
Is_MemberExistenceCheckRequired() const102cdf0e10cSrcweir     bool                Is_MemberExistenceCheckRequired() const
103cdf0e10cSrcweir                                                 { return false; }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     /// @return Holds only the current directory, not the current file.
CurPosition() const106cdf0e10cSrcweir     output::Position &  CurPosition() const		{ return aCurPosition; }
Get_CurFilePath(StreamStr & o_buffer) const107cdf0e10cSrcweir     void                Get_CurFilePath(
108cdf0e10cSrcweir                             StreamStr &         o_buffer ) const
109cdf0e10cSrcweir                                                 { o_buffer << aCurPath; }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir     const display::CorporateFrame &
Layout() const112cdf0e10cSrcweir                         Layout() const			{ return *pLayout; }
Linker() const113cdf0e10cSrcweir     const LinkHelper &  Linker() const          { return *pLinker; }
114cdf0e10cSrcweir 
Get_LinkTo(StreamStr & o_result,output::Position i_destination)115cdf0e10cSrcweir     void                Get_LinkTo(
116cdf0e10cSrcweir                             StreamStr &         o_result,
117cdf0e10cSrcweir                             output::Position    i_destination )
118cdf0e10cSrcweir                                                 { CurPosition().Get_LinkTo(o_result, i_destination); }
119cdf0e10cSrcweir     String              CurPageCe_AsText() const;
120cdf0e10cSrcweir     String              CurPageCe_AsFile(
121cdf0e10cSrcweir                             const char *        i_sEnding) const;
122cdf0e10cSrcweir     const ary::idl::CodeEntity *
CurPageCe() const123cdf0e10cSrcweir                         CurPageCe() const       { return pCurPageCe; }
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     // ACCESS
OutputTree()126cdf0e10cSrcweir     output::Tree &      OutputTree()     		{ return *pOutputTree; }
127cdf0e10cSrcweir 
128cdf0e10cSrcweir   private:
129cdf0e10cSrcweir     // Local
130cdf0e10cSrcweir     void                create_Directory(
131cdf0e10cSrcweir                             const csv::ploc::Path &
132cdf0e10cSrcweir                                                 i_path );
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     // DATA
135cdf0e10cSrcweir     csv::ploc::Directory
136cdf0e10cSrcweir                         aOutputRoot;
137cdf0e10cSrcweir     csv::ploc::Path     aCurPath;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir     Dyn<AryAccess>      pData;          /// @invariant *pData is valid.
140cdf0e10cSrcweir     const ary::idl::Gate *
141cdf0e10cSrcweir                         pGate;          /// @invariant pGate != 0.
142cdf0e10cSrcweir     Dyn<output::Tree>   pOutputTree;    /// @invariant *pOutputTree is valid.
143cdf0e10cSrcweir     mutable output::Position
144cdf0e10cSrcweir                         aCurPosition;
145cdf0e10cSrcweir     const ary::idl::CodeEntity *
146cdf0e10cSrcweir                         pCurPageCe;
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     const display::CorporateFrame *
149cdf0e10cSrcweir                         pLayout;
150cdf0e10cSrcweir 
151cdf0e10cSrcweir     Dyn<LinkHelper>     pLinker;
152cdf0e10cSrcweir };
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 
155cdf0e10cSrcweir #endif
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 
158