fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / idl / inc / basobj.hxx
blobc601fb1964ca80616b0cd637518dfd24310c260a
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_BASOBJ_HXX
21 #define INCLUDED_IDL_INC_BASOBJ_HXX
23 #include <tools/ref.hxx>
24 #include <bastype.hxx>
25 #include <tools/pstm.hxx>
27 class SvTokenStream;
28 class SvMetaObject;
29 class SvIdlDataBase;
31 typedef SvMetaObject * (*CreateMetaObjectType)();
33 #define C_PREF "C_"
35 class SvMetaObject : public SvRttiBase
37 public:
38 TYPEINFO_OVERRIDE();
39 SvMetaObject();
41 static void WriteTab( SvStream & rOutStm, sal_uInt16 nTab );
42 static void Back2Delemitter( SvStream & );
43 static void WriteStars( SvStream & );
45 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
47 protected:
48 virtual ~SvMetaObject() {}
51 class SvMetaObjectMemberList : public SvRefMemberList<SvMetaObject *> {};
53 class SvMetaObjectMemberStack
55 SvMetaObjectMemberList aList;
56 public:
57 SvMetaObjectMemberStack() {;}
59 void Push( SvMetaObject * pObj )
60 { aList.push_back( pObj ); }
61 SvMetaObject * Pop() { return aList.pop_back(); }
62 SvMetaObject * Top() const { return aList.back(); }
63 void Clear() { aList.clear(); }
64 sal_uLong Count() const { return aList.size(); }
66 SvMetaObject * Get( TypeId nType )
68 for( SvMetaObjectMemberList::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it )
69 if( (*it)->IsA( nType ) )
70 return *it;
71 return NULL;
75 class SvMetaName : public SvMetaObject
77 SvString aName;
78 SvHelpContext aHelpContext;
79 SvHelpText aHelpText;
80 SvString aConfigName;
81 SvString aDescription;
83 protected:
84 bool ReadNameSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
85 void DoReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm,
86 char c = '\0' );
87 virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
88 virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
89 SvTokenStream & rInStm );
90 public:
91 TYPEINFO_OVERRIDE();
92 SvMetaName();
94 virtual bool SetName( const OString& rName, SvIdlDataBase * = NULL );
95 void SetDescription( const OString& rText )
96 { aDescription.setString(rText); }
97 const SvHelpContext& GetHelpContext() const { return aHelpContext; }
98 virtual const SvString & GetName() const { return aName; }
99 virtual const SvString & GetHelpText() const { return aHelpText; }
100 virtual const SvString & GetConfigName() const{ return aConfigName; }
101 virtual const SvString& GetDescription() const{ return aDescription; }
103 virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm );
104 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
107 class SvMetaNameMemberList : public SvRefMemberList<SvMetaName *> {};
109 class SvMetaReference;
110 typedef tools::SvRef<SvMetaReference> SvMetaReferenceRef;
111 class SvMetaReference : public SvMetaName
113 protected:
114 SvMetaReferenceRef aRef;
115 public:
116 TYPEINFO_OVERRIDE();
117 SvMetaReference();
119 const SvString & GetName() const SAL_OVERRIDE
121 return ( !aRef.Is()
122 || !SvMetaName::GetName().getString().isEmpty() )
123 ? SvMetaName::GetName()
124 : aRef->GetName();
127 const SvString & GetHelpText() const SAL_OVERRIDE
129 return ( !aRef.Is()
130 || !SvMetaName::GetHelpText().getString().isEmpty() )
131 ? SvMetaName::GetHelpText()
132 : aRef->GetHelpText();
135 const SvString & GetConfigName() const SAL_OVERRIDE
137 return ( !aRef.Is()
138 || !SvMetaName::GetConfigName().getString().isEmpty() )
139 ? SvMetaName::GetConfigName()
140 : aRef->GetConfigName();
143 const SvString & GetDescription() const SAL_OVERRIDE
145 return ( !aRef.Is()
146 || !SvMetaName::GetDescription().getString().isEmpty() )
147 ? SvMetaName::GetDescription()
148 : aRef->GetDescription();
150 SvMetaReference * GetRef() const { return aRef; }
151 void SetRef( SvMetaReference * pRef )
152 { aRef = pRef; }
155 class SvMetaReferenceMemberList : public SvRefMemberList<SvMetaReference *> {};
158 class SvMetaModule;
159 class SvMetaExtern : public SvMetaReference
161 SvMetaModule * pModule; // included in which module
163 SvUUId aUUId;
164 SvVersion aVersion;
165 bool bReadUUId;
166 bool bReadVersion;
167 public:
168 TYPEINFO_OVERRIDE();
169 SvMetaExtern();
171 SvMetaModule * GetModule() const;
173 const SvGlobalName &GetUUId() const;
174 const SvVersion & GetVersion() const { return aVersion; }
175 void SetModule( SvIdlDataBase & rBase );
176 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
178 protected:
179 virtual void ReadAttributesSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) SAL_OVERRIDE;
182 class SvMetaExternMemberList : public SvRefMemberList<SvMetaExtern *> {};
184 #endif // INCLUDED_IDL_INC_BASOBJ_HXX
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */