2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-17 12:30:48 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-04-11 11:55:16 +00:00
|
|
|
|
2013-10-23 19:18:27 +02:00
|
|
|
#ifndef INCLUDED_BASIC_SBXOBJ_HXX
|
|
|
|
#define INCLUDED_BASIC_SBXOBJ_HXX
|
2007-04-11 11:55:16 +00:00
|
|
|
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/lstner.hxx>
|
2007-04-11 11:55:16 +00:00
|
|
|
#include <basic/sbxvar.hxx>
|
2013-11-09 13:29:54 -06:00
|
|
|
#include <basic/basicdllapi.h>
|
2007-04-11 11:55:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SbxProperty;
|
|
|
|
|
2011-07-28 18:17:31 +02:00
|
|
|
class BASIC_DLLPUBLIC SbxObject : public SbxVariable, public SfxListener
|
2007-04-11 11:55:16 +00:00
|
|
|
{
|
2017-07-20 10:08:03 +02:00
|
|
|
BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable const *, sal_uInt16& );
|
2007-04-11 11:55:16 +00:00
|
|
|
protected:
|
2009-04-25 00:18:20 +00:00
|
|
|
SbxArrayRef pMethods; // Methods
|
|
|
|
SbxArrayRef pProps; // Properties
|
|
|
|
SbxArrayRef pObjs; // Objects
|
|
|
|
SbxProperty* pDfltProp; // Default-Property
|
2012-11-06 23:34:23 -06:00
|
|
|
OUString aClassName; // Classname
|
|
|
|
OUString aDfltPropName;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool LoadData( SvStream&, sal_uInt16 ) override;
|
|
|
|
virtual bool StoreData( SvStream& ) const override;
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SbxObject() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
|
2007-04-11 11:55:16 +00:00
|
|
|
public:
|
2016-08-28 11:52:53 +02:00
|
|
|
SBX_DECL_PERSIST_NODATA(SBXID_OBJECT,1);
|
2012-11-06 23:34:23 -06:00
|
|
|
SbxObject( const OUString& rClassname );
|
2007-04-11 11:55:16 +00:00
|
|
|
SbxObject( const SbxObject& );
|
|
|
|
SbxObject& operator=( const SbxObject& );
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual SbxDataType GetType() const override;
|
|
|
|
virtual SbxClassType GetClass() const override;
|
|
|
|
virtual void Clear() override;
|
2007-04-11 11:55:16 +00:00
|
|
|
|
2014-04-04 09:57:50 +02:00
|
|
|
virtual bool IsClass( const OUString& ) const;
|
2012-11-06 23:34:23 -06:00
|
|
|
const OUString& GetClassName() const { return aClassName; }
|
|
|
|
void SetClassName( const OUString &rNew ) { aClassName = rNew; }
|
2007-04-11 11:55:16 +00:00
|
|
|
// Default-Property
|
|
|
|
SbxProperty* GetDfltProperty();
|
2012-11-06 23:34:23 -06:00
|
|
|
void SetDfltProperty( const OUString& r );
|
2009-04-25 00:18:20 +00:00
|
|
|
// Search for an element
|
2011-01-10 14:40:57 +01:00
|
|
|
virtual SbxVariable* FindUserData( sal_uInt32 nUserData );
|
2012-11-06 23:34:23 -06:00
|
|
|
virtual SbxVariable* Find( const OUString&, SbxClassType );
|
|
|
|
SbxVariable* FindQualified( const OUString&, SbxClassType );
|
2009-04-25 00:18:20 +00:00
|
|
|
// Quick-Call-Interface for Methods
|
2015-11-10 10:10:36 +01:00
|
|
|
virtual bool Call( const OUString&, SbxArray* = nullptr );
|
2009-04-25 00:18:20 +00:00
|
|
|
// Execution of DDE-Commands
|
2012-11-06 23:34:23 -06:00
|
|
|
SbxVariable* Execute( const OUString& );
|
2009-04-25 00:18:20 +00:00
|
|
|
// Manage elements
|
2015-01-08 16:28:11 +00:00
|
|
|
SbxVariable* Make( const OUString&, SbxClassType, SbxDataType, bool bIsRuntimeFunction = false );
|
2007-04-11 11:55:16 +00:00
|
|
|
virtual void Insert( SbxVariable* );
|
2009-04-25 00:18:20 +00:00
|
|
|
// AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and
|
|
|
|
// without Broadcasts, only used in SO2/auto.cxx
|
2007-04-11 11:55:16 +00:00
|
|
|
void QuickInsert( SbxVariable* );
|
2015-01-20 12:38:10 +02:00
|
|
|
void Remove( const OUString&, SbxClassType );
|
2007-04-11 11:55:16 +00:00
|
|
|
virtual void Remove( SbxVariable* );
|
|
|
|
|
2009-04-25 00:18:20 +00:00
|
|
|
// Direct access on arrays
|
2016-10-05 22:00:51 +02:00
|
|
|
SbxArray* GetMethods() { return pMethods.get(); }
|
|
|
|
SbxArray* GetProperties() { return pProps.get(); }
|
|
|
|
SbxArray* GetObjects() { return pObjs.get(); }
|
2007-04-11 11:55:16 +00:00
|
|
|
// Debugging
|
2016-07-25 13:32:04 +02:00
|
|
|
void Dump( SvStream&, bool bDumpAll );
|
2007-04-11 11:55:16 +00:00
|
|
|
};
|
|
|
|
|
2013-10-23 19:18:27 +02:00
|
|
|
#endif // INCLUDED_BASIC_SBXOBJ_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|