home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PstObj.cpp
-
- Contains: Implementation of ODPersistentObject.
-
- Owned by: Vincent Lo, Tantek Çelik
-
- Copyright: © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <19> 10/8/95 TJ Fixes Recomended by Refball
- <18> 8/3/95 RR #1257260: Collapse B classes. Remove
- somInit methods. Don't call IsInitialized
- or SubclassResponsibility
- <17> 4/16/95 VL 1230084: Moved so-called standard
- properties to POUtils.
- <16> 4/14/95 TÇ #1235279 BB: InfoUtil & StdTypIO functions
- should take Environment* and SU* when
- possible
- <15> 4/7/95 EL Use ODGetTime_TProp/ODSetTime_TProp for
- document exchange.
- <14> 2/28/95 VL 1194656: Check for existence before adding
- property or value.
- <13> 2/7/95 CC 1190870: CloneInto() also copies creation
- date property.
- <12> 1/26/95 eeh 1214080: OpenDoc really uses kODMacIText,
- not kODIntlText.
- <11> 1/19/95 VL 1190305: Make sure that all standard
- properties are present.
- <10> 12/20/94 VL 1195012: Make Storage calls be
- marshallable.
- <9> 9/26/94 JBS #1188981 - support nonpersistent frames
- <8> 9/9/94 CG #1183531: Commented out NULL storage unit
- reference warning in destructor.
- <7> 8/31/94 VL 1183174: Changed implementation of
- CloneInto to not rely on SU::CloneInto.
- <6> 8/29/94 TÇ #1183567 StdTypIO routine implementation &
- fixup
- <5> 8/26/94 VL 1183174: Added implementation to CloneInto.
- <4> 8/16/94 VL 1143605: Added CloneInto.
- <3> 8/12/94 NP 1180762-commented out calls to GetUserName
- (they were unused and the interface has
- changed.).
- <2> 7/18/94 TÇ moved code over for somUninit method
- <1> 6/23/94 CG first checked in
- <0> 6/22/94 SV SOMverted
- <6> 5/9/94 MB #1162181: Changes necessary to install MMM.
- <5> 3/28/94 CG 1153547: Use new method
- ODSession::GetUserName to set up user
- name in Info dlg.
- <4> 3/18/94 CC Value type of user property changed from
- kXMPAppleTEXT to kODASCIIText (but should
- be international text!). (1151636)
- <3> 3/1/94 JA Include ODMemory.h.
- <2> 2/28/94 CG (no bug #) Changed calls to HLock and
- HUnlock to XMPLockHandle and
- XMPUnlockHandle.
- <13> 1/28/94 CC Moved release of fSU from ReleaseAll() into
- destructor.
- <12> 1/27/94 VL Added ReleaseAll.
- <11> 1/11/94 TÇ Init... changes
- <10> 12/15/93 TÇ InitObject changes
- <9> 12/14/93 EL Use text instead of Str255.
- <8> 12/14/93 TÇ more InitPersistentObject changes.
- Internalize, Initialize went away.
- <7> 12/13/93 TÇ InitPersistentObject changes
- <6> 12/11/93 TÇ fixed modified by user code in
- InitializePersistent and Externalize
- <5> 12/8/93 TÇ added code to update ModUser property
- <4> 11/18/93 TÇ add functionality to InitializePersistent &
- Externalize to do Creation, Mod dates and
- ModUser
- <3> 8/9/93 PH Segments
- <2> 6/28/93 PH Initialize fID in constructor
- <1> 6/16/93 VL first checked in
-
- To Do:
- */
-
- #define ODPersistentObject_Class_Source
- #define VARIABLE_MACROS
- #include <PstObj.xih>
-
- #ifndef SOM_ODStorageUnit_xh
- #include <StorageU.xh>
- #endif
-
- #ifndef SOM_ODFrame_xh
- #include <Frame.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdTypes_defined
- #include <StdTypes.xh>
- #endif
-
- #ifndef _EXCEPT_
- #include <Except.h>
- #endif
-
- #ifndef SOM_Module_OpenDoc_Errors_defined
- #include <ErrorDef.xh>
- #endif
-
- #ifndef _STDTYPIO_
- #include <StdTypIO.h>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef _ODUTILS_
- #include <ODUtils.h>
- #endif
-
- #ifndef _STORUTIL_
- #include <StorUtil.h>
- #endif
-
- #ifndef _ODMEMORY_
- #include <ODMemory.h>
- #endif
-
- #ifndef __TIME_H__
- #include <Time.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
-
- #pragma segment ODPersistentObject
-
- SOM_Scope void SOMLINK ODPersistentObjectInitPersistentObject(ODPersistentObject *somSelf, Environment *ev,
- ODStorageUnit* storageUnit)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","InitPersistentObject");
-
- /* Moved from somInit. SOM itself sets fields to zero
- _fSU = kODNULL;
- _fID = 0;
- */
- somSelf->InitRefCntObject(ev);
-
- if ( storageUnit != kODNULL )
- {
- _fSU = storageUnit;
- _fID = _fSU->GetID(ev);
- }
- }
-
- SOM_Scope void SOMLINK ODPersistentObjectInitPersistentObjectFromStorage(ODPersistentObject *somSelf, Environment *ev,
- ODStorageUnit* storageUnit)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","InitPersistentObjectFromStorage");
-
- /* Moved from somInit. SOM itself sets fields to zero
- _fSU = kODNULL;
- _fID = 0;
- */
- somSelf->InitRefCntObject(ev);
-
- _fSU = storageUnit;
- _fID = _fSU->GetID(ev);
- }
-
- SOM_Scope void SOMLINK ODPersistentObjectReleaseAll(ODPersistentObject *somSelf, Environment *ev)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","ReleaseAll");
- }
-
- SOM_Scope void SOMLINK ODPersistentObjectExternalize(ODPersistentObject *somSelf, Environment *ev)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","Externalize");
- }
-
- SOM_Scope ODStorageUnit* SOMLINK ODPersistentObjectGetStorageUnit(ODPersistentObject *somSelf, Environment *ev)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","GetStorageUnit");
-
- return _fSU;
- }
-
-
- SOM_Scope ODID SOMLINK ODPersistentObjectGetID(ODPersistentObject *somSelf, Environment *ev)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","GetID");
-
- return _fID;
- }
-
- SOM_Scope void SOMLINK ODPersistentObjectCloneInto(ODPersistentObject *somSelf, Environment *ev,
- ODDraftKey key,
- ODStorageUnit* toSU,
- ODFrame* scopeFrame)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","CloneInto");
- }
-
- SOM_Scope void SOMLINK ODPersistentObjectsomUninit(ODPersistentObject *somSelf)
- {
- ODPersistentObjectData *somThis = ODPersistentObjectGetData(somSelf);
- ODPersistentObjectMethodDebug("ODPersistentObject","somUninit");
-
- ODSafeReleaseObject(_fSU);
- }