Update ooo320-m1
[ooovba.git] / autodoc / source / display / idl / hi_linkhelper.hxx
blob03fa11a8123204891525f35de9c964b80ba18ca6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hi_linkhelper.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_DISPLAY_HI_LINKHELPER_HXX
32 #define ADC_DISPLAY_HI_LINKHELPER_HXX
35 // USED SERVICES
36 // BASE CLASSES
37 // COMPONENTS
38 // PARAMETERS
39 #include "hi_ary.hxx"
40 #include "hi_env.hxx"
41 #include <toolkit/out_position.hxx>
42 #include <toolkit/out_tree.hxx>
45 class LinkHelper
47 public:
48 typedef ary::idl::CodeEntity CE;
49 typedef output::Position OutPosition;
51 LinkHelper(
52 HtmlEnvironment_Idl &
53 io_rEnv )
54 : rEnv(io_rEnv) {}
56 OutPosition PositionOf_CurModule() const
57 { return OutPosition( rEnv.CurPosition(),
58 output::ModuleFileName()); }
60 OutPosition PositionOf_CurXRefs(
61 const String & i_ceName) const;
62 OutPosition PositionOf_Index() const
63 { OutPosition ret1 = rEnv.OutputTree().IndexRoot();
64 return OutPosition( ret1, String(output::IndexFile_A()) ); }
67 const ary::idl::Module *
68 Search_CurModule() const;
69 const ary::idl::Module *
70 Search_Module(
71 output::Node & i_node ) const;
73 const CE * Search_CeFromType(
74 ary::idl::Type_id i_type ) const;
76 void Get_Link2Position(
77 StreamStr & o_link,
78 OutPosition & i_pos ) const
79 { rEnv.CurPosition().Get_LinkTo(o_link, i_pos); }
81 void Get_Link2Member(
82 StreamStr & o_link,
83 OutPosition & i_ownerPos,
84 const String & i_memberName ) const
85 { Get_Link2Position(o_link, i_ownerPos);
86 o_link << "#" << i_memberName; }
87 const String & XrefsSuffix() const;
89 private:
90 // DATA
91 mutable HtmlEnvironment_Idl &
92 rEnv;
93 };
95 inline const ary::idl::CodeEntity *
96 LinkHelper::Search_CeFromType( ary::idl::Type_id i_type ) const
98 ary::idl::Ce_id nCe = rEnv.Data().CeFromType(i_type);
99 if (nCe.IsValid())
100 return &rEnv.Data().Find_Ce(nCe);
101 return 0;
106 String nameChainLinker(
107 const char * i_levelName );
110 #endif