home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dokpr1.zip / clipstr.h < prev    next >
C/C++ Source or Header  |  1995-07-22  |  3KB  |  98 lines

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *                                                                        *
  4.  *          This code is copyright (c) 1994                               *
  5.  *                     Athena Design, Inc.                                *
  6.  *                                                                        *
  7.  *                                                                        *
  8.  *                ALL RIGHTS RESERVED                                     *
  9.  *                                                                        *
  10.  *                                                                        *
  11.  *                                                                        *
  12.  *                                                                        *
  13.  *                                                                        *
  14.  **************************************************************************/
  15.  
  16. /*
  17.     This class abstracts the OS/2 clipboard and either serves up data
  18.     or archives data for clipboard operations
  19.     6-15-94 dpp
  20. */
  21.  
  22. #ifndef _MH_clip_stream
  23.  
  24. #define _MH_clip_stream
  25.  
  26. #include "os2h.h"
  27.  
  28. #include "stream.h"
  29.  
  30.  
  31. class MClipStream : public MStream
  32. {
  33.     public:
  34.  
  35. #if defined(M2Z)
  36.     MClipStream(HAB);
  37. #elif defined(M2NT)
  38.     MClipStream(HWND);
  39. #elif defined(M2MAC)
  40.     MClipStream(int);
  41. #endif
  42.     virtual ~MClipStream();
  43.     virtual void beginWrite();
  44.     virtual void endWriteText();
  45.     virtual void endWriteBitmap();
  46.     virtual void endWritePict();
  47.     virtual void endWriteMesa();
  48.     virtual void endWriteLink();
  49.     virtual void endWriteRTF();
  50.     virtual int hasText();
  51.     virtual int hasBitmap();
  52.     virtual int hasPict();
  53.     virtual int hasMesa();
  54.     virtual int hasRTF();
  55.     virtual int hasLink();
  56.     virtual int isEOF();
  57.  
  58.  
  59.     virtual void resetClipboard();  // clear all the data on the clipboard
  60.  
  61.     virtual void beginReadText();
  62.     virtual const char *getTextPtr() {return textBuf;};
  63.     virtual const char *getRTFPtr() {return rtfBuf;};
  64.     virtual const char *getLinkPtr() {return linkBuf;};
  65.     virtual const char *getMesaPtr(int &l) {l = mesaLen; return mesaBuf;};
  66.     virtual void beginReadBitmap();
  67.     virtual void beginReadPict();
  68.     virtual void beginReadMesa();
  69.     virtual void beginReadRTF();
  70.     virtual void beginReadLink();
  71.     virtual void endClipRead();
  72.     virtual int read(void *,int);
  73.     virtual int write(const void *,int);
  74.     virtual int getPos();
  75.     virtual int getStreamLen();
  76.     virtual int seek(int);
  77.     virtual void setDontStuff(int);
  78.  
  79.     private:
  80.     int pos,len;
  81.     int size;
  82.     char *mBuf;
  83. #if defined(M2Z)
  84.     HAB hab; // need this to pass to the engine side which cannot ask for it
  85. #elif defined(M2NT)
  86.     HWND hab; // need this to pass to the engine side which cannot ask for it
  87. #endif
  88.     char *textBuf,*bitMapBuf,*pictBuf,*mesaBuf,*linkBuf,*rtfBuf;
  89.     int mesaLen;
  90.     int resetAndStuff;
  91.     int dontStuff;
  92.  
  93.     void doubleSize();
  94. };
  95.  
  96. // ifndef _MH_clip_stream
  97. #endif
  98.