home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / wstdtype.hpp < prev    next >
C/C++ Source or Header  |  1997-01-24  |  9KB  |  257 lines

  1. #ifndef _StdType_HPP_INCLUDED
  2. #define _StdType_HPP_INCLUDED
  3.  
  4. #define WVARIANT _WVARIANT
  5.  
  6. #ifndef _stdole_HPP_INCLUDED
  7. #   include "wstdole.hpp"
  8. #endif
  9.  
  10. #ifndef _OLECTL_H_
  11.  
  12. typedef long OLE_TRISTATE;
  13. #define OLE_TRISTATEUnchecked 0
  14. #define OLE_TRISTATEChecked 1
  15. #define OLE_TRISTATEGray 2
  16.  
  17. #endif // _OLECTL_H_
  18.  
  19. class IFont;
  20. class _Font;
  21. class StdFont;
  22. class IPicture;
  23. class _Picture;
  24. class StdPicture;
  25.  
  26. #ifndef _OLECTL_H_
  27.  
  28. typedef unsigned long OLE_COLOR;
  29. typedef long OLE_XPOS_PIXELS;
  30. typedef long OLE_YPOS_PIXELS;
  31. typedef long OLE_XSIZE_PIXELS;
  32. typedef long OLE_YSIZE_PIXELS;
  33. typedef long OLE_XPOS_HIMETRIC;
  34. typedef long OLE_YPOS_HIMETRIC;
  35. typedef long OLE_XSIZE_HIMETRIC;
  36. typedef long OLE_YSIZE_HIMETRIC;
  37. typedef float OLE_XPOS_CONTAINER;
  38. typedef float OLE_YPOS_CONTAINER;
  39. typedef float OLE_XSIZE_CONTAINER;
  40. typedef float OLE_YSIZE_CONTAINER;
  41. typedef int OLE_HANDLE;
  42. typedef WVARIANT_BOOL OLE_OPTEXCLUSIVE;
  43. typedef WVARIANT_BOOL OLE_CANCELBOOL;
  44. typedef WVARIANT_BOOL OLE_ENABLEDEFAULTBOOL;
  45. typedef WBStr FONTNAME;
  46. typedef WCurrency FONTSIZE;
  47. typedef WVARIANT_BOOL FONTBOLD;
  48. typedef WVARIANT_BOOL FONTITALIC;
  49. typedef WVARIANT_BOOL FONTUNDERSCORE;
  50. typedef WVARIANT_BOOL FONTSTRIKETHROUGH;
  51.  
  52. typedef IDispatch * IFontDisp;
  53. typedef IDispatch * IPictureDisp;
  54.  
  55. #endif // _OLECTL_H_
  56.  
  57. #ifndef _OLECTL_H_
  58.  
  59. class __stdcall IFont : public IUnknown {
  60.  
  61.     public:
  62.  
  63.         /* Methods */
  64.         virtual WHRESULT GetName( WBStr * __pname ) = 0;
  65.         virtual WHRESULT SetName( WBStr __Name ) = 0;
  66.         virtual WHRESULT GetSize( WCurrency * __psize ) = 0;
  67.         virtual WHRESULT SetSize( WCurrency __Size ) = 0;
  68.         virtual WHRESULT GetBold( WVARIANT_BOOL * __pbold ) = 0;
  69.         virtual WHRESULT SetBold( WVARIANT_BOOL __Bold ) = 0;
  70.         virtual WHRESULT GetItalic( WVARIANT_BOOL * __pitalic ) = 0;
  71.         virtual WHRESULT SetItalic( WVARIANT_BOOL __Italic ) = 0;
  72.         virtual WHRESULT GetUnderline( WVARIANT_BOOL * __punderline ) = 0;
  73.         virtual WHRESULT SetUnderline( WVARIANT_BOOL __Underline ) = 0;
  74.         virtual WHRESULT GetStrikethrough( WVARIANT_BOOL * __pstrikethrough ) = 0;
  75.         virtual WHRESULT SetStrikethrough( WVARIANT_BOOL __Strikethrough ) = 0;
  76.         virtual WHRESULT GetWeight( short * __pweight ) = 0;
  77.         virtual WHRESULT SetWeight( short __Weight ) = 0;
  78.         virtual WHRESULT GetCharset( short * __pcharset ) = 0;
  79.         virtual WHRESULT SetCharset( short __Charset ) = 0;
  80.         virtual WHRESULT GethFont( OLE_HANDLE * __phfont ) = 0;
  81.         virtual WHRESULT Clone( IFont * * __lplpfont ) = 0;
  82.         virtual WHRESULT IsEqual( IFont const * __lpFontOther ) = 0;
  83.         virtual WHRESULT SetRatio( long __cyLogical, long __cyHimetric ) = 0;
  84.         virtual WHRESULT AddRefHfont( OLE_HANDLE __hFont ) = 0;
  85.         virtual WHRESULT ReleaseHfont( OLE_HANDLE __hFont ) = 0;
  86. };
  87.  
  88. #endif // _OLECTL_H_
  89.  
  90. class WCMCLASS _Font : public WOleDispatchHelper {
  91.  
  92.     public:
  93.  
  94.         _Font();
  95.         ~_Font();
  96.  
  97.         /* Properties */
  98.         void SetName( WBString );
  99.         WBString GetName( void );
  100.         void SetSize( WCurrency );
  101.         WCurrency GetSize( void );
  102.         void SetBold( WVARIANT_BOOL );
  103.         WVARIANT_BOOL GetBold( void );
  104.         void SetItalic( WVARIANT_BOOL );
  105.         WVARIANT_BOOL GetItalic( void );
  106.         void SetUnderline( WVARIANT_BOOL );
  107.         WVARIANT_BOOL GetUnderline( void );
  108.         void SetStrikethrough( WVARIANT_BOOL );
  109.         WVARIANT_BOOL GetStrikethrough( void );
  110.         void SetWeight( short );
  111.         short GetWeight( void );
  112.         void SetCharset( short );
  113.         short GetCharset( void );
  114.  
  115.         _Font & operator=( const WVariant & v ) { WOleDispatchHelper::Create( (WPIDispatch)v ); return *this; }
  116.         _Font & operator=( WPIDispatch p ) { WOleDispatchHelper::Create( p ); return *this; }
  117. };
  118.  
  119. class WCMCLASS StdFont : public WOleProgrammableObject {
  120.  
  121.     public:
  122.  
  123.         StdFont();
  124.         ~StdFont();
  125.  
  126.         /* Properties */
  127.         void SetName( WBString );
  128.         WBString GetName( void );
  129.         void SetSize( WCurrency );
  130.         WCurrency GetSize( void );
  131.         void SetBold( WVARIANT_BOOL );
  132.         WVARIANT_BOOL GetBold( void );
  133.         void SetItalic( WVARIANT_BOOL );
  134.         WVARIANT_BOOL GetItalic( void );
  135.         void SetUnderline( WVARIANT_BOOL );
  136.         WVARIANT_BOOL GetUnderline( void );
  137.         void SetStrikethrough( WVARIANT_BOOL );
  138.         WVARIANT_BOOL GetStrikethrough( void );
  139.         void SetWeight( short );
  140.         short GetWeight( void );
  141.         void SetCharset( short );
  142.         short GetCharset( void );
  143.  
  144.     private:
  145.  
  146.         const WChar * GetRegisteredClass();
  147.  
  148.     private:
  149.  
  150.         WString         _clsid;
  151. };
  152.  
  153. #ifndef _OLECTL_H_
  154.  
  155. class __stdcall IPicture : public IUnknown {
  156.  
  157.     public:
  158.  
  159.         /* Methods */
  160.         virtual WHRESULT GetHandle( OLE_HANDLE * __phandle ) = 0;
  161.         virtual WHRESULT GethPal( OLE_HANDLE * __phpal ) = 0;
  162.         virtual WHRESULT GetType( short * __ptype ) = 0;
  163.         virtual WHRESULT GetWidth( OLE_XSIZE_HIMETRIC * __pwidth ) = 0;
  164.         virtual WHRESULT GetHeight( OLE_YSIZE_HIMETRIC * __pheight ) = 0;
  165.         virtual WHRESULT Render( int __hdc, long __x, long __y, long __cx, long __cy, OLE_XPOS_HIMETRIC __xSrc, OLE_YPOS_HIMETRIC __ySrc, OLE_XSIZE_HIMETRIC __cxSrc
  166.             , OLE_YSIZE_HIMETRIC __cySrc, void const * __lprcWBounds ) = 0;
  167.         virtual WHRESULT SethPal( OLE_HANDLE __hPal ) = 0;
  168.         virtual WHRESULT GetCurDC( int * __phdcOut ) = 0;
  169.         virtual WHRESULT SelectPicture( int __hdcIn, int * __phdcOut, OLE_HANDLE * __phbmpOut ) = 0;
  170.         virtual WHRESULT GetKeepOriginalFormat( WVARIANT_BOOL * __pfkeep ) = 0;
  171.         virtual WHRESULT SetKeepOriginalFormat( WVARIANT_BOOL __KeepOriginalFormat ) = 0;
  172.         virtual WHRESULT PictureChanged( void ) = 0;
  173.         virtual WHRESULT SaveAsFile( void const * __lpstream, WVARIANT_BOOL __fSaveMemCopy, long * __lpcbSize ) = 0;
  174.         virtual WHRESULT GetAttributes( long * __lpdwAttr ) = 0;
  175.         virtual WHRESULT SetHdc( OLE_HANDLE __hdc ) = 0;
  176. };
  177.  
  178. #endif // _OLECTL_H_
  179.  
  180. class WCMCLASS _Picture : public WOleDispatchHelper {
  181.  
  182.     public:
  183.  
  184.         _Picture();
  185.         ~_Picture();
  186.  
  187.         /* Methods */
  188.         void Render( int __hdc, long __x, long __y, long __cx, long __cy, OLE_XPOS_HIMETRIC __xSrc, OLE_YPOS_HIMETRIC __ySrc, OLE_XSIZE_HIMETRIC __cxSrc
  189.             , OLE_YSIZE_HIMETRIC __cySrc, void * __lprcWBounds );
  190.  
  191.         /* Properties */
  192.         OLE_HANDLE GetHandle( void );
  193.         void SethPal( OLE_HANDLE );
  194.         OLE_HANDLE GethPal( void );
  195.         short GetType( void );
  196.         OLE_XSIZE_HIMETRIC GetWidth( void );
  197.         OLE_YSIZE_HIMETRIC GetHeight( void );
  198.  
  199.         _Picture & operator=( const WVariant & v ) { WOleDispatchHelper::Create( (WPIDispatch)v ); return *this; }
  200.         _Picture & operator=( WPIDispatch p ) { WOleDispatchHelper::Create( p ); return *this; }
  201. };
  202.  
  203. class WCMCLASS StdPicture : public WOleProgrammableObject {
  204.  
  205.     public:
  206.  
  207.         StdPicture();
  208.         ~StdPicture();
  209.  
  210.         /* Methods */
  211.         void Render( int __hdc, long __x, long __y, long __cx, long __cy, OLE_XPOS_HIMETRIC __xSrc, OLE_YPOS_HIMETRIC __ySrc, OLE_XSIZE_HIMETRIC __cxSrc
  212.             , OLE_YSIZE_HIMETRIC __cySrc, void * __lprcWBounds );
  213.  
  214.         /* Properties */
  215.         OLE_HANDLE GetHandle( void );
  216.         void SethPal( OLE_HANDLE );
  217.         OLE_HANDLE GethPal( void );
  218.         short GetType( void );
  219.         OLE_XSIZE_HIMETRIC GetWidth( void );
  220.         OLE_YSIZE_HIMETRIC GetHeight( void );
  221.  
  222.     private:
  223.  
  224.         const WChar * GetRegisteredClass();
  225.  
  226.     private:
  227.  
  228.         WString         _clsid;
  229. };
  230.  
  231. #endif // _StdType_HPP_INCLUDED
  232.  
  233. #ifdef GUID_DEFINED
  234. extern WHRESULT WEXPORT WOleLoadRegTypeLib( const GUID & rguid,
  235.                                             unsigned short wVerMajor,
  236.                                             unsigned short wVerMinor,
  237.                                             unsigned long lcid,
  238.                                             ITypeLib **pptlib );
  239.  
  240. extern WHRESULT WEXPORT WOleDispGetIDsOfNames( ITypeInfo *ptinfo,
  241.                                                long char **rgszNames,
  242.                                                unsigned int cNames,
  243.                                                long *rgdispid);
  244.  
  245. extern WBool WEXPORT WOleIsEqualGUID( const GUID & guid1,
  246.                                       const GUID & guid2 );
  247. #define WOleIsEqualCLSID WOleIsEqualGUID
  248. #define WOleIsEqualIID WOleIsEqualGUID
  249.  
  250. extern WBool WEXPORT operator==(const WGUID& wguid, const GUID& guid );
  251. extern WBool WEXPORT operator!=(const WGUID& wguid, const GUID& guid );
  252.  
  253. extern WBool WEXPORT operator==(const GUID& guid, const WGUID& wguid );
  254. extern WBool WEXPORT operator!=(const GUID& guid, const WGUID& wguid );
  255. #endif
  256.  
  257.