xref: /trunk/main/autodoc/inc/ary/idl/i_attribute.hxx (revision cdf0e10c)
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_I_ATTRIBUTE_HXX
29 #define ARY_IDL_I_ATTRIBUTE_HXX
30 
31 // BASE CLASSES
32 #include <ary/idl/i_ce.hxx>
33 
34 
35 
36 
37 namespace ary
38 {
39 namespace idl
40 {
41 namespace ifc_attribute
42 {
43     struct attr;
44 }
45 
46 
47 
48 
49 /** @resp
50     Represents an IDL property.
51 */
52 class Attribute : public CodeEntity
53 {
54   public:
55     enum E_ClassId { class_id = 2014 };
56 
57     // LIFECYCLE
58                         Attribute(
59                             const String &      i_sName,
60                             Ce_id               i_nInterface,
61                             Ce_id               i_nModule,
62                             Type_id             i_nType,
63                             bool                i_bReadonly,
64                             bool                i_bBound );
65                         ~Attribute();
66     // OPERATIONS
67     void                Add_GetException(
68                             Type_id             i_nException );
69     void                Add_SetException(
70                             Type_id             i_nException );
71 
72     // INQUIRY
73     Type_id             Type() const;
74     bool                IsReadonly() const;
75     bool                IsBound() const;
76 
77   private:
78     // Interface csv::ConstProcessorClient:
79     virtual void        do_Accept(
80                             csv::ProcessorIfc & io_processor ) const;
81     // Interface ary::Object
82     virtual ClassId     get_AryClass() const;
83 
84     // Interface CodeEntity
85     virtual const String &  inq_LocalName() const;
86     virtual Ce_id           inq_NameRoom() const;
87     virtual Ce_id           inq_Owner() const;
88     virtual E_SightLevel    inq_SightLevel() const;
89 
90     // Local
91     typedef std::vector< Type_id >      ExceptionList;
92     friend struct ifc_attribute::attr;
93 
94     // DATA
95     String              sName;
96     Ce_id               nOwner;
97     Ce_id               nNameRoom;
98 
99     Type_id             nType;
100     ExceptionList       aGetExceptions;
101     ExceptionList       aSetExceptions;
102     bool                bReadonly;
103     bool                bBound;
104 };
105 
106 
107 
108 
109 // IMPLEMENTATION
110 inline void
111 Attribute::Add_GetException( Type_id i_nException )
112     { aGetExceptions.push_back(i_nException); }
113 
114 inline void
115 Attribute::Add_SetException( Type_id i_nException )
116     { aSetExceptions.push_back(i_nException); }
117 
118 inline Type_id
119 Attribute::Type() const
120     { return nType; }
121 
122 inline bool
123 Attribute::IsReadonly() const
124     { return bReadonly; }
125 
126 inline bool
127 Attribute::IsBound() const
128     { return bBound; }
129 
130 
131 
132 
133 }   // namespace idl
134 }   // namespace ary
135 #endif
136