/* @(#) 1.7 com/src/samples/bitmap/iodbitmp.idl, odbitmappart, od96nt, odnt9714c 3/24/97 18:42:26 [4/2/97 17:54:41] */
//#====START_GENERATED_PROLOG======================================
//#
//#
//#   COMPONENT_NAME: odother
//#
//#   CLASSES: none
//#
//#   ORIGINS: 82,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========================================
//#

#ifndef _BITMAP_IDL_
#define _BITMAP_IDL_


#ifndef _SIMPLPRT_
#include <iodsimpl.idl>
#endif


#ifdef __PRIVATE__
//=====================================================================================
// Implementation Types
//=====================================================================================

   typedef octet* PBYTE;
   typedef unsigned long ULONG;
   typedef unsigned short USHORT;
   typedef ULONG HMODULE;
   typedef ULONG HBITMAP;

#ifdef _PLATFORM_OS2_
   typedef ULONG HPS;
   typedef ULONG HPAL;
#endif

#ifdef _PLATFORM_WIN32_
   typedef ULONG HPALETTE;
#endif

#endif


interface M_Bitmap;


interface Bitmap : SimplePart
{
#ifdef __PRIVATE__

        char* GetBitmapFileName(in ODPlatformWindow hwnd);
        ODBoolean LoadBitmap();
        ODBoolean CreateBitmap();
        HBITMAP DuplicateBitmap(in ODFacet facet, in HBITMAP source);
        void SizeFrameToBitmap(in ODFacet facet);
        ODBoolean RealizePalette(in ODFacet facet);
        ODBoolean CreatePalette();
        ODBoolean CopyBitmapToClipboard(in ODFacet facet);
        ODBoolean PasteBitmapFromClipboard(in ODFacet facet);
        void InvertDragHilite(in ODFacet facet);
        void NoBitmap(in ODFacet facet);
        ODBoolean NewBitmap(in char *filename);
        void ChangeNotification(in ODFrame frame, in ODULong reason);
        void AddPropertiesToSU(in ODStorageUnit storageUnit);
        void PrepareSU(in ODStorageUnit storageUnit);
        void ExternalizeOneKind(in ODStorageUnit su, in ODValueType kind);
#endif

#ifdef __SOMIDL__
        implementation
        {
                dllname = "iodbitmp.dll";
                functionprefix = Bitmap;
                metaclass = M_Bitmap;
                majorversion = 1;
                minorversion = 0;

        releaseorder:
                GetBitmapFileName,
                LoadBitmap,
                CreateBitmap,
                DuplicateBitmap,
                SizeFrameToBitmap,
                RealizePalette,
                AdjustPopupMenu,
                CopyBitmapToClipboard,
                PasteBitmapFromClipboard,
                InvertDragHilite,
                NoBitmap,
                NewBitmap,
                CreatePalette,
                ChangeNotification,
                AddPropertiesToSU,
                PrepareSU,
                ExternalizeOneKind;

        override:
                somInit,
                somUninit,
                CommonInit,
        DisplayFrameAdded,
        DisplayFrameConnected,
        FrameShapeChanged,
        ViewTypeChanged,
        FacetAdded,
        HandleEvent,
        HandleMenuEvent,
        InstallMenus,
        AdjustMenus,
        Draw,
#ifdef _LEFT_TO_PORT_
        DragEnter,
        DragWithin,
        DragLeave,
        Drop,
#endif
        Externalize,
        InitPart,
        InitPartFromStorage,
        HasExtension,
        AcquireExtension,
        ReleaseExtension,
        FacetRemoved;

    #ifdef __PRIVATE__
        passthru C_xh_after = "typedef long RGBColor;";

        // instance variables
             ODBoolean            fDirty;
             ODBoolean            fDraftReadOnly;
             ODType               fPreferredKind;
             ODType               fInternalizedKind;

             ODSession            MySession;
             ODPart               MyWrapper;
             ODFacet              MyFacet;

             HMODULE              MyResources;
             HDC                  hdcMemory;
#ifdef _PLATFORM_OS2_
             HPS                  hpsMemory;
#endif

             ODMenuBar            MyMenuBar;
             ODPopup              MyPopupMenu;

             HBITMAP              CurrentBitmapHandle;
             HBITMAP              NoBitmapSelectedHandle;

             HBITMAP              SmallIcon;
             HBITMAP              LargeIcon;

#ifdef _PLATFORM_WIN32_
             HPALETTE             BitmapPalette;
#elif defined(_PLATFORM_OS2_)
             HPAL                 BitmapPalette;
#endif
             char*                BitmapFileName;
             ULONG                BitmapFileSize;
             char*                BitmapBuffer;

             ODBoolean            FileNameOnly;
             ODBoolean            UsePromises;
             ODBoolean            PaletteManage;
             ODBoolean            Negative;

             ODBoolean            EnablePaletteManagement;
             ODBoolean            EnableFileNameOnly;

             ODTypeToken          ViewAsSmallIcon;
             ODTypeToken          ViewAsLargeIcon;
             ODTypeToken          ViewAsThumbnail;
             ODTypeToken          ViewAsFrame;
    #endif

        };
#endif
};

//};  //# Module Bitmap


// Added for Part Registration

interface M_Bitmap : M_ODPart
{

#ifdef __SOMIDL__
  implementation
  {
    functionprefix = M_Bitmap;
    override:
      clsGetODPartHandlerName,
      clsGetODPartHandlerDisplayName,
      clsGetODPartKinds,
      clsGetOLE2ClassId,
      clsGetWindowsIconFileName;
  };
#endif
};

#endif  // _BITMAP_IDL_

