xref: /aoo41x/main/basic/inc/basic/sbmeth.hxx (revision 234bd5c5)
1*234bd5c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*234bd5c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*234bd5c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*234bd5c5SAndrew Rist  * distributed with this work for additional information
6*234bd5c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*234bd5c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*234bd5c5SAndrew Rist  * "License"); you may not use this file except in compliance
9*234bd5c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*234bd5c5SAndrew Rist  *
11*234bd5c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*234bd5c5SAndrew Rist  *
13*234bd5c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*234bd5c5SAndrew Rist  * software distributed under the License is distributed on an
15*234bd5c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*234bd5c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*234bd5c5SAndrew Rist  * specific language governing permissions and limitations
18*234bd5c5SAndrew Rist  * under the License.
19*234bd5c5SAndrew Rist  *
20*234bd5c5SAndrew Rist  *************************************************************/
21*234bd5c5SAndrew Rist 
22*234bd5c5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SB_SBMETH_HXX
25cdf0e10cSrcweir #define _SB_SBMETH_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/errcode.hxx>
28cdf0e10cSrcweir #include <basic/sbxmeth.hxx>
29cdf0e10cSrcweir #include <basic/sbdef.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class SbModule;
32cdf0e10cSrcweir class SbMethodImpl;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir class SbMethod : public SbxMethod
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 	friend class SbiRuntime;
37cdf0e10cSrcweir 	friend class SbiFactory;
38cdf0e10cSrcweir 	friend class SbModule;
39cdf0e10cSrcweir 	friend class SbClassModuleObject;
40cdf0e10cSrcweir 	friend class SbiCodeGen;
41cdf0e10cSrcweir 	friend class SbJScriptMethod;
42cdf0e10cSrcweir 	friend class SbIfaceMapperMethod;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	SbMethodImpl* mpSbMethodImpl;			// Impl data
45cdf0e10cSrcweir 	SbModule* pMod;
46cdf0e10cSrcweir 	sal_uInt16    nDebugFlags;
47cdf0e10cSrcweir 	sal_uInt16	  nLine1, nLine2;
48cdf0e10cSrcweir 	sal_uInt32	  nStart;
49cdf0e10cSrcweir 	sal_Bool	  bInvalid;
50cdf0e10cSrcweir 	SbxArrayRef refStatics;
51cdf0e10cSrcweir 	SbMethod( const String&, SbxDataType, SbModule* );
52cdf0e10cSrcweir 	SbMethod( const SbMethod& );
53cdf0e10cSrcweir 	virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
54cdf0e10cSrcweir 	virtual sal_Bool StoreData( SvStream& ) const;
55cdf0e10cSrcweir 	virtual ~SbMethod();
56cdf0e10cSrcweir 
57cdf0e10cSrcweir public:
58cdf0e10cSrcweir 	SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMETHOD,2);
59cdf0e10cSrcweir 	TYPEINFO();
60cdf0e10cSrcweir 	virtual SbxInfo* GetInfo();
61cdf0e10cSrcweir 	SbxArray* GetLocals();
62cdf0e10cSrcweir 	SbxArray* GetStatics();
63cdf0e10cSrcweir 	void      ClearStatics();
GetModule()64cdf0e10cSrcweir 	SbModule* GetModule() 				 { return pMod; 	   }
GetId() const65cdf0e10cSrcweir 	sal_uInt32	  GetId() const				 { return nStart;	   }
GetDebugFlags()66cdf0e10cSrcweir 	sal_uInt16    GetDebugFlags()			 { return nDebugFlags; }
SetDebugFlags(sal_uInt16 n)67cdf0e10cSrcweir 	void 	  SetDebugFlags( sal_uInt16 n )  { nDebugFlags = n;    }
68cdf0e10cSrcweir 	void 	  GetLineRange( sal_uInt16&, sal_uInt16& );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	// Schnittstelle zum Ausfuehren einer Methode aus den Applikationen
71cdf0e10cSrcweir 	virtual ErrCode Call( SbxValue* pRet = NULL );
72cdf0e10cSrcweir 	virtual void Broadcast( sal_uIntPtr nHintId );
73cdf0e10cSrcweir };
74cdf0e10cSrcweir 
75cdf0e10cSrcweir #ifndef __SB_SBMETHODREF_HXX
76cdf0e10cSrcweir #define __SB_SBMETHODREF_HXX
77cdf0e10cSrcweir SV_DECL_IMPL_REF(SbMethod)
78cdf0e10cSrcweir #endif
79cdf0e10cSrcweir 
80cdf0e10cSrcweir class SbIfaceMapperMethod : public SbMethod
81cdf0e10cSrcweir {
82cdf0e10cSrcweir 	friend class SbiRuntime;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	SbMethodRef mxImplMeth;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir public:
87cdf0e10cSrcweir 	TYPEINFO();
SbIfaceMapperMethod(const String & rName,SbMethod * pImplMeth)88cdf0e10cSrcweir 	SbIfaceMapperMethod( const String& rName, SbMethod* pImplMeth )
89cdf0e10cSrcweir 		: SbMethod( rName, pImplMeth->GetType(), NULL )
90cdf0e10cSrcweir 		, mxImplMeth( pImplMeth )
91cdf0e10cSrcweir 	{}
92cdf0e10cSrcweir 	virtual ~SbIfaceMapperMethod();
getImplMethod(void)93cdf0e10cSrcweir 	SbMethod* getImplMethod( void )
94cdf0e10cSrcweir 		{ return mxImplMeth; }
95cdf0e10cSrcweir };
96cdf0e10cSrcweir 
97cdf0e10cSrcweir #endif
98