/* @(#)Z 1.4 com/src/registry/PartCat.cpp, odconfig, od96nt, odnt9712d 97/03/21 17:15:54 (96/10/29 09:29:15) */
//====START_GENERATED_PROLOG======================================
//
//
//   COMPONENT_NAME: odconfig
//
//   CLASSES: none
//
//   ORIGINS: 27
//
//
//   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//   	
//   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//   OR PERFORMANCE OF THIS SOFTWARE.
//
//====END_GENERATED_PROLOG========================================
//

/*
 *  This file was generated by the SOM Compiler and Emitter Framework.
 *  Generated using: 
 *      SOM Emitter emitxtm: 2.41
 */

#ifndef SOM_Module_partcat_Source
#define SOM_Module_partcat_Source
#endif
#define ODPartCategory_Class_Source

#include <iset.h>
#include <ODTypes.h>

#include "PartCat.xih"
#include <PartInfi.xh>
#include <csetwrap.h>

#ifdef _PLATFORM_OS2_
#include <ODPagtun.h>
#endif

SOM_Scope void  SOMLINK ODFileTypeInitODPartFileType(ODPartFileType *somSelf, 
                                                      Environment *ev, 
                                                     ISOString partFileTypeName)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeInitODPartFileType");

    somThis-> partFileTypeName = partFileTypeName;
}

SOM_Scope ODPartHandlerInfoInt*  SOMLINK ODFileTypeGetPreferredPart(ODPartFileType *somSelf, 
                                                                     Environment *ev)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeGetPreferredPart");

    if ( !somThis-> preferredPart )
    {
        ICursor* cursor = somThis-> parts-> newCursor();

        if ( somThis-> parts-> setToFirst( *cursor) )
        {
            somThis-> preferredPart = somThis-> parts-> elementAt( *cursor);
        }
        delete cursor;
    }
    return somThis-> preferredPart;
}

SOM_Scope void  SOMLINK ODFileTypeSetPreferredPart(ODPartFileType *somSelf, 
                                                    Environment *ev, 
                                                   ODPartHandlerInfoInt* part)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeSetPreferredPart");

    somThis-> preferredPart = part;

    CWrap<ODPartHandlerInfoInt> partWrap( part);

    if ( !somThis-> parts-> contains( partWrap) )
    {
        somThis-> parts-> add( partWrap);
    }
}

SOM_Scope string  SOMLINK ODFileTypeGetKey(ODPartFileType *somSelf, 
                                            Environment *ev)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeGetKey");

    return somThis-> partFileTypeName;
}

SOM_Scope boolean  SOMLINK ODFileTypeAdd(ODPartFileType *somSelf, 
                                          Environment *ev, ODPartHandlerInfoInt* part)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeAdd");

    CWrap<ODPartHandlerInfoInt> partWrap( part);

    return somThis-> parts-> add( partWrap);
}

SOM_Scope void  SOMLINK ODFileTypeRemove(ODPartFileType *somSelf, 
                                          Environment *ev, ODPartHandlerInfoInt* part)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeRemove");

    CWrap<ODPartHandlerInfoInt> partWrap( part);
    ICursor* cursor = somThis-> parts-> newCursor();

    if ( somThis-> parts-> locate( partWrap, *cursor) )
    {
        somThis-> parts-> removeAt( *cursor);
    }
}

SOM_Scope long  SOMLINK ODFileTypeCount(ODPartFileType *somSelf, 
                                         Environment *ev)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypeCount");

    return somThis-> parts-> numberOfElements();
}

SOM_Scope void  SOMLINK ODFileTypesomInit(ODPartFileType *somSelf)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypesomInit");

    somThis-> parts         = new PartSet;
    somThis-> preferredPart = 0;

    ODPartFileType_parent_SOMObject_somInit(somSelf);
}

SOM_Scope void  SOMLINK ODFileTypesomUninit(ODPartFileType *somSelf)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypesomUninit");

    ODPartFileType_parent_SOMObject_somUninit(somSelf);
}

