1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef ADC_DISPLAY_ARYATTRS_HXX
29*cdf0e10cSrcweir #define ADC_DISPLAY_ARYATTRS_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // USED SERVICES
32*cdf0e10cSrcweir #include <ary/cpp/c_types4cpp.hxx>
33*cdf0e10cSrcweir #include <ary/doc/d_docu.hxx>
34*cdf0e10cSrcweir #include <ary/doc/d_oldcppdocu.hxx>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir namespace ary
37*cdf0e10cSrcweir {
38*cdf0e10cSrcweir  	namespace cpp
39*cdf0e10cSrcweir     {
40*cdf0e10cSrcweir         class CodeEntity;
41*cdf0e10cSrcweir         class Class;
42*cdf0e10cSrcweir         class DisplayGate;
43*cdf0e10cSrcweir         class Function;
44*cdf0e10cSrcweir         class Namespace;
45*cdf0e10cSrcweir     }
46*cdf0e10cSrcweir }
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir const char *        Get_ClassTypeKey(
52*cdf0e10cSrcweir                         const ary::cpp::Class & i_rClass );
53*cdf0e10cSrcweir const char *        Get_TypeKey(
54*cdf0e10cSrcweir                         const ary::cpp::CodeEntity &
55*cdf0e10cSrcweir                                                 i_rCe );
56*cdf0e10cSrcweir bool                Ce_IsInternal(
57*cdf0e10cSrcweir                         const ary::cpp::CodeEntity &
58*cdf0e10cSrcweir                                                 i_rCe );
59*cdf0e10cSrcweir const char *        SyntaxText_PreName(
60*cdf0e10cSrcweir                         const ary::cpp::Function &
61*cdf0e10cSrcweir                                                 i_rFunction,
62*cdf0e10cSrcweir                         const ary::cpp::Gate &  i_rAryGate );
63*cdf0e10cSrcweir const char *        SyntaxText_PostName(
64*cdf0e10cSrcweir                         const ary::cpp::Function &
65*cdf0e10cSrcweir                                                 i_rFunction,
66*cdf0e10cSrcweir                         const ary::cpp::Gate &  i_rAryGate );
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir bool                Get_TypeText(
69*cdf0e10cSrcweir                         const char * &          o_rPreName,
70*cdf0e10cSrcweir                         const char * &          o_rName,
71*cdf0e10cSrcweir                         const char * &          o_rPostName,
72*cdf0e10cSrcweir                         ary::cpp::Type_id       i_nTypeid,
73*cdf0e10cSrcweir                         const ary::cpp::Gate &  i_rAryGate );
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir inline const ary::doc::OldCppDocu *
77*cdf0e10cSrcweir Get_CppDocu(const ary::doc::Documentation & i_doc)
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir     return dynamic_cast< const ary::doc::OldCppDocu* >(i_doc.Data());
80*cdf0e10cSrcweir }
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir class FunctionParam_Iterator
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir   public:
86*cdf0e10cSrcweir                     FunctionParam_Iterator();
87*cdf0e10cSrcweir                     ~FunctionParam_Iterator();
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir                     operator bool() const;
90*cdf0e10cSrcweir     FunctionParam_Iterator &
91*cdf0e10cSrcweir                     operator++();
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir     void            Assign(
94*cdf0e10cSrcweir                         const ary::cpp::Function &
95*cdf0e10cSrcweir                                                 i_rFunction );
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir     ary::cpp::Type_id
98*cdf0e10cSrcweir                     CurType() const;
99*cdf0e10cSrcweir     const String  & CurName() const;
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir     bool            IsFunctionConst() const;
102*cdf0e10cSrcweir     bool            IsFunctionVolatile() const;
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir   private:
105*cdf0e10cSrcweir     typedef std::vector<ary::cpp::Type_id>::const_iterator  Type_Iterator;
106*cdf0e10cSrcweir     typedef StringVector::const_iterator                    Name_Iterator;
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir     bool                IsValid() const;
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir     // Forbidden
111*cdf0e10cSrcweir     FunctionParam_Iterator &
112*cdf0e10cSrcweir                     operator++(int);
113*cdf0e10cSrcweir     // DATA
114*cdf0e10cSrcweir     Type_Iterator       itTypes;
115*cdf0e10cSrcweir     Type_Iterator       itTypes_end;
116*cdf0e10cSrcweir     Name_Iterator       itNames_andMore;        /// Name, init-value.
117*cdf0e10cSrcweir     Name_Iterator       itNames_andMore_end;
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     ary::cpp::E_ConVol  eConVol;
120*cdf0e10cSrcweir };
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir // IMPLEMENTATION
126*cdf0e10cSrcweir inline
127*cdf0e10cSrcweir FunctionParam_Iterator::operator bool() const
128*cdf0e10cSrcweir     { return IsValid(); }
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir inline bool
131*cdf0e10cSrcweir FunctionParam_Iterator::IsValid() const
132*cdf0e10cSrcweir {
133*cdf0e10cSrcweir     // By C'tor and Assign(), it is assured, that
134*cdf0e10cSrcweir     //   both iterators are valid, if one is valid.
135*cdf0e10cSrcweir     return itTypes != itTypes_end;
136*cdf0e10cSrcweir }
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir inline ary::cpp::Type_id
139*cdf0e10cSrcweir FunctionParam_Iterator::CurType() const
140*cdf0e10cSrcweir     { return IsValid() ? *itTypes : ary::cpp::Type_id(0); }
141*cdf0e10cSrcweir inline const String  &
142*cdf0e10cSrcweir FunctionParam_Iterator::CurName() const
143*cdf0e10cSrcweir     { return IsValid() ? *itNames_andMore : String::Null_(); }
144*cdf0e10cSrcweir inline bool
145*cdf0e10cSrcweir FunctionParam_Iterator::IsFunctionConst() const
146*cdf0e10cSrcweir     { return (eConVol & ary::cpp::CONVOL_const) != 0; }
147*cdf0e10cSrcweir inline bool
148*cdf0e10cSrcweir FunctionParam_Iterator::IsFunctionVolatile() const
149*cdf0e10cSrcweir     { return (eConVol & ary::cpp::CONVOL_volatile) != 0; }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir #endif
155