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 ARY_IDL_IT_XNAMEROOM_HXX
29 #define ARY_IDL_IT_XNAMEROOM_HXX
30 
31 // BASE CLASSES
32 #include <ary/idl/i_type.hxx>
33 #include <nametreenode.hxx>
34 
35 
36 
37 
38 namespace ary
39 {
40 namespace idl
41 {
42 
43 
44 /** A namespace for ->Type s, as they are explicitely written in code.
45 
46     The search/identification string is usually the local name of
47     the Type. But for templated structs, the search string has this
48     pattern:
49                 <LocalName> '<' <StringOfTemplateTypeId>
50 */
51 class ExplicitNameRoom : public Type
52 {
53   public:
54     enum E_ClassId { class_id = 2204 };
55 
56     // LIFECYCLE
57                         ExplicitNameRoom();
58                         ExplicitNameRoom(
59                             const String &      i_sName,
60                             const ExplicitNameRoom &
61                                                 i_rParent );
62     virtual             ~ExplicitNameRoom();
63 
64     // OPERATIONS
65     /** @param i_sSearchString
66                 A local type name  usually.
67                 For templated types see class docu.
68         @see ExplicitNameRoom
69     */
70     void                Add_Name(
71                             const String &      i_sSearchString,
72                             Type_id             i_nId )
73                             { aImpl.Add_Name(i_sSearchString,i_nId); }
74     // INQUIRY
75     const String &      Name() const            { return aImpl.Name(); }
76     intt                Depth() const           { return aImpl.Depth(); }
77     void                Get_FullName(
78                             StringVector &      o_rText,
79                             Ce_idList *         o_pRelatedCes,
80                             const Gate &        i_rGate ) const;
81     bool                IsAbsolute() const      { return Depth() > 0
82                                                     ?   (*NameChain_Begin()).empty()
83                                                     :   false; }
84     /** @param i_sSearchString
85                 A local type name  usually.
86                 For templated types see class docu.
87         @see ExplicitNameRoom
88     */
89     Type_id             Search_Name(
90                             const String &      i_sSearchString ) const
91                             { return aImpl.Search_Name(i_sSearchString); }
92 
93     StringVector::const_iterator
94                         NameChain_Begin() const
95                             { return aImpl.NameChain_Begin(); }
96     StringVector::const_iterator
97                         NameChain_End() const
98                             { return aImpl.NameChain_End(); }
99   private:
100     // Interface csv::ConstProcessorClient:
101     virtual void        do_Accept(
102                             csv::ProcessorIfc & io_processor ) const;
103     // Interface Object:
104     virtual ClassId     get_AryClass() const;
105 
106     // Interface Type:
107     virtual void        inq_Get_Text(
108                             StringVector &      o_module,
109                             String &            o_name,
110                             Ce_id &             o_nRelatedCe,
111                             int &               o_nSequemceCount,
112                             const Gate &        i_rGate ) const;
113     // DATA
114     NameTreeNode<Type_id>
115                         aImpl;
116 };
117 
118 
119 
120 
121 }   // namespace idl
122 }   // namespace ary
123 #endif
124