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