1*f3ea6674SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f3ea6674SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f3ea6674SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f3ea6674SAndrew Rist * distributed with this work for additional information 6*f3ea6674SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f3ea6674SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f3ea6674SAndrew Rist * "License"); you may not use this file except in compliance 9*f3ea6674SAndrew Rist * with the License. You may obtain a copy of the License at 10*f3ea6674SAndrew Rist * 11*f3ea6674SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*f3ea6674SAndrew Rist * 13*f3ea6674SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f3ea6674SAndrew Rist * software distributed under the License is distributed on an 15*f3ea6674SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f3ea6674SAndrew Rist * KIND, either express or implied. See the License for the 17*f3ea6674SAndrew Rist * specific language governing permissions and limitations 18*f3ea6674SAndrew Rist * under the License. 19*f3ea6674SAndrew Rist * 20*f3ea6674SAndrew Rist *************************************************************/ 21*f3ea6674SAndrew Rist 22*f3ea6674SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _OBJECT_HXX 25cdf0e10cSrcweir #define _OBJECT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #define _SVSTDARR_ULONGS 28cdf0e10cSrcweir //#include <svtools/svstdarr.hxx> 29cdf0e10cSrcweir #include <types.hxx> 30cdf0e10cSrcweir #include <slot.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir struct SvSlotElement 33cdf0e10cSrcweir { 34cdf0e10cSrcweir SvMetaSlotRef xSlot; 35cdf0e10cSrcweir ByteString aPrefix; SvSlotElementSvSlotElement36cdf0e10cSrcweir SvSlotElement( SvMetaSlot * pS, const ByteString & rPrefix ) 37cdf0e10cSrcweir : xSlot( pS ) 38cdf0e10cSrcweir , aPrefix( rPrefix ) 39cdf0e10cSrcweir {} 40cdf0e10cSrcweir }; 41cdf0e10cSrcweir DECLARE_LIST( SvSlotElementList, SvSlotElement* ) 42cdf0e10cSrcweir class SvMetaClass; 43cdf0e10cSrcweir DECLARE_LIST( SvMetaClassList, SvMetaClass* ) 44cdf0e10cSrcweir 45cdf0e10cSrcweir class SvULongs : public List 46cdf0e10cSrcweir { 47cdf0e10cSrcweir public: Insert(sal_uLong & rId,sal_uLong nPos)48cdf0e10cSrcweir void Insert( sal_uLong& rId, sal_uLong nPos ) { sal_uLong nId(rId ); List::Insert( (void*) nId, nPos ); } Remove(sal_uLong & rId)49cdf0e10cSrcweir void Remove( sal_uLong& rId ){ sal_uLong nId(rId ); List::Remove( (void*) nId ); } GetObject(sal_uLong nPos)50cdf0e10cSrcweir sal_uLong GetObject( sal_uLong nPos ){ return (sal_uLong) List::GetObject( nPos ); } 51cdf0e10cSrcweir }; 52cdf0e10cSrcweir 53cdf0e10cSrcweir /******************** class SvClassElement *******************************/ 54cdf0e10cSrcweir SV_DECL_REF(SvMetaClass) 55cdf0e10cSrcweir class SvClassElement : public SvPersistBase 56cdf0e10cSrcweir { 57cdf0e10cSrcweir SvBOOL aAutomation; 58cdf0e10cSrcweir ByteString aPrefix; 59cdf0e10cSrcweir SvMetaClassRef xClass; 60cdf0e10cSrcweir public: 61cdf0e10cSrcweir SV_DECL_PERSIST1( SvClassElement, SvPersistBase, 1 ) 62cdf0e10cSrcweir SvClassElement(); 63cdf0e10cSrcweir SetPrefix(const ByteString & rPrefix)64cdf0e10cSrcweir void SetPrefix( const ByteString & rPrefix ) 65cdf0e10cSrcweir { aPrefix = rPrefix; } GetPrefix() const66cdf0e10cSrcweir const ByteString & GetPrefix() const 67cdf0e10cSrcweir { return aPrefix; } 68cdf0e10cSrcweir SetAutomation(sal_Bool rAutomation)69cdf0e10cSrcweir void SetAutomation( sal_Bool rAutomation ) 70cdf0e10cSrcweir { aAutomation = rAutomation; } GetAutomation() const71cdf0e10cSrcweir sal_Bool GetAutomation() const 72cdf0e10cSrcweir { return aAutomation; } 73cdf0e10cSrcweir SetClass(SvMetaClass * pClass)74cdf0e10cSrcweir void SetClass( SvMetaClass * pClass ) 75cdf0e10cSrcweir { xClass = pClass; } GetClass() const76cdf0e10cSrcweir SvMetaClass * GetClass() const 77cdf0e10cSrcweir { return xClass; } 78cdf0e10cSrcweir }; 79cdf0e10cSrcweir 80cdf0e10cSrcweir SV_DECL_IMPL_REF(SvClassElement) 81cdf0e10cSrcweir SV_DECL_IMPL_PERSIST_LIST(SvClassElement,SvClassElement *) 82cdf0e10cSrcweir 83cdf0e10cSrcweir /******************** class SvMetaClass *********************************/ 84cdf0e10cSrcweir class SvMetaModule; 85cdf0e10cSrcweir SV_DECL_PERSIST_LIST(SvMetaClass,SvMetaClass *) 86cdf0e10cSrcweir class SvMetaClass : public SvMetaType 87cdf0e10cSrcweir { 88cdf0e10cSrcweir SvMetaAttributeMemberList aAttrList; 89cdf0e10cSrcweir SvClassElementMemberList aClassList; 90cdf0e10cSrcweir SvMetaClassRef aSuperClass; 91cdf0e10cSrcweir SvBOOL aAutomation; 92cdf0e10cSrcweir SvMetaClassRef xAutomationInterface; 93cdf0e10cSrcweir 94cdf0e10cSrcweir // void FillSbxMemberObject( SvIdlDataBase & rBase, 95cdf0e10cSrcweir // SbxObject *, StringList &, 96cdf0e10cSrcweir // sal_Bool bVariable ); 97cdf0e10cSrcweir sal_Bool TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm, 98cdf0e10cSrcweir SvMetaAttribute & rAttr ) const; 99cdf0e10cSrcweir #ifdef IDL_COMPILER 100cdf0e10cSrcweir void WriteSlotStubs( const ByteString & rShellName, 101cdf0e10cSrcweir SvSlotElementList & rSlotList, 102cdf0e10cSrcweir ByteStringList & rList, 103cdf0e10cSrcweir SvStream & rOutStm ); 104cdf0e10cSrcweir sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase, 105cdf0e10cSrcweir SvSlotElementList & rSlotList, 106cdf0e10cSrcweir SvStream & rOutStm ); 107cdf0e10cSrcweir sal_uInt16 WriteSlots( const ByteString & rShellName, sal_uInt16 nCount, 108cdf0e10cSrcweir SvSlotElementList & rSlotList, 109cdf0e10cSrcweir SvIdlDataBase & rBase, 110cdf0e10cSrcweir SvStream & rOutStm ); 111cdf0e10cSrcweir 112cdf0e10cSrcweir void InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList, 113cdf0e10cSrcweir SvMetaClassList & rClassList, 114cdf0e10cSrcweir const ByteString & rPrefix, SvIdlDataBase& rBase ); 115cdf0e10cSrcweir 116cdf0e10cSrcweir protected: 117cdf0e10cSrcweir virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, 118cdf0e10cSrcweir SvTokenStream & rInStm ); 119cdf0e10cSrcweir virtual void WriteAttributesSvIdl( SvIdlDataBase & rBase, 120cdf0e10cSrcweir SvStream & rOutStm, sal_uInt16 nTab ); 121cdf0e10cSrcweir virtual void ReadContextSvIdl( SvIdlDataBase &, 122cdf0e10cSrcweir SvTokenStream & rInStm ); 123cdf0e10cSrcweir virtual void WriteContextSvIdl( SvIdlDataBase & rBase, 124cdf0e10cSrcweir SvStream & rOutStm, sal_uInt16 nTab ); 125cdf0e10cSrcweir void WriteOdlMembers( ByteStringList & rSuperList, 126cdf0e10cSrcweir sal_Bool bVariable, sal_Bool bWriteTab, 127cdf0e10cSrcweir SvIdlDataBase & rBase, 128cdf0e10cSrcweir SvStream & rOutStm, sal_uInt16 nTab ); 129cdf0e10cSrcweir #endif 130cdf0e10cSrcweir public: 131cdf0e10cSrcweir SV_DECL_META_FACTORY1( SvMetaClass, SvMetaType, 6 ) 132cdf0e10cSrcweir SvMetaClass(); 133cdf0e10cSrcweir GetAutomation() const134cdf0e10cSrcweir sal_Bool GetAutomation() const 135cdf0e10cSrcweir { return aAutomation; } GetSuperClass() const136cdf0e10cSrcweir SvMetaClass * GetSuperClass() const 137cdf0e10cSrcweir { return aSuperClass; } 138cdf0e10cSrcweir 139cdf0e10cSrcweir void FillClasses( SvMetaClassList & rList ); 140cdf0e10cSrcweir // virtual void FillSbxObject( SvIdlDataBase & rBase, SbxObject * ); 141cdf0e10cSrcweir 142cdf0e10cSrcweir const SvClassElementMemberList& GetClassList() const143cdf0e10cSrcweir GetClassList() const 144cdf0e10cSrcweir { return aClassList; } 145cdf0e10cSrcweir 146cdf0e10cSrcweir #ifdef IDL_COMPILER 147cdf0e10cSrcweir virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); 148cdf0e10cSrcweir virtual void WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab ); 149cdf0e10cSrcweir virtual void Write( SvIdlDataBase & rBase, SvStream & rOutStm, 150cdf0e10cSrcweir sal_uInt16 nTab, 151cdf0e10cSrcweir WriteType, WriteAttribute = 0 ); 152cdf0e10cSrcweir virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ); 153cdf0e10cSrcweir virtual void WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm, 154cdf0e10cSrcweir Table* pTable ); 155cdf0e10cSrcweir virtual void WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm, 156cdf0e10cSrcweir Table * pTable ); 157cdf0e10cSrcweir virtual void WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab ); 158cdf0e10cSrcweir virtual void WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab ); 159cdf0e10cSrcweir #endif 160cdf0e10cSrcweir }; 161cdf0e10cSrcweir SV_IMPL_REF(SvMetaClass) 162cdf0e10cSrcweir SV_IMPL_PERSIST_LIST(SvMetaClass,SvMetaClass *) 163cdf0e10cSrcweir 164cdf0e10cSrcweir 165cdf0e10cSrcweir #endif // _OBJECT_HXX 166cdf0e10cSrcweir 167