1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include <sot/object.hxx>
21 #include <sot/factory.hxx>
23 /************** class SotObject ******************************************/
24 class SotObjectFactory
: public SotFactory
28 SotObjectFactory( const SvGlobalName
& rName
,
29 const OUString
& rClassName
,
30 CreateInstanceType pCreateFuncP
)
31 : SotFactory( rName
, rClassName
, pCreateFuncP
)
34 TYPEINIT1(SotObjectFactory
,SotFactory
);
37 SO2_IMPL_BASIC_CLASS_DLL(SotObject
,SotObjectFactory
,
38 SvGlobalName( 0xf44b7830, 0xf83c, 0x11d0,
39 0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ) )
41 /*************************************************************************
42 |* SotObject::SotObject()
45 *************************************************************************/
46 SotObject::SotObject()
47 : nOwnerLockCount( 0 )
52 SotFactory::IncSvObjectCount( this );
55 /*************************************************************************
57 |* SotObject::~SotObject()
59 *************************************************************************/
60 SotObject::~SotObject()
62 SotFactory::DecSvObjectCount( this );
65 /*************************************************************************
66 |* SotObject::GetInterface()
68 |* Beschreibung: Um so3 zu helfen
69 *************************************************************************/
70 IUnknown
* SotObject::GetInterface( const SvGlobalName
& )
75 //=========================================================================
76 void SotObject::OwnerLock
78 bool bLock
/* true, lock. false, unlock. */
82 Wenn der OwnerLock auf Null dekrementiert, dann wird die Methode
83 DoClose gerufen. Dies geschieht unabh"angig vom Lock. bzw. RefCount.
84 Ist der OwnerLock-Z"ahler != Null, dann wird kein DoClose durch
85 <SotObject::FuzzyLock> gerufen.
93 else if ( nOwnerLockCount
)
95 if( 0 == --nOwnerLockCount
)
101 //=========================================================================
102 bool SotObject::DoClose()
107 SotObjectRef
xHoldAlive( this );
115 //=========================================================================
116 bool SotObject::Close()
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */