Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef ADC_DISPLAY_HI_LINKHELPER_HXX
21 : #define ADC_DISPLAY_HI_LINKHELPER_HXX
22 :
23 : #include "hi_ary.hxx"
24 : #include "hi_env.hxx"
25 : #include <toolkit/out_position.hxx>
26 : #include <toolkit/out_tree.hxx>
27 :
28 :
29 : class LinkHelper
30 : {
31 : public:
32 : typedef ary::idl::CodeEntity CE;
33 : typedef output::Position OutPosition;
34 :
35 1 : LinkHelper(
36 : HtmlEnvironment_Idl &
37 : io_rEnv )
38 1 : : rEnv(io_rEnv) {}
39 :
40 7685 : OutPosition PositionOf_CurModule() const
41 7685 : { return OutPosition( rEnv.CurPosition(),
42 15370 : output::ModuleFileName()); }
43 :
44 : OutPosition PositionOf_CurXRefs(
45 : const String & i_ceName) const;
46 7804 : OutPosition PositionOf_Index() const
47 7804 : { OutPosition ret1 = rEnv.OutputTree().IndexRoot();
48 7804 : return OutPosition( ret1, String(output::IndexFile_A()) ); }
49 :
50 :
51 : const ary::idl::Module *
52 : Search_CurModule() const;
53 : const ary::idl::Module *
54 : Search_Module(
55 : output::Node & i_node ) const;
56 :
57 : const CE * Search_CeFromType(
58 : ary::idl::Type_id i_type ) const;
59 :
60 119626 : void Get_Link2Position(
61 : StreamStr & o_link,
62 : OutPosition & i_pos ) const
63 119626 : { rEnv.CurPosition().Get_LinkTo(o_link, i_pos); }
64 :
65 24041 : void Get_Link2Member(
66 : StreamStr & o_link,
67 : OutPosition & i_ownerPos,
68 : const String & i_memberName ) const
69 24041 : { Get_Link2Position(o_link, i_ownerPos);
70 24041 : o_link << "#" << i_memberName; }
71 : const String & XrefsSuffix() const;
72 :
73 : private:
74 : HtmlEnvironment_Idl & rEnv;
75 : };
76 :
77 : inline const ary::idl::CodeEntity *
78 3045 : LinkHelper::Search_CeFromType( ary::idl::Type_id i_type ) const
79 : {
80 3045 : ary::idl::Ce_id nCe = rEnv.Data().CeFromType(i_type);
81 3045 : if (nCe.IsValid())
82 3045 : return &rEnv.Data().Find_Ce(nCe);
83 0 : return 0;
84 : }
85 :
86 : String nameChainLinker( const char * i_levelName );
87 :
88 :
89 : #endif
90 :
91 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|