xref: /aoo42x/main/autodoc/inc/ary/idl/i_property.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_PROPERTY_HXX
29 #define ARY_IDL_I_PROPERTY_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_property
42 {
43     struct attr;
44 }
45 
46 
47 /** Represents an IDL property.
48 */
49 class Property : public CodeEntity
50 {
51   public:
52     enum E_ClassId { class_id = 2004 };
53 
54     class Stereotypes
55     {
56       public:
57         enum E_Flags
58         {
59             readonly = 1,
60             bound = 2,
61             constrained = 4,
62             maybeambiguous = 8,
63             maybedefault = 16,
64             maybevoid = 32,
65             removable = 64,
66             transient = 128,
67             s_MAX
68         };
69                             Stereotypes()       : nFlags(0) {}
70 
71         bool                HasAny() const      { return nFlags != 0; }
72         bool                IsReadOnly() const  { return (nFlags & UINT32(readonly)) != 0; }
73         bool                IsBound() const     { return (nFlags & UINT32(bound)) != 0; }
74         bool                IsConstrained() const
75                                                 { return (nFlags & UINT32(constrained)) != 0; }
76         bool                IsMayBeAmbiguous() const
77                                                 { return (nFlags & UINT32(maybeambiguous)) != 0; }
78         bool                IsMayBeDefault() const
79                                                 { return (nFlags & UINT32(maybedefault)) != 0; }
80         bool                IsMayBeVoid() const { return (nFlags & UINT32(maybevoid)) != 0; }
81         bool                IsRemovable() const { return (nFlags & UINT32(removable)) != 0; }
82         bool                IsTransient() const { return (nFlags & UINT32(transient)) != 0; }
83 
84         void                Set_Flag(
85                                 E_Flags         i_flag )
86                                                 { nFlags |= UINT32(i_flag); }
87       private:
88         // DATA
89         UINT32              nFlags;
90     };
91 
92 
93     // LIFECYCLE
94                         Property(
95                             const String &      i_sName,
96                             Ce_id               i_nService,
97                             Ce_id               i_nModule,
98                             Type_id             i_nType,
99                             Stereotypes         i_stereotypes );
100                         ~Property();
101     // INQUIRY
102     Type_id             Type() const;
103 
104   private:
105     // Interface csv::ConstProcessorClient:
106     virtual void        do_Accept(
107                             csv::ProcessorIfc & io_processor ) const;
108     // Interface ary::Object:
109     virtual ClassId     get_AryClass() const;
110 
111     // Interface CodeEntity
112     virtual const String &  inq_LocalName() const;
113     virtual Ce_id           inq_NameRoom() const;
114     virtual Ce_id           inq_Owner() const;
115     virtual E_SightLevel    inq_SightLevel() const;
116 
117     friend struct ifc_property::attr;
118 
119     // DATA
120     String              sName;
121     Ce_id               nOwner;
122     Ce_id               nNameRoom;
123 
124     Type_id             nType;
125     Stereotypes         aStereotypes;
126 };
127 
128 
129 
130 
131 // IMPLEMENTATION
132 inline Type_id
133 Property::Type() const
134 {
135     return nType;
136 }
137 
138 
139 
140 
141 }   // namespace idl
142 }   // namespace ary
143 #endif
144