home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / idmimage.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.5 KB  |  160 lines

  1. #ifndef _IDMIMAGE_
  2. #define _IDMIMAGE_
  3. /*******************************************************************************
  4. * FILE NAME: idmimage.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IDMImage                                                                 *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <ivbase.hpp>
  19. #include <ipoint.hpp>
  20. #include <ireslib.hpp>
  21. #include <ibitflag.hpp>
  22.  
  23. struct _DRAGIMAGE;
  24.  
  25. class IDMImageData;
  26.  
  27. #pragma pack(4)
  28.  
  29. class IDMImage : public IVBase {
  30. typedef IVBase
  31.   Inherited;
  32. public:
  33.  
  34. class Style;
  35.  
  36. /*------------------------------- Constructors -------------------------------*/
  37. IDMImage    ( );
  38. IDMImage    ( const IResourceId&    resourceId,
  39.               Boolean               iconResource = true,
  40.               const ISize&          pointerOffset = ISize(0,0),
  41.               const ISize&          stretchSize = ISize(0,0),
  42.               const Style&          style = defaultStyle() );
  43.  
  44. IDMImage    ( const IPointerHandle& icon,
  45.               const ISize&          pointerOffset = ISize(0,0),
  46.               const ISize&          stretchSize = ISize(0,0),
  47.               const Style&          style = defaultStyle() );
  48.  
  49. IDMImage    ( const IBitmapHandle&  bitmap,
  50.               const ISize&          pointerOffset = ISize(0,0),
  51.               const ISize&          stretchSize = ISize(0,0),
  52.               const Style&          style = defaultStyle() );
  53.  
  54. #ifndef IC_WIN_FLAGNOP
  55. IDMImage    ( unsigned long         arrayOfPoints[],
  56.               const unsigned long   numberOfPoints,
  57.               const ISize&          pointerOffset = ISize(0,0),
  58.               const Style&          style = defaultStyle() );
  59. #endif
  60.  
  61. IDMImage    ( const IDMImage&       image );
  62.  
  63. virtual
  64.   ~IDMImage ( );
  65.  
  66. IDMImage
  67.  &operator = ( const IDMImage&      image );
  68.  
  69. /*---------------------------------- Styles ----------------------------------*/
  70. INESTEDBITFLAGCLASSDEF0(Style, IDMImage);
  71. static const Style
  72.   IC_IMPORTU classDefaultStyle,
  73.   IC_IMPORTU noStyle,
  74.   IC_IMPORTU ptr,
  75.   IC_IMPORTU bmp,
  76.   IC_IMPORTU polygon,
  77.   IC_IMPORTU stretch,
  78.   IC_IMPORTU transparent,
  79.   IC_IMPORTU closed;
  80.  
  81. static Style
  82.   defaultStyle    ( );
  83. static void
  84.   setDefaultStyle ( const Style& style );
  85.  
  86. /*----------------------------- Image Processing -----------------------------*/
  87. IPointerHandle
  88.   pointer           ( ) const;
  89.  
  90. IBitmapHandle
  91.   bitmap            ( ) const;
  92.  
  93. ISize
  94.   pointerOffset     ( ) const,
  95.   stretchSize       ( ) const;
  96.  
  97. Style
  98.   style             ( );
  99.  
  100. #ifndef IC_WIN_FLAGNOP
  101. unsigned long
  102.   numberOfPoints    ( );
  103.  
  104. unsigned long
  105.  *pointArray        ( );
  106. #endif
  107.  
  108. IDMImage
  109.  &setPointer        ( const IPointerHandle& pointerImage ),
  110.  &setBitmap         ( const IBitmapHandle&  bitmapImage ),
  111.  &setPointerOffset  ( const ISize&          pointerOffset ),
  112.  &setStretchSize    ( const ISize&          stretchSize ),
  113.  &setStyle          ( const Style&          style );
  114.  
  115. #ifndef IC_WIN_FLAGNOP
  116. IDMImage
  117.  &setNumberOfPoints ( unsigned long         points ),
  118.  &setPointArray     ( unsigned long         arrayOfPoints[],
  119.                       unsigned long         numberOfPoints );
  120. #endif
  121.  
  122. private:
  123. /*--------------------------------- Private ----------------------------------*/
  124. friend class IDMSourceOperation;
  125.  
  126. IPointerHandle
  127.   pointerImage;
  128.  
  129. IBitmapHandle
  130.   bitmapImage;
  131.  
  132.  
  133. unsigned long
  134.  *pPointArray;
  135.  
  136. ISize
  137.   ptrOffset,
  138.   imageStretchSize;
  139.  
  140. static Style
  141.   currentDefaultStyle;
  142.  
  143. Style
  144.   imgStyle;
  145.  
  146. unsigned long
  147.   points;
  148.  
  149.  
  150. IDMImageData
  151.  *fDMImageData;
  152.  
  153. }; // IDMImage
  154.  
  155. #pragma pack()
  156.  
  157.   #include <idmimage.inl>
  158.  
  159. #endif //_IDMIMAGE_
  160.