xref: /trunk/main/autodoc/source/display/idl/hi_env.hxx (revision cdf0e10c)
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_HI_ENV_HXX
29 #define ADC_DISPLAY_HI_ENV_HXX
30 
31 
32 // USED SERVICES
33     // BASE CLASSES
34     // COMPONENTS
35 #include <cosv/ploc.hxx>
36 #include <cosv/ploc_dir.hxx>
37     // PARAMETERS
38 #include <toolkit/out_position.hxx>
39 
40 namespace ary
41 {
42 namespace idl
43 {
44     class Gate;
45     class CodeEntity;
46 }
47 }
48 namespace display
49 {
50     class CorporateFrame;
51 }
52 namespace output
53 {
54     class Tree;
55 }
56 
57 class AryAccess;
58 class LinkHelper;
59 
60 /** @resp
61     Provides enviroment information to the HTML factory
62     classes.
63 
64     @descr
65     All information that is not included in the data, especially
66     about the layout of the output tree and the access to
67     information from the repository are provided here.
68 
69     @see HtmlFactory
70 */
71 class HtmlEnvironment_Idl
72 {
73   public:
74     // LIFECYCLE
75                         HtmlEnvironment_Idl(
76                             const csv::ploc::Path &
77                                                 io_rOutputDir,
78                             const ary::idl::Gate &
79                                                 i_rGate,
80                             const display::CorporateFrame &
81                                                 i_rLayout );
82                         ~HtmlEnvironment_Idl();
83 
84     // OPERATIONS
85     void                Goto_Directory(
86                             output::Position    i_pos,
87                             bool                i_bCreateDirectoryIfNecessary );
88     void                Goto_DirectoryLevelDown(
89                             const String &      i_subDirName,
90                             bool                i_bCreateDirectoryIfNecessary );
91     void                Goto_DirectoryLevelUp();
92     void                Set_CurFile(
93                             const String &      i_fileName );
94     void                Set_CurPageCe(
95                             const ary::idl::CodeEntity *
96                                                 i_ce )
97                                                 { pCurPageCe = i_ce; }
98     // INQUIRY
99     const ary::idl::Gate &
100                         Gate() const            { return *pGate; }
101     const AryAccess &   Data() const            { return *pData; }
102     const char *        Link2Manual(
103                             const String &      i_link ) const;
104 
105     /// This may be reimplemented for removing dead links to members.
106     bool                Is_MemberExistenceCheckRequired() const
107                                                 { return false; }
108 
109     /// @return Holds only the current directory, not the current file.
110     output::Position &  CurPosition() const		{ return aCurPosition; }
111     void                Get_CurFilePath(
112                             StreamStr &         o_buffer ) const
113                                                 { o_buffer << aCurPath; }
114 
115     const display::CorporateFrame &
116                         Layout() const			{ return *pLayout; }
117     const LinkHelper &  Linker() const          { return *pLinker; }
118 
119     void                Get_LinkTo(
120                             StreamStr &         o_result,
121                             output::Position    i_destination )
122                                                 { CurPosition().Get_LinkTo(o_result, i_destination); }
123     String              CurPageCe_AsText() const;
124     String              CurPageCe_AsFile(
125                             const char *        i_sEnding) const;
126     const ary::idl::CodeEntity *
127                         CurPageCe() const       { return pCurPageCe; }
128 
129     // ACCESS
130     output::Tree &      OutputTree()     		{ return *pOutputTree; }
131 
132   private:
133     // Local
134     void                create_Directory(
135                             const csv::ploc::Path &
136                                                 i_path );
137 
138     // DATA
139     csv::ploc::Directory
140                         aOutputRoot;
141     csv::ploc::Path     aCurPath;
142 
143     Dyn<AryAccess>      pData;          /// @invariant *pData is valid.
144     const ary::idl::Gate *
145                         pGate;          /// @invariant pGate != 0.
146     Dyn<output::Tree>   pOutputTree;    /// @invariant *pOutputTree is valid.
147     mutable output::Position
148                         aCurPosition;
149     const ary::idl::CodeEntity *
150                         pCurPageCe;
151 
152     const display::CorporateFrame *
153                         pLayout;
154 
155     Dyn<LinkHelper>     pLinker;
156 };
157 
158 
159 #endif
160 
161 
162