LibreOffice Module basic (master) 1
sbxobj.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_SBXOBJ_HXX
21#define INCLUDED_BASIC_SBXOBJ_HXX
22
23#include <svl/lstner.hxx>
24#include <basic/sbxvar.hxx>
25#include <basic/basicdllapi.h>
26
27
28class SbxProperty;
29
31{
32 BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable const *, sal_uInt32& );
33protected:
35 SbxArrayRef pProps; // Properties
36 SbxArrayRef pObjs; // Objects
37 SbxProperty* pDfltProp; // Default-Property
38 OUString aClassName; // Classname
39 OUString aDfltPropName;
40 virtual bool LoadData( SvStream&, sal_uInt16 ) override;
41 virtual std::pair<bool, sal_uInt32> StoreData( SvStream& ) const override;
42 virtual ~SbxObject() override;
43 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
44 virtual bool IsOptionCompatible() const; // Module's Option Compatible
45
46public:
48 SbxObject( const OUString& rClassname );
49 SbxObject( const SbxObject& );
50 SbxObject& operator=( const SbxObject& );
51 virtual SbxDataType GetType() const override;
52 virtual SbxClassType GetClass() const override;
53 virtual void Clear() override;
54
55 virtual bool IsClass( const OUString& ) const;
56 const OUString& GetClassName() const { return aClassName; }
57 void SetClassName( const OUString &rNew ) { aClassName = rNew; }
58 // Default-Property
59 SbxProperty* GetDfltProperty();
60 void SetDfltProperty( const OUString& r );
61 // Search for an element
62 virtual SbxVariable* Find( const OUString&, SbxClassType );
63 SbxVariable* FindQualified( const OUString&, SbxClassType );
64 // Quick-Call-Interface for Methods
65 virtual bool Call( const OUString&, SbxArray* = nullptr );
66 // Execution of DDE-Commands
67 SbxVariable* Execute( const OUString& );
68 // Manage elements
69 SbxVariable* Make( const OUString&, SbxClassType, SbxDataType, bool bIsRuntimeFunction = false );
70 virtual void Insert( SbxVariable* );
71 // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and
72 // without Broadcasts, only used in SO2/auto.cxx
73 void QuickInsert( SbxVariable* );
74 void Remove( const OUString&, SbxClassType );
75 virtual void Remove( SbxVariable* );
76
77 // Direct access on arrays
78 SbxArray* GetMethods() { return pMethods.get(); }
79 SbxArray* GetProperties() { return pProps.get(); }
80 SbxArray* GetObjects() { return pObjs.get(); }
81 // Debugging
82 void Dump( SvStream&, bool bDumpAll );
83};
84
85#endif // INCLUDED_BASIC_SBXOBJ_HXX
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASIC_DLLPRIVATE
Definition: basicdllapi.h:19
#define BASIC_DLLPUBLIC
Definition: basicdllapi.h:17
Definition: sbx.hxx:95
SbxArray * GetProperties()
Definition: sbxobj.hxx:79
SbxArrayRef pObjs
Definition: sbxobj.hxx:36
SbxArray * GetObjects()
Definition: sbxobj.hxx:80
const OUString & GetClassName() const
Definition: sbxobj.hxx:56
void SetClassName(const OUString &rNew)
Definition: sbxobj.hxx:57
SBX_DECL_PERSIST_NODATA(SBXID_OBJECT, 1)
SbxArray * GetMethods()
Definition: sbxobj.hxx:78
OUString aDfltPropName
Definition: sbxobj.hxx:39
SbxArrayRef pMethods
Definition: sbxobj.hxx:34
OUString aClassName
Definition: sbxobj.hxx:38
SbxProperty * pDfltProp
Definition: sbxobj.hxx:37
SbxArrayRef pProps
Definition: sbxobj.hxx:35
virtual void Clear() override
Definition: sbxvalue.cxx:146
SbxVariable & operator=(const SbxVariable &)
Definition: sbxvar.cxx:295
virtual SbxClassType GetClass() const
Definition: sbxvar.cxx:337
virtual bool LoadData(SvStream &, sal_uInt16) override
Definition: sbxvar.cxx:409
virtual SbxDataType GetType() const override
Definition: sbxvar.cxx:321
void Dump(SvStream &, bool bDumpAll)
Definition: sbxvar.cxx:572
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
Definition: sbxvar.cxx:519
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
T * get() const
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
Call
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
SbxDataType
Definition: sbxdef.hxx:37
SbxClassType
Definition: sbxdef.hxx:27
constexpr auto SBXID_OBJECT
Definition: sbxdef.hxx:173