1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: object.hxx,v $
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 ************************************************************************/
34 #define _SVSTDARR_ULONGS
35 //#include <svtools/svstdarr.hxx>
43 SvSlotElement( SvMetaSlot
* pS
, const ByteString
& rPrefix
)
48 DECLARE_LIST( SvSlotElementList
, SvSlotElement
* )
50 DECLARE_LIST( SvMetaClassList
, SvMetaClass
* )
52 class SvULongs
: public List
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
66 SvMetaClassRef xClass
;
68 SV_DECL_PERSIST1( SvClassElement
, SvPersistBase
, 1 )
71 void SetPrefix( const ByteString
& rPrefix
)
72 { aPrefix
= rPrefix
; }
73 const ByteString
& GetPrefix() const
76 void SetAutomation( BOOL rAutomation
)
77 { aAutomation
= rAutomation
; }
78 BOOL
GetAutomation() const
79 { return aAutomation
; }
81 void SetClass( SvMetaClass
* pClass
)
83 SvMetaClass
* GetClass() const
87 SV_DECL_IMPL_REF(SvClassElement
)
88 SV_DECL_IMPL_PERSIST_LIST(SvClassElement
,SvClassElement
*)
90 /******************** class SvMetaClass *********************************/
92 SV_DECL_PERSIST_LIST(SvMetaClass
,SvMetaClass
*)
93 class SvMetaClass
: public SvMetaType
95 SvMetaAttributeMemberList aAttrList
;
96 SvClassElementMemberList aClassList
;
97 SvMetaClassRef aSuperClass
;
99 SvMetaClassRef xAutomationInterface
;
101 // void FillSbxMemberObject( SvIdlDataBase & rBase,
102 // SbxObject *, StringList &,
104 BOOL
TestAttribute( SvIdlDataBase
& rBase
, SvTokenStream
& rInStm
,
105 SvMetaAttribute
& rAttr
) const;
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
);
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
);
138 SV_DECL_META_FACTORY1( SvMetaClass
, SvMetaType
, 6 )
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
&
151 { return aClassList
; }
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
,
158 WriteType
, WriteAttribute
= 0 );
159 virtual void WriteSfx( SvIdlDataBase
& rBase
, SvStream
& rOutStm
);
160 virtual void WriteHelpIds( SvIdlDataBase
& rBase
, SvStream
& rOutStm
,
162 virtual void WriteSrc( SvIdlDataBase
& rBase
, SvStream
& rOutStm
,
164 virtual void WriteCxx( SvIdlDataBase
& rBase
, SvStream
& rOutStm
, USHORT nTab
);
165 virtual void WriteHxx( SvIdlDataBase
& rBase
, SvStream
& rOutStm
, USHORT nTab
);
168 SV_IMPL_REF(SvMetaClass
)
169 SV_IMPL_PERSIST_LIST(SvMetaClass
,SvMetaClass
*)
172 #endif // _OBJECT_HXX