fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / idl / inc / types.hxx
blobaa701f412847779fceaf9fd7fbeb332fdc5b3052
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_IDL_INC_TYPES_HXX
21 #define INCLUDED_IDL_INC_TYPES_HXX
23 #include <rtl/strbuf.hxx>
24 #include <tools/ref.hxx>
25 #include <basobj.hxx>
27 struct SvSlotElement;
28 typedef std::vector< SvSlotElement* > SvSlotElementList;
30 class SvMetaSlot;
32 class SvMetaType;
33 typedef tools::SvRef<SvMetaType> SvMetaTypeRef;
35 class SvMetaAttribute : public SvMetaReference
37 SvMetaTypeRef aType;
38 SvNumberIdentifier aSlotId;
39 SvBOOL aAutomation;
40 SvBOOL aExport;
41 SvBOOL aReadonly;
42 SvBOOL aIsCollection;
43 SvBOOL aReadOnlyDoc;
44 SvBOOL aHidden;
45 bool bNewAttr;
47 protected:
48 virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
49 SvTokenStream & rInStm ) SAL_OVERRIDE;
50 public:
51 TYPEINFO_OVERRIDE();
52 SvMetaAttribute();
53 SvMetaAttribute( SvMetaType * );
55 void SetNewAttribute( bool bNew )
56 { bNewAttr = bNew; }
57 bool IsNewAttribute() const
58 { return bNewAttr; }
59 bool GetReadonly() const;
61 void SetSlotId( const SvNumberIdentifier & rId )
62 { aSlotId = rId; }
63 const SvNumberIdentifier & GetSlotId() const;
65 void SetExport( bool bSet )
66 { aExport = bSet; }
67 bool GetExport() const;
69 void SetHidden( bool bSet )
70 { aHidden = bSet; }
71 bool GetHidden() const;
73 void SetAutomation( bool bSet )
74 { aAutomation = bSet; }
75 bool GetAutomation() const;
77 void SetIsCollection( bool bSet )
78 { aIsCollection = bSet; }
79 bool GetIsCollection() const;
80 void SetReadOnlyDoc( bool bSet )
81 { aReadOnlyDoc = bSet; }
82 bool GetReadOnlyDoc() const;
84 void SetType( SvMetaType * pT ) { aType = pT; }
85 SvMetaType * GetType() const;
87 virtual bool IsMethod() const;
88 virtual bool IsVariable() const;
89 virtual OString GetMangleName( bool bVariable ) const;
92 virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
93 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
94 sal_uLong MakeSfx( OStringBuffer& rAtrrArray );
95 virtual void Insert( SvSlotElementList&, const OString& rPrefix,
96 SvIdlDataBase& );
97 OString Compare( SvMetaAttribute *pAttr );
100 typedef tools::SvRef<SvMetaAttribute> SvMetaAttributeRef;
102 class SvMetaAttributeMemberList : public SvRefMemberList<SvMetaAttribute *> {};
104 enum { CALL_VALUE, CALL_POINTER, CALL_REFERENCE };
105 enum { TYPE_METHOD, TYPE_STRUCT, TYPE_BASE, TYPE_ENUM, TYPE_UNION,
106 TYPE_CLASS, TYPE_POINTER };
107 class SvMetaType : public SvMetaExtern
109 SvBOOL aIn; // input parameter
110 SvBOOL aOut; // return parameter
111 Svint aCall0, aCall1;
112 Svint aSbxDataType;
113 SvIdentifier aSvName;
114 SvIdentifier aSbxName;
115 SvIdentifier aOdlName;
116 SvIdentifier aCName;
117 SvIdentifier aBasicPostfix;
118 SvIdentifier aBasicName;
119 SvMetaAttributeMemberList * pAttrList;
120 int nType;
121 bool bIsItem;
122 bool bIsShell;
123 char cParserChar;
125 void WriteSfxItem( const OString& rItemName, SvIdlDataBase & rBase,
126 SvStream & rOutStm );
127 protected:
128 bool ReadNamesSvIdl( SvIdlDataBase & rBase,
129 SvTokenStream & rInStm );
130 virtual void ReadAttributesSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
131 virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
133 bool ReadHeaderSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
134 public:
135 TYPEINFO_OVERRIDE();
136 SvMetaType();
137 SvMetaType( const OString& rTypeName, char cParserChar,
138 const OString& rCName );
139 SvMetaType( const OString& rTypeName, const OString& rSbxName,
140 const OString& rOdlName, char cParserChar,
141 const OString& rCName, const OString& rBasicName,
142 const OString& rBasicPostfix );
144 virtual ~SvMetaType();
146 SvMetaAttributeMemberList & GetAttrList() const;
147 sal_uLong GetAttrCount() const
149 return pAttrList ? pAttrList->size() : 0L;
151 void AppendAttr( SvMetaAttribute * pAttr )
153 GetAttrList().push_back( pAttr );
156 void SetType( int nT );
157 int GetType() const { return nType; }
158 SvMetaType * GetBaseType() const;
159 SvMetaType * GetReturnType() const;
160 bool IsItem() const { return bIsItem; }
161 bool IsShell() const { return bIsShell; }
163 void SetIn( bool b ) { aIn = b; }
164 bool GetIn() const;
166 void SetOut( bool b ) { aOut = b; }
167 bool GetOut() const;
169 void SetCall0( int e );
170 int GetCall0() const;
172 void SetCall1( int e);
173 int GetCall1() const;
175 void SetBasicName(const OString& rName)
176 { aBasicName.setString(rName); }
178 const OString& GetBasicName() const;
179 const OString& GetSvName() const;
180 const OString& GetSbxName() const;
181 const OString& GetOdlName() const;
182 const OString& GetCName() const;
183 char GetParserChar() const { return cParserChar; }
185 virtual bool SetName( const OString& rName, SvIdlDataBase * = NULL ) SAL_OVERRIDE;
188 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
190 sal_uLong MakeSfx( OStringBuffer& rAtrrArray );
191 virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
192 bool ReadMethodArgs( SvIdlDataBase & rBase,
193 SvTokenStream & rInStm );
194 OString GetParserString() const;
197 class SvMetaTypeMemberList : public SvRefMemberList<SvMetaType *> {};
199 class SvMetaTypeString : public SvMetaType
201 public:
202 TYPEINFO_OVERRIDE();
203 SvMetaTypeString();
206 class SvMetaTypeStringMemberList : public SvRefMemberList<SvMetaTypeString *> {};
208 class SvMetaEnumValue : public SvMetaName
210 public:
211 TYPEINFO_OVERRIDE();
212 SvMetaEnumValue();
214 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
216 typedef tools::SvRef<SvMetaEnumValue> SvMetaEnumValueRef;
218 class SvMetaEnumValueMemberList : public SvRefMemberList<SvMetaEnumValue *> {};
220 class SvMetaTypeEnum : public SvMetaType
222 SvMetaEnumValueMemberList aEnumValueList;
223 OString aPrefix;
224 protected:
225 virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
226 public:
227 TYPEINFO_OVERRIDE();
228 SvMetaTypeEnum();
230 sal_uInt16 GetMaxValue() const;
231 sal_uLong Count() const { return aEnumValueList.size(); }
232 const OString& GetPrefix() const { return aPrefix; }
233 SvMetaEnumValue * GetObject( sal_uLong n ) const
234 { return aEnumValueList[n]; }
236 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
238 typedef tools::SvRef<SvMetaTypeEnum> SvMetaTypeEnumRef;
240 class SvMetaTypeEnumMemberList : public SvRefMemberList<SvMetaTypeEnum *> {};
242 class SvMetaTypevoid : public SvMetaType
244 public:
245 TYPEINFO_OVERRIDE();
246 SvMetaTypevoid();
248 class SvMetaTypevoidMemberList : public SvRefMemberList<SvMetaTypevoid *> {};
251 #endif // INCLUDED_IDL_INC_TYPES_HXX
253 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */