1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: out_node.hxx,v $
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_OUT_NODE_HXX
32 #define ADC_DISPLAY_OUT_NODE_HXX
42 Represents a tree of names where each node can have only one parent,
43 but a list of children.
51 typedef std::vector
< Node
* > List
;
52 typedef UINT32 relative_id
;
55 enum E_NullObject
{ null_object
};
64 const Node
& i_node
) const
65 { return pParent
== i_node
.pParent AND sName
== i_node
.sName
; }
67 const Node
& i_node
) const
68 { return NOT
operator==(i_node
); }
71 /// Seek, and if not existent, create.
73 const String
& i_name
);
74 /// Seek, and if not existent, create.
78 { return provide_Child(i_path
.begin(), i_path
.end()); }
80 intt
Depth() const { return nDepth
; }
82 const String
& Name() const { return sName
; }
83 /// @return Id of a namespace or class etc. this directory represents.
84 relative_id
RelatedNameRoom() const { return nNameRoomId
; }
85 /// @return No delimiter at start, with delimiter at end.
88 intt i_maxDepth
= -1 ) const;
90 StringVector
& o_result
,
91 intt i_maxDepth
= -1 ) const;
93 void Set_RelatedNameRoom(
94 relative_id i_nNameRoomId
)
95 { nNameRoomId
= i_nNameRoomId
; }
96 Node
* Parent() { return pParent
; }
98 const String
& i_name
)
99 { return find_Child(i_name
); }
100 List
& Children() { return aChildren
; }
102 /// @return a reference to a Node with Depth() == -1.
103 static Node
& Null_();
108 const String
& i_name
,
112 const String
& i_name
);
114 const String
& i_name
);
115 Node
& provide_Child(
116 StringVector::const_iterator
118 StringVector::const_iterator
125 relative_id nNameRoomId
;
131 } // namespace output