Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / idl / inc / types.hxx
blobe946ed35436b26bfedeb9e08bdd4671ed609be61
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 class SvMetaType;
28 class SvMetaSlot;
29 typedef SvRefMemberList< SvMetaSlot* > SvSlotElementList;
31 class SvMetaAttribute : public SvMetaReference
33 public:
34 tools::SvRef<SvMetaType> aType;
35 SvIdentifier aSlotId;
36 SvMetaAttribute();
37 SvMetaAttribute( SvMetaType * );
39 void SetSlotId( const SvIdentifier & rId )
40 { aSlotId = rId; }
41 const SvIdentifier& GetSlotId() const;
42 SvMetaType * GetType() const;
44 virtual bool Test( SvTokenStream & rInStm );
45 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
46 sal_uLong MakeSfx( OStringBuffer& rAtrrArray ) const;
47 virtual void Insert( SvSlotElementList& );
50 enum MetaTypeType { Method, Struct, Base, Enum, Interface, Shell };
52 class SvMetaType : public SvMetaReference
54 SvRefMemberList<SvMetaAttribute *> aAttrList;
55 MetaTypeType nType;
56 bool bIsItem;
58 void WriteSfxItem( const OString& rItemName, SvIdlDataBase const & rBase,
59 SvStream & rOutStm );
60 protected:
61 bool ReadHeaderSvIdl( SvTokenStream & rInStm );
62 public:
63 SvMetaType();
64 SvMetaType( const OString& rTypeName );
66 virtual ~SvMetaType() override;
68 virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
70 SvRefMemberList<SvMetaAttribute *>&
71 GetAttrList() { return aAttrList; }
72 sal_uLong GetAttrCount() const { return aAttrList.size(); }
74 void SetType( MetaTypeType nT );
75 MetaTypeType GetMetaTypeType() const { return nType; }
76 SvMetaType * GetBaseType() const;
77 SvMetaType * GetReturnType() const;
78 void SetItem(bool b) { bIsItem = b; }
79 bool IsItem() const { return bIsItem; }
81 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
83 sal_uLong MakeSfx( OStringBuffer& rAtrrArray );
84 virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
85 bool ReadMethodArgs( SvIdlDataBase & rBase,
86 SvTokenStream & rInStm );
89 class SvMetaTypeString : public SvMetaType
91 public:
92 SvMetaTypeString();
95 class SvMetaEnumValue : public SvMetaObject
97 public:
98 SvMetaEnumValue();
101 class SvMetaTypeEnum : public SvMetaType
103 public:
104 SvRefMemberList<SvMetaEnumValue *> aEnumValueList;
105 OString aPrefix;
106 SvMetaTypeEnum();
109 class SvMetaTypevoid : public SvMetaType
111 public:
112 SvMetaTypevoid();
116 #endif // INCLUDED_IDL_INC_TYPES_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */