/* @(#)Z 1.38 com/src/docshell/idl/DocMgr.idl, odshell, od96nt, odnt9712d 97/03/21 17:16:18 (97/03/05 14:37:15) */

#ifndef _DOCMGRSHELL_
#define _DOCMGRSHELL_

#include <somobj.idl>
#include <mlink.idl>

#ifndef _ODTYPESM_
#include "ODTypesM.idl"
#endif

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

interface   DocumentManager;

//==============================================================================
// Classes used by this interface
//==============================================================================

interface   ODSession;
interface   ODContainer;
interface   ODDocument;
interface   ODDraft;
interface   ODPart;
interface   ODWindowState;
interface   ODPlatformWindow;
interface   ODStorageUnit;

//==============================================================================
// Implementation Types
//==============================================================================

typedef somToken PlatformFile;
typedef somToken DraftInfoRec;
#ifdef _PLATFORM_WIN32_
    typedef somToken OleWrapper;
    typedef somToken IStream;
#endif

//==============================================================================
// DocumentManager
//==============================================================================

interface DocumentManager :  somf_MLinkable
{
    void		Initialize(in ODSession session);
    char* 		OpenDocumentFromFile(in char *fileName, 
					in ODUShort actionFlag);
    char* 		OpenDocumentFromMemory(in ODHandle handle);
    void		CreateDocumentInFile(in ODType kindName, 
					in char* fileName);
    void		CreateDocumentInMemory(in ODType kindName);
    void		CreateDocumentAsStationery(in ODType kindName, 
					in char* fileName);
    ODDocument 		GetDocument();
    void		SaveDocument();
    void		CloseDocument(in ODULong saveOption);
    ODBoolean		CloseWindow(in ODPlatformWindow pwindow, 
					in ODBoolean confirm);
    void 		CreateDraft(in ODULong draftNum, in ODIText modUser,
					in ODIText comment);
    ODBoolean 		OpenDraft(in ODDraft draft, in ODBoolean toBeRelease);
    void 		CloseDraft(in ODDraft draft);
    void 		SaveDraft();
    ODBoolean 		DeleteDraft(in DraftInfoRec* draftInfoRec);
    ODDraft		GetLatestCreatedDraft();
    ODDraft 		GetDraft();
    DraftInfoRec*	GetDraftList();
    void		DeleteDraftList();
    ODBoolean 		HasWriteAccess();
    void		InternalizeHistory();
    void 		Revert();
    void		SaveACopyAs(in ODDraft draft, inout PlatformFile file); 
    #ifdef _PLATFORM_WIN32_
        void		SetOleWrapper(in OleWrapper *oleWrapper);
        OleWrapper*	GetOleWrapper();
    #endif
    char*		GetFileName();
    void		SetFileName(in char *fileName);
    char*		GetPartKindName();
    void		SetPartKindName(in char *kindName);


#ifdef __SOMIDL__
    implementation
    {
        majorversion = 1; minorversion = 0;

        functionprefix = DocumentManager;

        releaseorder:
            Initialize,
            OpenDocumentFromFile,
            OpenDocumentFromMemory,
            CreateDocumentInFile,
            CreateDocumentInMemory,
            CreateDocumentAsStationery,
	    GetDocument,
            SaveDocument,
            CloseDocument,
            CloseWindow,
            CreateDraft,
            OpenDraft,
            CloseDraft,
            SaveDraft,
            DeleteDraft,
            GetLatestCreatedDraft,
            GetDraft,
            GetDraftList,
            DeleteDraftList,
            HasWriteAccess,
	    InternalizeHistory,
            Revert,
            SaveACopyAs,
            #ifdef _PLATFORM_WIN32_
                SetOleWrapper,
                GetOleWrapper,
            #endif
            GetFileName,
            SetFileName,
            GetPartKindName,
            SetPartKindName,
                reserved1,
                reserved2,
                reserved3,
                reserved4,
                reserved5,
                reserved6,
                reserved7,
                reserved8,
                reserved9,
                reserved10,
                reserved11,
                reserved12,
                reserved13,
                reserved14,
                reserved15,
                reserved16,
                reserved17,
                reserved18,
                reserved19,
                reserved20;

            passthru C_xh = "#include <PlfmFile.h>"
			    "#ifndef _ODTYPES_"
			    "#include \"ODTypes.h\""
			    "#endif"
			    "#ifndef _DRAFTREC_"
			    "#include \"DraftRec.h\""
			    "#endif"
            #ifdef _PLATFORM_WIN32_
			    "class OleWrapper;"
            #endif
			    "";

            #ifdef _PLATFORM_WIN32_
            passthru C_xih = "class OleWrapper;"
			     "";
            #endif

  };
#endif
};

#endif // _DOCMGRSHELL_