SOM_Scope void  SOMLINK ODFileTypesomDumpSelfInt(ODPartFileType *somSelf, 
                                                 long level)
{
    ODPartFileTypeData *somThis = ODPartFileTypeGetData(somSelf);
    ODPartFileTypeMethodDebug("ODPartFileType","ODFileTypesomDumpSelfInt");

    ODPartFileType_parent_SOMObject_somDumpSelfInt(somSelf, level);
}


SOM_Scope void  SOMLINK ODFileExtensionInitODPartFileExtension(ODPartFileExtension *somSelf, 
                                                                Environment *ev, 
                                                               ISOString partFileExtensionName)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionInitODPartFileExtension");

    somThis-> partFileExtensionName = partFileExtensionName;
}

SOM_Scope ODPartHandlerInfoInt*  SOMLINK ODFileExtensionGetPreferredPart(ODPartFileExtension *somSelf, 
                                                                          Environment *ev)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionGetPreferredPart");

    if ( !somThis-> preferredPart )
    {
        ICursor* cursor = somThis-> parts-> newCursor();

        if ( somThis-> parts-> setToFirst( *cursor) )
        {
            somThis-> preferredPart = somThis-> parts-> elementAt( *cursor);
        }
        delete cursor;
    }
    return somThis-> preferredPart;
}

SOM_Scope void  SOMLINK ODFileExtensionSetPreferredPart(ODPartFileExtension *somSelf, 
                                                         Environment *ev, 
                                                        ODPartHandlerInfoInt* part)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionSetPreferredPart");

    somThis-> preferredPart = part;

    CWrap<ODPartHandlerInfoInt> partWrap( part);

    if ( !somThis-> parts-> contains( partWrap) )
    {
        somThis-> parts-> add( partWrap);
    }
}

SOM_Scope string  SOMLINK ODFileExtensionGetKey(ODPartFileExtension *somSelf, 
                                                 Environment *ev)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionGetKey");

    return somThis-> partFileExtensionName;
}

SOM_Scope boolean  SOMLINK ODFileExtensionAdd(ODPartFileExtension *somSelf, 
                                               Environment *ev, 
                                              ODPartHandlerInfoInt* part)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionAdd");

    CWrap<ODPartHandlerInfoInt> partWrap( part);

    return somThis-> parts-> add( partWrap);
}

SOM_Scope void  SOMLINK ODFileExtensionRemove(ODPartFileExtension *somSelf, 
                                               Environment *ev, 
                                              ODPartHandlerInfoInt* part)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionRemove");

    CWrap<ODPartHandlerInfoInt> partWrap( part);
    ICursor* cursor = somThis-> parts-> newCursor();

    if ( somThis-> parts-> locate( partWrap, *cursor) )
    {
        somThis-> parts-> removeAt( *cursor);
    }
}

SOM_Scope long  SOMLINK ODFileExtensionCount(ODPartFileExtension *somSelf, 
                                              Environment *ev)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionCount");

    return somThis-> parts-> numberOfElements();
}

SOM_Scope void  SOMLINK ODFileExtensionsomInit(ODPartFileExtension *somSelf)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionsomInit");

    somThis-> parts         = new PartSet;
    somThis-> preferredPart = 0;

    ODPartFileExtension_parent_SOMObject_somInit(somSelf);
}

SOM_Scope void  SOMLINK ODFileExtensionsomUninit(ODPartFileExtension *somSelf)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionsomUninit");

    ODPartFileExtension_parent_SOMObject_somUninit(somSelf);
}

SOM_Scope void  SOMLINK ODFileExtensionsomDumpSelfInt(ODPartFileExtension *somSelf, 
                                                      long level)
{
    ODPartFileExtensionData *somThis = ODPartFileExtensionGetData(somSelf);
    ODPartFileExtensionMethodDebug("ODPartFileExtension","ODFileExtensionsomDumpSelfInt");

    ODPartFileExtension_parent_SOMObject_somDumpSelfInt(somSelf, 
                                                        level);
}

