home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / wstdtype.hpp < prev    next >
C/C++ Source or Header  |  1996-11-15  |  9KB  |  252 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 get_Name( WBStr * __pname ) = 0;
  65.         virtual WHRESULT put_Name( WBStr __Name ) = 0;
  66.         virtual WHRESULT get_Size( WCurrency * __psize ) = 0;
  67.         virtual WHRESULT put_Size( WCurrency __Size ) = 0;
  68.         virtual WHRESULT get_Bold( WVARIANT_BOOL * __pbold ) = 0;
  69.         virtual WHRESULT put_Bold( WVARIANT_BOOL __Bold ) = 0;
  70.         virtual WHRESULT get_Italic( WVARIANT_BOOL * __pitalic ) = 0;
  71.         virtual WHRESULT put_Italic( WVARIANT_BOOL __Italic ) = 0;
  72.         virtual WHRESULT get_Underline( WVARIANT_BOOL * __punderline ) = 0;
  73.         virtual WHRESULT put_Underline( WVARIANT_BOOL __Underline ) = 0;
  74.         virtual WHRESULT get_Strikethrough( WVARIANT_BOOL * __pstrikethrough ) = 0;
  75.         virtual WHRESULT put_Strikethrough( WVARIANT_BOOL __Strikethrough ) = 0;
  76.         virtual WHRESULT get_Weight( short * __pweight ) = 0;
  77.         virtual WHRESULT put_Weight( short __Weight ) = 0;
  78.         virtual WHRESULT get_Charset( short * __pcharset ) = 0;
  79.         virtual WHRESULT put_Charset( short __Charset ) = 0;
  80.         virtual WHRESULT get_hFont( 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 get_Handle( OLE_HANDLE * __phandle ) = 0;
  161.         virtual WHRESULT get_hPal( OLE_HANDLE * __phpal ) = 0;
  162.         virtual WHRESULT get_Type( short * __ptype ) = 0;
  163.         virtual WHRESULT get_Width( OLE_XSIZE_HIMETRIC * __pwidth ) = 0;
  164.         virtual WHRESULT get_Height( 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 set_hPal( OLE_HANDLE __hPal ) = 0;
  168.         virtual WHRESULT get_CurDC( int * __phdcOut ) = 0;
  169.         virtual WHRESULT SelectPicture( int __hdcIn, int * __phdcOut, OLE_HANDLE * __phbmpOut ) = 0;
  170.         virtual WHRESULT get_KeepOriginalFormat( WVARIANT_BOOL * __pfkeep ) = 0;
  171.         virtual WHRESULT put_KeepOriginalFormat( WVARIANT_BOOL __fkeep ) = 0;
  172.         virtual WHRESULT PictureChanged( void ) = 0;
  173.         virtual WHRESULT SaveAsFile( void const * __lpstream, WVARIANT_BOOL __fSaveMemCopy, long * __lpcbSize ) = 0;
  174.         virtual WHRESULT get_Attributes( 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.         OLE_HANDLE GethPal( void );
  194.         short GetType( void );
  195.         OLE_XSIZE_HIMETRIC GetWidth( void );
  196.         OLE_YSIZE_HIMETRIC GetHeight( void );
  197.  
  198.         _Picture & operator=( const WVariant & v ) { WOleDispatchHelper::Create( (WPIDispatch)v ); return *this; }
  199.         _Picture & operator=( WPIDispatch p ) { WOleDispatchHelper::Create( p ); return *this; }
  200. };
  201.  
  202. class WCMCLASS StdPicture : public WOleProgrammableObject {
  203.  
  204.     public:
  205.  
  206.         StdPicture();
  207.         ~StdPicture();
  208.  
  209.         /* Methods */
  210.         void Render( int __hdc, long __x, long __y, long __cx, long __cy, OLE_XPOS_HIMETRIC __xSrc, OLE_YPOS_HIMETRIC __ySrc, OLE_XSIZE_HIMETRIC __cxSrc
  211.             , OLE_YSIZE_HIMETRIC __cySrc, void * __lprcWBounds );
  212.  
  213.         /* Properties */
  214.         OLE_HANDLE GetHandle( void );
  215.         OLE_HANDLE GethPal( void );
  216.         short GetType( void );
  217.         OLE_XSIZE_HIMETRIC GetWidth( void );
  218.         OLE_YSIZE_HIMETRIC GetHeight( void );
  219.  
  220.     private:
  221.  
  222.         const WChar * GetRegisteredClass();
  223.  
  224.     private:
  225.  
  226.         WString         _clsid;
  227. };
  228.  
  229. #endif
  230.  
  231. extern WHRESULT WEXPORT WOleLoadRegTypeLib( const GUID & rguid,
  232.                                             unsigned short wVerMajor,
  233.                                             unsigned short wVerMinor,
  234.                                             unsigned long lcid,
  235.                                             ITypeLib **pptlib );
  236.  
  237. extern WHRESULT WEXPORT WOleDispGetIDsOfNames( ITypeInfo *ptinfo,
  238.                                                long char **rgszNames,
  239.                                                unsigned int cNames,
  240.                                                long *rgdispid);
  241.  
  242. extern WBool WEXPORT WOleIsEqualGUID( const GUID & guid1,
  243.                                       const GUID & guid2 );
  244. #define WOleIsEqualCLSID WOleIsEqualGUID
  245. #define WOleIsEqualIID WOleIsEqualGUID
  246.  
  247. extern WBool operator==(const WGUID& wguid, const GUID& guid );
  248. extern WBool operator!=(const WGUID& wguid, const GUID& guid );
  249.  
  250. extern WBool operator==(const GUID& guid, const WGUID& wguid );
  251. extern WBool operator!=(const GUID& guid, const WGUID& wguid );
  252.