1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _OBJECT_HXX 29*cdf0e10cSrcweir #define _OBJECT_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #define _SVSTDARR_ULONGS 32*cdf0e10cSrcweir //#include <svtools/svstdarr.hxx> 33*cdf0e10cSrcweir #include <types.hxx> 34*cdf0e10cSrcweir #include <slot.hxx> 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir struct SvSlotElement 37*cdf0e10cSrcweir { 38*cdf0e10cSrcweir SvMetaSlotRef xSlot; 39*cdf0e10cSrcweir ByteString aPrefix; 40*cdf0e10cSrcweir SvSlotElement( SvMetaSlot * pS, const ByteString & rPrefix ) 41*cdf0e10cSrcweir : xSlot( pS ) 42*cdf0e10cSrcweir , aPrefix( rPrefix ) 43*cdf0e10cSrcweir {} 44*cdf0e10cSrcweir }; 45*cdf0e10cSrcweir DECLARE_LIST( SvSlotElementList, SvSlotElement* ) 46*cdf0e10cSrcweir class SvMetaClass; 47*cdf0e10cSrcweir DECLARE_LIST( SvMetaClassList, SvMetaClass* ) 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir class SvULongs : public List 50*cdf0e10cSrcweir { 51*cdf0e10cSrcweir public: 52*cdf0e10cSrcweir void Insert( sal_uLong& rId, sal_uLong nPos ) { sal_uLong nId(rId ); List::Insert( (void*) nId, nPos ); } 53*cdf0e10cSrcweir void Remove( sal_uLong& rId ){ sal_uLong nId(rId ); List::Remove( (void*) nId ); } 54*cdf0e10cSrcweir sal_uLong GetObject( sal_uLong nPos ){ return (sal_uLong) List::GetObject( nPos ); } 55*cdf0e10cSrcweir }; 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir /******************** class SvClassElement *******************************/ 58*cdf0e10cSrcweir SV_DECL_REF(SvMetaClass) 59*cdf0e10cSrcweir class SvClassElement : public SvPersistBase 60*cdf0e10cSrcweir { 61*cdf0e10cSrcweir SvBOOL aAutomation; 62*cdf0e10cSrcweir ByteString aPrefix; 63*cdf0e10cSrcweir SvMetaClassRef xClass; 64*cdf0e10cSrcweir public: 65*cdf0e10cSrcweir SV_DECL_PERSIST1( SvClassElement, SvPersistBase, 1 ) 66*cdf0e10cSrcweir SvClassElement(); 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir void SetPrefix( const ByteString & rPrefix ) 69*cdf0e10cSrcweir { aPrefix = rPrefix; } 70*cdf0e10cSrcweir const ByteString & GetPrefix() const 71*cdf0e10cSrcweir { return aPrefix; } 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir void SetAutomation( sal_Bool rAutomation ) 74*cdf0e10cSrcweir { aAutomation = rAutomation; } 75*cdf0e10cSrcweir sal_Bool GetAutomation() const 76*cdf0e10cSrcweir { return aAutomation; } 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir void SetClass( SvMetaClass * pClass ) 79*cdf0e10cSrcweir { xClass = pClass; } 80*cdf0e10cSrcweir SvMetaClass * GetClass() const 81*cdf0e10cSrcweir { return xClass; } 82*cdf0e10cSrcweir }; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir SV_DECL_IMPL_REF(SvClassElement) 85*cdf0e10cSrcweir SV_DECL_IMPL_PERSIST_LIST(SvClassElement,SvClassElement *) 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir /******************** class SvMetaClass *********************************/ 88*cdf0e10cSrcweir class SvMetaModule; 89*cdf0e10cSrcweir SV_DECL_PERSIST_LIST(SvMetaClass,SvMetaClass *) 90*cdf0e10cSrcweir class SvMetaClass : public SvMetaType 91*cdf0e10cSrcweir { 92*cdf0e10cSrcweir SvMetaAttributeMemberList aAttrList; 93*cdf0e10cSrcweir SvClassElementMemberList aClassList; 94*cdf0e10cSrcweir SvMetaClassRef aSuperClass; 95*cdf0e10cSrcweir SvBOOL aAutomation; 96*cdf0e10cSrcweir SvMetaClassRef xAutomationInterface; 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir // void FillSbxMemberObject( SvIdlDataBase & rBase, 99*cdf0e10cSrcweir // SbxObject *, StringList &, 100*cdf0e10cSrcweir // sal_Bool bVariable ); 101*cdf0e10cSrcweir sal_Bool TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm, 102*cdf0e10cSrcweir SvMetaAttribute & rAttr ) const; 103*cdf0e10cSrcweir #ifdef IDL_COMPILER 104*cdf0e10cSrcweir void WriteSlotStubs( const ByteString & rShellName, 105*cdf0e10cSrcweir SvSlotElementList & rSlotList, 106*cdf0e10cSrcweir ByteStringList & rList, 107*cdf0e10cSrcweir SvStream & rOutStm ); 108*cdf0e10cSrcweir sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase, 109*cdf0e10cSrcweir SvSlotElementList & rSlotList, 110*cdf0e10cSrcweir SvStream & rOutStm ); 111*cdf0e10cSrcweir sal_uInt16 WriteSlots( const ByteString & rShellName, sal_uInt16 nCount, 112*cdf0e10cSrcweir SvSlotElementList & rSlotList, 113*cdf0e10cSrcweir SvIdlDataBase & rBase, 114*cdf0e10cSrcweir SvStream & rOutStm ); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir void InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList, 117*cdf0e10cSrcweir SvMetaClassList & rClassList, 118*cdf0e10cSrcweir const ByteString & rPrefix, SvIdlDataBase& rBase ); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir protected: 121*cdf0e10cSrcweir virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, 122*cdf0e10cSrcweir SvTokenStream & rInStm ); 123*cdf0e10cSrcweir virtual void WriteAttributesSvIdl( SvIdlDataBase & rBase, 124*cdf0e10cSrcweir SvStream & rOutStm, sal_uInt16 nTab ); 125*cdf0e10cSrcweir virtual void ReadContextSvIdl( SvIdlDataBase &, 126*cdf0e10cSrcweir SvTokenStream & rInStm ); 127*cdf0e10cSrcweir virtual void WriteContextSvIdl( SvIdlDataBase & rBase, 128*cdf0e10cSrcweir SvStream & rOutStm, sal_uInt16 nTab ); 129*cdf0e10cSrcweir void WriteOdlMembers( ByteStringList & rSuperList, 130*cdf0e10cSrcweir sal_Bool bVariable, sal_Bool bWriteTab, 131*cdf0e10cSrcweir SvIdlDataBase & rBase, 132*cdf0e10cSrcweir SvStream & rOutStm, sal_uInt16 nTab ); 133*cdf0e10cSrcweir #endif 134*cdf0e10cSrcweir public: 135*cdf0e10cSrcweir SV_DECL_META_FACTORY1( SvMetaClass, SvMetaType, 6 ) 136*cdf0e10cSrcweir SvMetaClass(); 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir sal_Bool GetAutomation() const 139*cdf0e10cSrcweir { return aAutomation; } 140*cdf0e10cSrcweir SvMetaClass * GetSuperClass() const 141*cdf0e10cSrcweir { return aSuperClass; } 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir void FillClasses( SvMetaClassList & rList ); 144*cdf0e10cSrcweir // virtual void FillSbxObject( SvIdlDataBase & rBase, SbxObject * ); 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir const SvClassElementMemberList& 147*cdf0e10cSrcweir GetClassList() const 148*cdf0e10cSrcweir { return aClassList; } 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir #ifdef IDL_COMPILER 151*cdf0e10cSrcweir virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); 152*cdf0e10cSrcweir virtual void WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab ); 153*cdf0e10cSrcweir virtual void Write( SvIdlDataBase & rBase, SvStream & rOutStm, 154*cdf0e10cSrcweir sal_uInt16 nTab, 155*cdf0e10cSrcweir WriteType, WriteAttribute = 0 ); 156*cdf0e10cSrcweir virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm ); 157*cdf0e10cSrcweir virtual void WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm, 158*cdf0e10cSrcweir Table* pTable ); 159*cdf0e10cSrcweir virtual void WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm, 160*cdf0e10cSrcweir Table * pTable ); 161*cdf0e10cSrcweir virtual void WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab ); 162*cdf0e10cSrcweir virtual void WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab ); 163*cdf0e10cSrcweir #endif 164*cdf0e10cSrcweir }; 165*cdf0e10cSrcweir SV_IMPL_REF(SvMetaClass) 166*cdf0e10cSrcweir SV_IMPL_PERSIST_LIST(SvMetaClass,SvMetaClass *) 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir #endif // _OBJECT_HXX 170*cdf0e10cSrcweir 171