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_HFI_HIERARCHY_HXX
21 : #define ADC_DISPLAY_HFI_HIERARCHY_HXX
22 :
23 : // USED SERVICES
24 : // BASE CLASSES
25 : // COMPONENTS
26 : // PARAMETERS
27 : #include <ary/idl/i_comrela.hxx>
28 : #include <ary/idl/i_types4idl.hxx>
29 :
30 : namespace ary
31 : {
32 : namespace idl
33 : {
34 : class Gate;
35 : }
36 : }
37 :
38 : namespace csi
39 : {
40 : namespace xml
41 : {
42 : class Element;
43 : }
44 : }
45 :
46 :
47 : class HtmlEnvironment_Idl;
48 :
49 :
50 :
51 : /** Represents a node in an pyramidic inheritance hierarchy which shall be
52 : displayed in text mode.
53 : */
54 : class HF_IdlBaseNode
55 : {
56 : public:
57 : typedef ary::idl::CodeEntity CE;
58 : typedef ary::idl::Type TYPE;
59 : typedef ary::idl::Gate GATE;
60 : typedef ary::idl::Ce_id Ce_id;
61 : typedef ary::idl::Type_id Type_id;
62 :
63 : /** @descr
64 : The constructor recursively calls further constructors of
65 : HF_IdlBaseNode for the bases of ->i_rType, if ->i_rType matches to a
66 : ->CE.
67 : So it builds up a complete hierarchy tree of all base classes
68 : of ->i_pEntity.
69 : */
70 : HF_IdlBaseNode(
71 : const TYPE & i_rType,
72 : const GATE & i_rGate,
73 : intt i_nPositionOffset,
74 : HF_IdlBaseNode & io_rDerived );
75 : ~HF_IdlBaseNode();
76 :
77 : /** Recursively fills ->o_rPositionList with the instances of base
78 : classes in the order in which they will be displayed.
79 : */
80 : void FillPositionList(
81 : std::vector< const HF_IdlBaseNode* > &
82 : o_rPositionList ) const;
83 :
84 : Type_id Type() const { return nType; }
85 0 : intt BaseCount() const { return nCountBases; }
86 : intt Position() const { return nPosition; }
87 : int Xpos() const { return 3*Position(); }
88 : int Ypos() const { return 2*Position(); }
89 : const HF_IdlBaseNode * Derived() const { return pDerived; }
90 :
91 : private:
92 : typedef std::vector< DYN HF_IdlBaseNode* > BaseList;
93 :
94 : void GatherBases(
95 : const CE & i_rCe,
96 : const GATE & i_rGate );
97 :
98 : // DATA
99 : Type_id nType;
100 : BaseList aBases;
101 : intt nCountBases;
102 : intt nPosition;
103 : HF_IdlBaseNode * pDerived;
104 : };
105 :
106 : void Write_BaseHierarchy(
107 : csi::xml::Element & o_rOut,
108 : HtmlEnvironment_Idl &
109 : i_env,
110 : const ary::idl::CodeEntity &
111 : i_rCe );
112 :
113 : void Write_Bases(
114 : csi::xml::Element & o_rOut,
115 : HtmlEnvironment_Idl &
116 : i_env,
117 : const ary::idl::CodeEntity &
118 : i_rCe,
119 : std::vector<uintt> &
120 : io_setColumns );
121 :
122 : #endif
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|