merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_basic / sbxobj.hxx
blob03690e038c9aa3a7cbb03ee083e221b380678ed1
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: sbxobj.hxx,v $
10 * $Revision: 1.5 $
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 _SBX_SBXOBJECT_HXX
32 #define _SBX_SBXOBJECT_HXX
34 #ifndef _SFXLSTNER_HXX
35 #include <bf_svtools/lstner.hxx>
36 #endif
38 #ifndef _SBXVAR_HXX
39 #include "sbxvar.hxx"
40 #endif
42 ///////////////////////////////////////////////////////////////////////////
44 class SvDispatch;
46 namespace binfilter {
48 class SbxProperty;
49 class SbxObjectImpl;
51 class SbxObject : public SbxVariable, public SfxListener
53 SbxObjectImpl* mpSbxObjectImpl; // Impl data
55 SbxArray* FindVar( SbxVariable*, USHORT& );
56 protected:
57 SbxArrayRef pMethods; // Methoden
58 SbxArrayRef pProps; // Properties
59 SbxArrayRef pObjs; // Objekte
60 SbxProperty* pDfltProp; // Default-Property
61 String aClassName; // Klassenname
62 String aDfltPropName;
63 virtual BOOL LoadData( SvStream&, USHORT );
64 virtual BOOL StoreData( SvStream& ) const;
65 virtual ~SbxObject();
66 virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
67 const SfxHint& rHint, const TypeId& rHintType );
68 public:
69 SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_OBJECT,1);
70 TYPEINFO();
71 SbxObject( const String& rClassname );
72 SbxObject( const SbxObject& );
73 SbxObject& operator=( const SbxObject& );
74 virtual SbxDataType GetType() const;
75 virtual SbxClassType GetClass() const;
76 virtual void Clear();
78 virtual BOOL IsClass( const String& ) const;
79 const String& GetClassName() const { return aClassName; }
80 void SetClassName( const String &rNew ) { aClassName = rNew; }
81 // Default-Property
82 SbxProperty* GetDfltProperty();
83 // Suchen eines Elements
84 virtual SbxVariable* FindUserData( UINT32 nUserData );
85 virtual SbxVariable* Find( const String&, SbxClassType );
86 SbxVariable* FindQualified( const String&, SbxClassType );
87 // Quick-Call-Interface fuer Methoden
88 virtual BOOL Call( const String&, SbxArray* = NULL );
89 // Execution von DDE-Kommandos
90 SbxVariable* Execute( const String& );
91 // Elemente verwalten
92 virtual BOOL GetAll( SbxClassType ) { return TRUE; }
93 SbxVariable* Make( const String&, SbxClassType, SbxDataType );
94 virtual SbxObject* MakeObject( const String&, const String& );
95 virtual void Insert( SbxVariable* );
96 // AB 23.4.1997, Optimierung, Einfuegen ohne Ueberpruefung auf doppelte
97 // Eintraege und ohne Broadcasts, wird nur in SO2/auto.cxx genutzt
98 void QuickInsert( SbxVariable* );
99 virtual void Remove( const String&, SbxClassType );
100 virtual void Remove( SbxVariable* );
102 // Makro-Recording
103 virtual String GenerateSource( const String &rLinePrefix,
104 const SbxObject *pRelativeTo );
105 // Direktzugriff auf die Arrays
106 SbxArray* GetMethods() { return pMethods; }
107 SbxArray* GetProperties() { return pProps; }
108 SbxArray* GetObjects() { return pObjs; }
109 // Hooks
110 virtual SvDispatch* GetSvDispatch();
111 // Debugging
112 void Dump( SvStream&, BOOL bDumpAll=FALSE );
115 #ifndef __SBX_SBXOBJECTREF_HXX
117 #ifndef SBX_OBJECT_DECL_DEFINED
118 #define SBX_OBJECT_DECL_DEFINED
119 SV_DECL_REF(SbxObject)
120 #endif
121 SV_IMPL_REF(SbxObject)
123 #endif /* __SBX_SBXOBJECTREF_HXX */
127 #endif /* _SBX_SBXOBJECT_HXX */