home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / webexwin.h < prev    next >
C/C++ Source or Header  |  1997-02-23  |  11KB  |  330 lines

  1. /******************************************************************************/
  2. /*  IBM Web Explorer View Window API                                          */
  3. /*                                                                            */
  4. /*  (C) Copyright IBM Corp. 1995                                              */
  5. /*  All Rights Reserved.                                                      */
  6. /*                                                                            */
  7. /*                                                                            */ 
  8. /******************************************************************************/
  9.  
  10. #ifndef WEBXWIN__H
  11. #define WEBXWIN__H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #if !defined( WARPONLY ) && !defined( __PPC__ )
  16. // typedef const PSZ PCSZ ; /* not in the OS/2 hdr files prior to Warp */
  17. #endif
  18.  
  19. #define WC_WXVIEW    "WXViewWC"
  20.  
  21. #define WXSMALLSTRING   32
  22. #define WXMEDSTRING    256
  23. #define WXLARGESTRING 1024
  24.  
  25. #define WXMAXMSG       256
  26.  
  27. /*
  28. ** Error codes
  29. */
  30. #define WX_ERROR      (APIRET)-1
  31. #define WX_SUCCESS     0
  32. #define WX_CANCELLED   1
  33.  
  34. #define WXENONE        0
  35. #define WXEINVAL       1
  36. #define WXEINPROGRESS  2
  37. #define WXEFILE        3
  38. #define WXENODOC       4
  39. #define WXEBUFSIZE     5
  40. #define WXENOPROXY     6
  41. #define WXENOSOCKS     7
  42. #define WXEMIME        8
  43. #define WXENOTFOUND    9
  44. #define WXEINTR        10
  45. #define WXENOANCHOR    11
  46.  
  47. /*
  48. ** WX_* window messages
  49. */
  50. #define WX_MOUSEMOVE            (WM_USER + 1000)
  51. #define WX_BUTTONCLICK          (WM_USER + 1001)
  52. #define WX_LOADRESULT           (WM_USER + 1004)
  53. #define WX_LOADSTATUS           (WM_USER + 1005)
  54. #define WX_PRINTRESULT          (WM_USER + 1006)
  55. #define WX_MSGERROR             (WM_USER + 1007)
  56. #define WX_MSGINFO              (WM_USER + 1008)
  57. #define WX_MSGSTATUS            (WM_USER + 1009)
  58. #define WX_DISPLAYDIALOG        (WM_USER + 1010)
  59. #define WX_MSGSECURITY          (WM_USER + 1011)
  60. #define WX_CHANGEEXPIREDPASSWD  (WM_USER + 1012)
  61. #define WX_SELNEWPRIVKEY        (WM_USER + 1013)
  62.  
  63. /*
  64. ** internal window messages
  65. */
  66. #define WX_QUERYDOC      WM_USER + 2000
  67.  
  68.  typedef ULONG WXFLAGS ;
  69.  typedef WXFLAGS *PWXFLAGS ;
  70.  typedef PVOID PWXOPAQUE ;
  71.  
  72. #define WXLOAD_ANCHOR       0
  73. #define WXLOAD_FORCERELOAD  1
  74. #define WXLOAD_IMGMAP       2
  75. #define WXLOAD_FORM         4
  76.  
  77.  typedef PVOID WXANCHORDATA ;
  78.  typedef WXANCHORDATA *PWXANCHORDATA ;
  79.  
  80.  typedef struct _wxINITDATA {
  81.     USHORT usLen ;                          /* length of this structure */
  82.     USHORT usThreads ;                      /* number of img loading threads */
  83.     BOOL   bPaletteMgmt ;                   /* palette mgmt on or off? */
  84.  } WXINITDATA ;
  85.  typedef WXINITDATA *PWXINITDATA ;
  86.  
  87. /*
  88. ** Cache options structures
  89. */
  90.  typedef struct _wxCACHEOPTS {
  91.     BOOL bEnabled ;                        /* enable, disable cacheing */
  92.     BOOL bMemoryImageCacheing;             /* keep cached images in memory */
  93.     LONG lDocLimit ;                       /* number of docs to cache */
  94.     LONG lImageLimit ;                     /* number of images to cache */
  95.     CHAR szCacheDir[WXMEDSTRING];          /* directory for cacheing to disk */
  96.  } WXCACHEOPTS ;
  97.  typedef WXCACHEOPTS *PWXCACHEOPTS ;
  98.  
  99. /*
  100. ** Display options structures
  101. */
  102. typedef ULONG WXFONTSIZE ;
  103. #define WXFONT_SMALL  0
  104. #define WXFONT_NORMAL 1
  105. #define WXFONT_LARGE  2
  106. #define WXFONT_XLARGE 3
  107.  
  108.  typedef struct _wxDISPLAYOPTS {
  109.     CHAR szFontName[ WXSMALLSTRING ] ;
  110.     WXFONTSIZE wxFontSize ;
  111.     BOOL bUnderlineAnchors ;               /* use underline text for links */
  112.  
  113.     LONG lClrText ;                        /* text color */
  114.     LONG lClrAnchor ;                      /* link color */
  115.     LONG lClrVisitedAnchor ;               /* seen link color */
  116.     LONG lClrBackground ;                  /* bg view color */
  117.  
  118.     BOOL bInlineGraphics ;                 /* show inline images? */
  119.     BOOL bFastLoad ;                       /* load document ahead of images? */
  120.     BOOL bStreamingGraphics ;              /* scanline-at-a-time redraw? */
  121.     BOOL bFancyInterlace ;                 /* blur the ilaced GIF? */
  122.  
  123.     BOOL bInternalViewer ;                 /* view standalone imgs in view? */
  124.     BOOL bIgnoreImgErrors ;                /* toggle display of red "X" on error */
  125.  } WXDISPLAYOPTS ;
  126.  typedef WXDISPLAYOPTS *PWXDISPLAYOPTS ;
  127.  
  128. /*
  129. ** Network and Gateway options
  130. */
  131.  typedef ULONG WXGATEWAY ;
  132. #define WXGATEWAY_NONE          0
  133. #define WXGATEWAY_PROXY         1          /* gateway flags can be OR'ed */
  134. #define WXGATEWAY_SOCKS         2
  135.  
  136.  typedef struct _wxNETWORKOPTS {
  137.     CHAR szEmailAddress[ WXLARGESTRING ] ;     /* user@host smtp style address */
  138.     CHAR szNewsServer[ WXLARGESTRING ] ;       /* news hostname/ip address */
  139.  
  140.     WXGATEWAY wxGateway ;                      /* proxy or socks server state */
  141.     CHAR szHTTPProxyServer[ WXLARGESTRING ] ;  /* proxy gw (http://..) */
  142.     CHAR szSocksServer[ WXLARGESTRING ] ;      /* socks gw hostname/ip address */
  143.  } WXNETWORKOPTS ;
  144.  typedef WXNETWORKOPTS *PWXNETWORKOPTS ;
  145.  
  146. /*
  147. ** MIME type mapping to external viewers
  148. */
  149.  typedef struct _wxVIEWER {
  150.     CHAR  szMIMEType[ WXMEDSTRING ] ;       /* MIME type to be viewed */
  151.     CHAR  szProgram[ WXLARGESTRING ] ;      /* program to use as a viewer */
  152.  } WXVIEWER ;
  153.  typedef WXVIEWER *PWXVIEWER ;
  154.  
  155. /*
  156. ** extension mapping to MIME types
  157. */
  158.  typedef ULONG WXDATAFORMAT ;
  159. #define  WXFORMAT_BINARY 0
  160. #define  WXFORMAT_7BIT   1
  161. #define  WXFORMAT_8BIT   2
  162.  
  163.  typedef struct _wxEXTMAP {
  164.     CHAR szExtension[ WXMEDSTRING ] ;      /* extension to be mapped */
  165.     CHAR szMIMEType[ WXMEDSTRING ] ;       /* MIME type to assign to this ext */
  166.     WXDATAFORMAT wxFormat ;                /* binary, 7bit, etc. */
  167.  } WXEXTMAP ;
  168.  typedef WXEXTMAP *PWXEXTMAP ;
  169.  
  170. /*
  171. ** Miscellaneous flags
  172. */
  173. #define WXANCHOR_DEFAULT 0                 /* can be OR'ed together */
  174. #define WXANCHOR_VISITED 1
  175.  
  176.  typedef ULONG WXSEARCHOPTS ;
  177. #define  WXSEARCH_FORWARD  0
  178. #define  WXSEARCH_BACKWARD 1
  179.  
  180.  typedef ULONG WXPOINTERTYPE ;
  181. #define  WXPOINTER_NORMAL  0
  182. #define  WXPOINTER_WAIT    1
  183. #define  WXPOINTER_ANCHOR  2
  184. #define  WXPOINTER_UNKNOWN 3
  185.  
  186. /*
  187. ** Internal web explorer position indicator
  188. */
  189.  typedef struct _wxPOS {
  190.     ULONG  ulComponent ;
  191.     USHORT x ;
  192.     USHORT y ;
  193.  } WXPOS ;
  194.  typedef WXPOS *PWXPOS ;
  195.  
  196. #define WXPOS_NONE     0
  197. #define WXPOS_ANCHOR   1
  198. #define WXPOS_IMGMAP   2
  199. #define WXPOS_FORM     4
  200.  
  201.  typedef struct _wxMOUSEDATA {
  202.     USHORT x ;
  203.     USHORT y ;
  204.     USHORT uswHitTest ;
  205.     USHORT fsFlags ;
  206.     WXFLAGS wxflPosType ;
  207.  } WXMOUSEDATA ;
  208.  typedef WXMOUSEDATA *PWXMOUSEDATA ;
  209.  
  210.  typedef struct _wxBUTTONDATA {
  211.     USHORT usButtonNum ;
  212.     USHORT usClickNum ;
  213.     SHORT  x ;
  214.     SHORT  y ;
  215.     USHORT fsHitTestRes ;
  216.     USHORT fsFlags ;
  217.     WXFLAGS wxflPosType ;
  218.  } WXBUTTONDATA ;
  219.  typedef WXBUTTONDATA *PWXBUTTONDATA ;
  220.  
  221. /*
  222. ** Printer information
  223. */
  224.  typedef struct _wxPRINTINFO {
  225.     PDRIVDATA pDriverData ;
  226.     CHAR szDriverName[WXMEDSTRING] ;
  227.     CHAR szQueueName[WXMEDSTRING] ;
  228.     CHAR szQueueDesc[WXMEDSTRING] ;
  229.     UINT nCopies ;
  230.  } WXPRINTINFO ;
  231.  typedef WXPRINTINFO *PWXPRINTINFO ;
  232.  
  233. /*
  234. ** Thread data structure for updating progress
  235. */
  236. #define WXTHREAD_IDLE     0
  237. #define WXTHREAD_CONNECT  1
  238. #define WXTHREAD_WAIT     2
  239. #define WXTHREAD_DATA     3
  240. #define WXTHREAD_RENDER   4
  241. #define WXTHREAD_BEGINDOC 5
  242. #define WXTHREAD_ENDDOC   6
  243.  
  244. #define WXTHDIDX_DOC  0
  245. #define WXTHDIDX_FMT  1
  246. #define WXTHDIDX_IMG1 2
  247. #define WXTHDIDX_IMG2 3
  248. #define WXTHDIDX_IMG3 4
  249. #define WXTHDIDX_IMG4 5
  250. #define WXTHDIDX_IMG5 6
  251. #define WXTHDIDX_IMG6 7
  252. #define WXTHDIDX_IMG7 8
  253. #define WXTHDIDX_IMG8 9
  254. #define WXTHDIDX_NUM  10
  255.  
  256.  typedef struct _wxTHREADATA {
  257.     WXFLAGS wxflState ;
  258.     ULONG ulProgressCount ;
  259.     ULONG ulProgressLimit ;
  260.  } WXTHREADDATA ;
  261.  typedef WXTHREADDATA *PWXTHREADDATA ;
  262.  
  263.  typedef struct _wxMSGDATA {
  264.     ULONG     ulMsgID ;
  265.     PWXOPAQUE pwxMsgData ;
  266.     PWXOPAQUE pwxRetData;
  267.  } WXMSGDATA ;
  268.  typedef WXMSGDATA *PWXMSGDATA ;
  269.  
  270. /*
  271. ** Main viewer API entry points
  272. */
  273.  USHORT APIENTRY WXViewQueryVersion( VOID ) ;
  274.  APIRET APIENTRY WXViewLoad( HWND, PCSZ, WXFLAGS, PWXANCHORDATA ) ;
  275.  BOOL   APIENTRY WXViewIsLoading( HWND ) ;
  276.  APIRET APIENTRY WXViewLoadToFile( HWND, PCSZ, PCSZ, WXFLAGS, PWXANCHORDATA ) ;
  277.  APIRET APIENTRY WXViewCancelLoad( HWND ) ;
  278.  APIRET APIENTRY WXViewPrint( HWND, PWXPRINTINFO, USHORT ) ;
  279.  APIRET APIENTRY WXViewSearch( HWND, WXSEARCHOPTS, PWXPOS, PWXPOS, PCSZ ) ;
  280.  APIRET APIENTRY WXViewQueryLastError( HWND ) ;
  281.  APIRET APIENTRY WXViewQueryLastLoadError( HWND ) ;
  282.  
  283. /*
  284. ** Document manipulation functions
  285. */
  286.  APIRET APIENTRY WXViewQueryPos( HWND, USHORT, USHORT, PWXPOS ) ;
  287.  APIRET APIENTRY WXViewQueryAnchor( HWND, PWXPOS, PSZ, USHORT) ;
  288.  USHORT APIENTRY WXViewQueryAnchorLen( HWND, PWXPOS ) ;
  289.  APIRET APIENTRY WXViewQueryAnchorData( HWND, PWXPOS, PWXANCHORDATA, USHORT ) ;
  290.  USHORT APIENTRY WXViewQueryAnchorDataLen( HWND, PWXPOS ) ;
  291.  
  292.  APIRET APIENTRY WXViewQueryDocAnchor( HWND, PSZ, USHORT ) ;
  293.  USHORT APIENTRY WXViewQueryDocAnchorLen( HWND ) ;
  294.  
  295.  APIRET APIENTRY WXViewQueryDocTitle( HWND, PSZ, USHORT ) ;
  296.  USHORT APIENTRY WXViewQueryDocTitleLen( HWND ) ;
  297.  
  298.  APIRET APIENTRY WXViewQueryAnchorState( HWND, PCSZ, PWXFLAGS ) ;
  299.  APIRET APIENTRY WXViewSetAnchorState( HWND, PCSZ, WXFLAGS ) ;
  300.  
  301. /*
  302. ** Configuration API
  303. */
  304.  HPOINTER APIENTRY WXViewQueryPointer( HWND, WXPOINTERTYPE ) ;
  305.  APIRET APIENTRY WXViewSetPointer( HWND, WXPOINTERTYPE, HPOINTER ) ;
  306.  
  307.  APIRET APIENTRY WXViewQueryCacheOpts( HWND, PWXCACHEOPTS, USHORT ) ;
  308.  APIRET APIENTRY WXViewSetCacheOpts( HWND, PWXCACHEOPTS, USHORT ) ;
  309.  
  310.  APIRET APIENTRY WXViewQueryDisplayOpts( HWND, PWXDISPLAYOPTS, USHORT ) ;
  311.  APIRET APIENTRY WXViewSetDisplayOpts( HWND, PWXDISPLAYOPTS, USHORT ) ;
  312.  
  313.  APIRET APIENTRY WXViewQueryNetworkOpts( HWND, PWXNETWORKOPTS, USHORT ) ;
  314.  APIRET APIENTRY WXViewSetNetworkOpts( HWND, PWXNETWORKOPTS, USHORT ) ;
  315.  APIRET APIENTRY WXViewEnableGateway( HWND, WXGATEWAY ) ;
  316.  
  317.  APIRET APIENTRY WXViewQueryViewer( HWND, PCSZ, PWXVIEWER, USHORT ) ;
  318.  APIRET APIENTRY WXViewSetViewer( HWND, PWXVIEWER, USHORT ) ;
  319.  APIRET APIENTRY WXViewQueryExtMap( HWND, PCSZ, PWXEXTMAP, USHORT ) ;
  320.  APIRET APIENTRY WXViewSetExtMap( HWND, PWXEXTMAP, USHORT ) ;
  321.  
  322. /*
  323. ** Miscellaneous API functions
  324. */
  325.  APIRET APIENTRY WXViewQueryMsgStr( HWND, PWXMSGDATA, PSZ, USHORT ) ;
  326. #ifdef __cplusplus
  327. }
  328. #endif
  329. #endif /* WEBXWIN__H */
  330.