tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / include / basic / sbxobj.hxx
blob234d73d1b78b555cf564fd91ae03a3e5c573084f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <svl/lstner.hxx>
23 #include <basic/sbxvar.hxx>
24 #include <basic/basicdllapi.h>
27 class SbxProperty;
29 class BASIC_DLLPUBLIC SbxObject : public SbxVariable, public SfxListener
31 BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable const *, sal_uInt32& );
32 protected:
33 SbxArrayRef pMethods; // Methods
34 SbxArrayRef pProps; // Properties
35 SbxArrayRef pObjs; // Objects
36 SbxProperty* pDfltProp; // Default-Property
37 OUString aClassName; // Classname
38 OUString aDfltPropName;
39 SAL_DLLPRIVATE virtual bool LoadData( SvStream&, sal_uInt16 ) override;
40 SAL_DLLPRIVATE virtual std::pair<bool, sal_uInt32> StoreData( SvStream& ) const override;
41 SAL_DLLPRIVATE virtual ~SbxObject() override;
42 SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
43 SAL_DLLPRIVATE virtual bool IsOptionCompatible() const; // Module's Option Compatible
45 public:
46 SBX_DECL_PERSIST_NODATA(SBXID_OBJECT,1);
47 SAL_DLLPRIVATE SbxObject( const OUString& rClassname );
48 SAL_DLLPRIVATE SbxObject( const SbxObject& );
49 SAL_DLLPRIVATE SbxObject& operator=( const SbxObject& );
50 SAL_DLLPRIVATE virtual SbxDataType GetType() const override;
51 SAL_DLLPRIVATE virtual SbxClassType GetClass() const override;
52 SAL_DLLPRIVATE virtual void Clear() override;
54 SAL_DLLPRIVATE virtual bool IsClass( const OUString& ) const;
55 const OUString& GetClassName() const { return aClassName; }
56 void SetClassName( const OUString &rNew ) { aClassName = rNew; }
57 // Default-Property
58 SAL_DLLPRIVATE SbxProperty* GetDfltProperty();
59 SAL_DLLPRIVATE void SetDfltProperty( const OUString& r );
60 // Search for an element
61 SAL_DLLPRIVATE virtual SbxVariable* Find( const OUString&, SbxClassType );
62 SAL_DLLPRIVATE SbxVariable* FindQualified( const OUString&, SbxClassType );
63 // Quick-Call-Interface for Methods
64 SAL_DLLPRIVATE virtual bool Call( const OUString&, SbxArray* = nullptr );
65 // Execution of DDE-Commands
66 SbxVariable* Execute( const OUString& );
67 // Manage elements
68 SAL_DLLPRIVATE SbxVariable* Make( const OUString&, SbxClassType, SbxDataType, bool bIsRuntimeFunction = false );
69 SAL_DLLPRIVATE virtual void Insert( SbxVariable* );
70 // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and
71 // without Broadcasts, only used in SO2/auto.cxx
72 SAL_DLLPRIVATE void QuickInsert( SbxVariable* );
73 SAL_DLLPRIVATE void Remove( const OUString&, SbxClassType );
74 SAL_DLLPRIVATE virtual void Remove( SbxVariable* );
76 // Direct access on arrays
77 SbxArray* GetMethods() { return pMethods.get(); }
78 SbxArray* GetProperties() { return pProps.get(); }
79 SbxArray* GetObjects() { return pObjs.get(); }
80 // Debugging
81 SAL_DLLPRIVATE void Dump( SvStream&, bool bDumpAll );
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */