merged tag ooo/DEV300_m102
[LibreOffice.git] / idl / inc / object.hxx
blob5f4b44c8d7fbb7724c5d5a98040de348c8a65ade
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef _OBJECT_HXX
29 #define _OBJECT_HXX
31 #define _SVSTDARR_ULONGS
32 //#include <svtools/svstdarr.hxx>
33 #include <types.hxx>
34 #include <slot.hxx>
36 struct SvSlotElement
38 SvMetaSlotRef xSlot;
39 ByteString aPrefix;
40 SvSlotElement( SvMetaSlot * pS, const ByteString & rPrefix )
41 : xSlot( pS )
42 , aPrefix( rPrefix )
45 DECLARE_LIST( SvSlotElementList, SvSlotElement* )
46 class SvMetaClass;
47 DECLARE_LIST( SvMetaClassList, SvMetaClass* )
49 class SvULongs : public List
51 public:
52 void Insert( sal_uLong& rId, sal_uLong nPos ) { sal_uLong nId(rId ); List::Insert( (void*) nId, nPos ); }
53 void Remove( sal_uLong& rId ){ sal_uLong nId(rId ); List::Remove( (void*) nId ); }
54 sal_uLong GetObject( sal_uLong nPos ){ return (sal_uLong) List::GetObject( nPos ); }
57 /******************** class SvClassElement *******************************/
58 SV_DECL_REF(SvMetaClass)
59 class SvClassElement : public SvPersistBase
61 SvBOOL aAutomation;
62 ByteString aPrefix;
63 SvMetaClassRef xClass;
64 public:
65 SV_DECL_PERSIST1( SvClassElement, SvPersistBase, 1 )
66 SvClassElement();
68 void SetPrefix( const ByteString & rPrefix )
69 { aPrefix = rPrefix; }
70 const ByteString & GetPrefix() const
71 { return aPrefix; }
73 void SetAutomation( sal_Bool rAutomation )
74 { aAutomation = rAutomation; }
75 sal_Bool GetAutomation() const
76 { return aAutomation; }
78 void SetClass( SvMetaClass * pClass )
79 { xClass = pClass; }
80 SvMetaClass * GetClass() const
81 { return xClass; }
84 SV_DECL_IMPL_REF(SvClassElement)
85 SV_DECL_IMPL_PERSIST_LIST(SvClassElement,SvClassElement *)
87 /******************** class SvMetaClass *********************************/
88 class SvMetaModule;
89 SV_DECL_PERSIST_LIST(SvMetaClass,SvMetaClass *)
90 class SvMetaClass : public SvMetaType
92 SvMetaAttributeMemberList aAttrList;
93 SvClassElementMemberList aClassList;
94 SvMetaClassRef aSuperClass;
95 SvBOOL aAutomation;
96 SvMetaClassRef xAutomationInterface;
98 // void FillSbxMemberObject( SvIdlDataBase & rBase,
99 // SbxObject *, StringList &,
100 // sal_Bool bVariable );
101 sal_Bool TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
102 SvMetaAttribute & rAttr ) const;
103 #ifdef IDL_COMPILER
104 void WriteSlotStubs( const ByteString & rShellName,
105 SvSlotElementList & rSlotList,
106 ByteStringList & rList,
107 SvStream & rOutStm );
108 sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase,
109 SvSlotElementList & rSlotList,
110 SvStream & rOutStm );
111 sal_uInt16 WriteSlots( const ByteString & rShellName, sal_uInt16 nCount,
112 SvSlotElementList & rSlotList,
113 SvIdlDataBase & rBase,
114 SvStream & rOutStm );
116 void InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
117 SvMetaClassList & rClassList,
118 const ByteString & rPrefix, SvIdlDataBase& rBase );
120 protected:
121 virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
122 SvTokenStream & rInStm );
123 virtual void WriteAttributesSvIdl( SvIdlDataBase & rBase,
124 SvStream & rOutStm, sal_uInt16 nTab );
125 virtual void ReadContextSvIdl( SvIdlDataBase &,
126 SvTokenStream & rInStm );
127 virtual void WriteContextSvIdl( SvIdlDataBase & rBase,
128 SvStream & rOutStm, sal_uInt16 nTab );
129 void WriteOdlMembers( ByteStringList & rSuperList,
130 sal_Bool bVariable, sal_Bool bWriteTab,
131 SvIdlDataBase & rBase,
132 SvStream & rOutStm, sal_uInt16 nTab );
133 #endif
134 public:
135 SV_DECL_META_FACTORY1( SvMetaClass, SvMetaType, 6 )
136 SvMetaClass();
138 sal_Bool GetAutomation() const
139 { return aAutomation; }
140 SvMetaClass * GetSuperClass() const
141 { return aSuperClass; }
143 void FillClasses( SvMetaClassList & rList );
144 // virtual void FillSbxObject( SvIdlDataBase & rBase, SbxObject * );
146 const SvClassElementMemberList&
147 GetClassList() const
148 { return aClassList; }
150 #ifdef IDL_COMPILER
151 virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
152 virtual void WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
153 virtual void Write( SvIdlDataBase & rBase, SvStream & rOutStm,
154 sal_uInt16 nTab,
155 WriteType, WriteAttribute = 0 );
156 virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
157 virtual void WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
158 Table* pTable );
159 virtual void WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
160 Table * pTable );
161 virtual void WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
162 virtual void WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab );
163 #endif
165 SV_IMPL_REF(SvMetaClass)
166 SV_IMPL_PERSIST_LIST(SvMetaClass,SvMetaClass *)
169 #endif // _OBJECT_HXX