Branch data Line data Source code
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 _SBX_SBXOBJECT_HXX
21 : : #define _SBX_SBXOBJECT_HXX
22 : :
23 : : #include <svl/lstner.hxx>
24 : : #include <basic/sbxvar.hxx>
25 : : #include "basicdllapi.h"
26 : :
27 : :
28 : : class SbxProperty;
29 : :
30 : : class SbxObjectImpl;
31 : :
32 : : class BASIC_DLLPUBLIC SbxObject : public SbxVariable, public SfxListener
33 : : {
34 : : SbxObjectImpl* mpSbxObjectImpl; // Impl data
35 : :
36 : : BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable*, sal_uInt16& );
37 : : protected:
38 : : SbxArrayRef pMethods; // Methods
39 : : SbxArrayRef pProps; // Properties
40 : : SbxArrayRef pObjs; // Objects
41 : : SbxProperty* pDfltProp; // Default-Property
42 : : String aClassName; // Classname
43 : : String aDfltPropName;
44 : : virtual sal_Bool LoadData( SvStream&, sal_uInt16 );
45 : : virtual sal_Bool StoreData( SvStream& ) const;
46 : : virtual ~SbxObject();
47 : : virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
48 : : const SfxHint& rHint, const TypeId& rHintType );
49 : : public:
50 : 0 : SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_OBJECT,1);
51 : : TYPEINFO();
52 : : SbxObject( const String& rClassname );
53 : : SbxObject( const SbxObject& );
54 : : SbxObject& operator=( const SbxObject& );
55 : : virtual SbxDataType GetType() const;
56 : : virtual SbxClassType GetClass() const;
57 : : virtual void Clear();
58 : :
59 : : virtual sal_Bool IsClass( const rtl::OUString& ) const;
60 : 144 : const String& GetClassName() const { return aClassName; }
61 : 583 : void SetClassName( const String &rNew ) { aClassName = rNew; }
62 : : // Default-Property
63 : : SbxProperty* GetDfltProperty();
64 : : void SetDfltProperty( const String& r );
65 : : // Search for an element
66 : : virtual SbxVariable* FindUserData( sal_uInt32 nUserData );
67 : : virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
68 : : SbxVariable* FindQualified( const String&, SbxClassType );
69 : : // Quick-Call-Interface for Methods
70 : : virtual sal_Bool Call( const String&, SbxArray* = NULL );
71 : : // Execution of DDE-Commands
72 : : SbxVariable* Execute( const String& );
73 : : // Manage elements
74 : 143304 : virtual sal_Bool GetAll( SbxClassType ) { return sal_True; }
75 : : SbxVariable* Make( const String&, SbxClassType, SbxDataType );
76 : : virtual SbxObject* MakeObject( const String&, const String& );
77 : : virtual void Insert( SbxVariable* );
78 : : // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and
79 : : // without Broadcasts, only used in SO2/auto.cxx
80 : : void QuickInsert( SbxVariable* );
81 : : virtual void Remove( const String&, SbxClassType );
82 : : virtual void Remove( SbxVariable* );
83 : :
84 : : // Macro-Recording
85 : : virtual String GenerateSource( const String &rLinePrefix,
86 : : const SbxObject *pRelativeTo );
87 : : // Direct access on arrays
88 : 861 : SbxArray* GetMethods() { return pMethods; }
89 : 0 : SbxArray* GetProperties() { return pProps; }
90 : 469 : SbxArray* GetObjects() { return pObjs; }
91 : : // Debugging
92 : : void Dump( SvStream&, sal_Bool bDumpAll=sal_False );
93 : : };
94 : :
95 : : #ifndef __SBX_SBXOBJECTREF_HXX
96 : :
97 : : #ifndef SBX_OBJECT_DECL_DEFINED
98 : : #define SBX_OBJECT_DECL_DEFINED
99 : 55030 : SV_DECL_REF(SbxObject)
100 : : #endif
101 [ + + - ]: 18843 : SV_IMPL_REF(SbxObject)
[ + + ][ + + ]
[ # # + + ]
[ # # ][ # # ]
[ + - ][ # # ]
102 : :
103 : : #endif /* __SBX_SBXOBJECTREF_HXX */
104 : : #endif /* _SBX_SBXOBJECT_HXX */
105 : :
106 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|