#ifdef __PRIVATE__
//#	File:		SUView.idl
//#
//#	Contains:	Definition of ODStorageUnitView.
//#
//#	Written by:	Vincent Lo
//#
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		 <6>	 8/26/94	VL		1183174: Sync up with SU API changes for
//#									Cloning (CloneInto parameters and CloneTo
//#									removed).
//#		 <5>	 8/11/94	VL		1180299: GetStorageUnitRefIterator ->
//#									CreateStorageUnitRefIterator.
//#		 <4>	 7/26/94	VL		Added IsValidStorageUnitRef.
//#		 <3>	  7/5/94	VL		Fixed in/out.
//#		 <2>	 6/21/94	VL		Added functionprefix.
//#		 <1>	  6/8/94	VL		first checked in
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _SUVIEW_
#define _SUVIEW_

#ifndef _ODOBJECT_
#include "ODObject.idl"
#endif

//==============================================================================
// Classes defined in this interface
//==============================================================================

interface   ODStorageUnitView;

//==============================================================================
// Classes used by this interface
//==============================================================================
interface	ODStorageUnit;
interface   ODStorageUnitCursor;
interface	ODDraft;
interface	ODStorageUnitRefIterator;
interface	ODPart;

//==============================================================================
// ODStorageUnitView
//==============================================================================

interface ODStorageUnitView :  ODObject
{

	void InitStorageUnitView(in ODStorageUnit storageUnit, 
							in ODStorageUnitCursor cursor);
		
	ODStorageUnit  GetStorageUnit();
	
	ODStorageUnitCursor  GetCursor();
	
	ODStorageUnitView   Externalize();  
	
	ODStorageUnitView   Internalize();  
	
	ODID GetID();      
	
	ODStorageUnitName GetName();    
	
	void SetName(in ODStorageUnitName name);
	
	ODStorageUnitView  AddProperty(in ODPropertyName propertyName);      
	
	ODStorageUnitView  AddValue(in ODValueType type);
	
	ODStorageUnitView  Remove();
	
	void CopyTo(in ODStorageUnit toSU);
	
	void CloneInto(in ODDraftKey key,
					in ODStorageUnit destStorageUnit, 
					in ODStorageUnitID scopeID);
	
	ODPropertyName  GetProperty();
	
	ODValueType  GetType();
	
	void      SetType(in ODValueType valueType);
	
	void      SetOffset(in ODULong offset);
	
	ODULong    GetOffset();
	
	ODULong    GetValue(in ODULong length, 
						in ODValue value);
						
	void      SetValue(in ODULong length, 
						in ODValue value);
						
	void      InsertValue(in ODULong length,
							in ODValue value);
							
	void      DeleteValue(in ODULong length);
	
	ODULong    GetSize();
	
	ODBoolean    IsValidStorageUnitRef(in ODStorageUnitRef ref);
	
	ODStorageUnitRef    GetStrongStorageUnitRef(in ODStorageUnitID embeddedSUID);
	
	ODStorageUnitRef    GetWeakStorageUnitRef(in ODStorageUnitID embeddedSUID);
	
	ODBoolean      IsStrongStorageUnitRef(in ODStorageUnitRef ref);
	
	ODBoolean      IsWeakStorageUnitRef(in ODStorageUnitRef ref);
	
	ODStorageUnitView   RemoveStorageUnitRef(in ODStorageUnitRef aRef);
	
	ODStorageUnitID  GetIDFromStorageUnitRef(in ODStorageUnitRef aRef);
	
	ODStorageUnitRefIterator  CreateStorageUnitRefIterator();
	
	ODULong  GetGenerationNumber();
	
	ODULong  IncrementGenerationNumber();
	
	ODBoolean  IsPromiseValue();
	
	void    SetPromiseValue(in ODValueType valueType,
							in ODULong offset,
							in ODULong length,
							in ODValue value,
							in ODPart sourcePart);
							
	ODULong  GetPromiseValue(in ODValueType valueType,
								in ODULong offset,
								in ODULong length,
								in ODValue value,
								out ODPart sourcePart);
	
	#ifdef __PRIVATE__
	
		void    Lock();
		void    Unlock();

	#endif
	
#ifdef __SOMIDL__
	implementation
	{
	  	functionprefix = ODStorageUnitView;
		override:
			somInit,
			somUninit,
			Purge;
		releaseorder:
			InitStorageUnitView,
			GetStorageUnit,
			GetCursor,
			Externalize,
			Internalize,
			GetID,
			GetName,
			SetName,
			AddProperty,
			AddValue,
			Remove,
			CopyTo,
			CloneInto,
			GetProperty,
			GetType,
			SetType,
			SetOffset,
			GetOffset,
			GetValue,
			SetValue,
			InsertValue,
			DeleteValue,
			GetSize,
			IsValidStorageUnitRef,
			GetStrongStorageUnitRef,
			GetWeakStorageUnitRef,
			IsStrongStorageUnitRef,
			IsWeakStorageUnitRef,
			RemoveStorageUnitRef,
			GetIDFromStorageUnitRef,
			CreateStorageUnitRefIterator,
			GetGenerationNumber,
			IncrementGenerationNumber,
			IsPromiseValue,
			SetPromiseValue,
			GetPromiseValue,
			Lock,
			Unlock;
			
	#ifdef __PRIVATE__
		ODStorageUnit		fSU;
		ODStorageUnitCursor	fCursor;
		ODULong				fOffset;
		ODStorageUnitKey	fKey;
	#endif
	
  };
  
#endif
};

#endif  // _SUVIEW_

