LibreOffice Module basic (master) 1
sbmeth.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_BASIC_SBMETH_HXX
21#define INCLUDED_BASIC_SBMETH_HXX
22
24#include <basic/sbxmeth.hxx>
25#include <basic/sbdef.hxx>
26#include <basic/basicdllapi.h>
27
28class SbModule;
29
31{
32 friend class SbiRuntime;
33 friend class SbiFactory;
34 friend class SbModule;
35 friend class SbClassModuleObject;
36 friend class SbiCodeGen;
37 friend class SbJScriptMethod;
38 friend class SbIfaceMapperMethod;
39
40 SbxVariable* mCaller; // caller
43 sal_uInt16 nLine1, nLine2;
44 sal_uInt32 nStart;
47 BASIC_DLLPRIVATE SbMethod( const OUString&, SbxDataType, SbModule* );
49 virtual bool LoadData( SvStream&, sal_uInt16 ) override;
50 virtual std::pair<bool, sal_uInt32> StoreData( SvStream& ) const override;
51 virtual ~SbMethod() override;
52
53public:
55 virtual SbxInfo* GetInfo() override;
57 void ClearStatics();
58 SbModule* GetModule() { return pMod; }
61 void GetLineRange( sal_uInt16&, sal_uInt16& );
62
63 // Interface to execute a method from the applications
64 ErrCode Call( SbxValue* pRet, SbxVariable* pCaller = nullptr );
65 virtual void Broadcast( SfxHintId nHintId ) override;
66};
67
69
70class SbIfaceMapperMethod final : public SbMethod
71{
72 friend class SbiRuntime;
73
75
76public:
77 SbIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth )
78 : SbMethod( rName, pImplMeth->GetType(), nullptr )
79 , mxImplMeth( pImplMeth )
80 {}
81 virtual ~SbIfaceMapperMethod() override;
83 { return mxImplMeth.get(); }
84};
85
86#endif
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASIC_DLLPRIVATE
Definition: basicdllapi.h:19
#define BASIC_DLLPUBLIC
Definition: basicdllapi.h:17
virtual ~SbIfaceMapperMethod() override
Definition: sbxmod.cxx:587
SbIfaceMapperMethod(const OUString &rName, SbMethod *pImplMeth)
Definition: sbmeth.hxx:77
SbMethod * getImplMethod()
Definition: sbmeth.hxx:82
SbMethodRef mxImplMeth
Definition: sbmeth.hxx:74
sal_uInt16 nLine2
Definition: sbmeth.hxx:43
SbModule * GetModule()
Definition: sbmeth.hxx:58
sal_uInt16 nLine1
Definition: sbmeth.hxx:43
virtual ~SbMethod() override
Definition: sbxmod.cxx:1961
ErrCode Call(SbxValue *pRet, SbxVariable *pCaller=nullptr)
Definition: sbxmod.cxx:2054
SbxArrayRef refStatics
Definition: sbmeth.hxx:46
SbxVariable * mCaller
Definition: sbmeth.hxx:40
BasicDebugFlags GetDebugFlags() const
Definition: sbmeth.hxx:59
SbxArray * GetStatics()
Definition: sbxmod.cxx:1970
bool bInvalid
Definition: sbmeth.hxx:45
SBX_DECL_PERSIST_NODATA(SBXID_BASICMETHOD, 2)
sal_uInt32 nStart
Definition: sbmeth.hxx:44
void SetDebugFlags(BasicDebugFlags n)
Definition: sbmeth.hxx:60
void ClearStatics()
Definition: sbxmod.cxx:1965
SbModule * pMod
Definition: sbmeth.hxx:41
BasicDebugFlags nDebugFlags
Definition: sbmeth.hxx:42
void GetLineRange(sal_uInt16 &, sal_uInt16 &)
Definition: sbxmod.cxx:2039
Definition: sbx.hxx:95
virtual bool LoadData(SvStream &, sal_uInt16) override
Definition: sbxvar.cxx:409
virtual void Broadcast(SfxHintId nHintId) override
Definition: sbxvar.cxx:120
virtual SbxDataType GetType() const override
Definition: sbxvar.cxx:321
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
Definition: sbxvar.cxx:519
virtual SbxInfo * GetInfo()
Definition: sbxvar.cxx:160
friend class SbMethod
Definition: sbxvar.hxx:244
T * get() const
SfxHintId
sal_Int64 n
BasicDebugFlags
Definition: sbdef.hxx:46
#define SBXID_BASICMETHOD
Definition: sbdef.hxx:61
tools::SvRef< SbMethod > SbMethodRef
Definition: sbmeth.hxx:68
SbxDataType
Definition: sbxdef.hxx:37