home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / exdisp.odl < prev    next >
Text File  |  1998-04-25  |  16KB  |  346 lines

  1. #include <olectl.h>
  2. #include "exdispid.h"
  3.  
  4. //
  5. // BUGBUG: headerfiles are screwy!!!
  6. //
  7. // Any changes (renames/additions/deletions) of IIDs, DIID,
  8. // or CLSIDs to this file needs to be reflected in nashsdk\inc\shlguid.w
  9. //
  10.  
  11. //+-------------------------------------------------------------------------
  12. //
  13. //  Microsoft Windows
  14. //  Copyright 1995 - 1996 Microsoft Corporation. All Rights Reserved.
  15. //
  16. //--------------------------------------------------------------------------
  17.  
  18. //=--------------------------------------------------------------------------=
  19. // the libid for this type libray
  20. //
  21. [
  22.     uuid(EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B),
  23.     helpstring("Microsoft Internet Controls"), // VB has a maximum limit for this helpstring!
  24.     lcid(0x0000),
  25.     version(1.0)
  26. ]
  27. library SHDocVw {
  28.  
  29.     // standard imports
  30.     //
  31.     importlib(STDOLE_TLB);
  32.  
  33.  
  34.     //
  35.     // IWebBrowser
  36.     //
  37.  
  38.  
  39.     [
  40.         uuid(EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B),
  41.         helpstring("Web Browser interface"),
  42.         helpcontext(0x0000),
  43.         hidden,
  44.         dual,
  45.         odl
  46.     ]
  47.     interface IWebBrowser : IDispatch {
  48.         //
  49.         // Methods
  50.         //
  51.  
  52.         [id(100), helpstring("Navigates to the previous item in the history list."), helpcontext(0x0000)]
  53.             HRESULT GoBack();
  54.         [id(101), helpstring("Navigates to the next item in the history list."), helpcontext(0x0000)]
  55.             HRESULT GoForward();
  56.         [id(102), helpstring("Go home/start page."), helpcontext(0x0000)]
  57.             HRESULT GoHome();
  58.         [id(103), helpstring("Go Search Page."), helpcontext(0x0000)]
  59.             HRESULT GoSearch();
  60.  
  61.         [id(104), helpstring("Navigates to a URL or file."), helpcontext(0x0000)]
  62.             HRESULT Navigate([in] BSTR URL,
  63.                              [in, optional] VARIANT * Flags,
  64.                              [in, optional] VARIANT * TargetFrameName,
  65.                              [in, optional] VARIANT * PostData,
  66.                              [in, optional] VARIANT * Headers);
  67.  
  68.             // Flags
  69.             typedef
  70.             [
  71.                 uuid(14EE5380-A378-11cf-A731-00A0C9082637),
  72.                 helpstring("Constants for WebBrowser navigation flags")
  73.             ]
  74.             enum BrowserNavConstants {
  75.                 [helpstring("Open in new window")]          navOpenInNewWindow = 0x0001,
  76.                 [helpstring("Exclude from history list")]   navNoHistory = 0x0002,
  77.                 [helpstring("Don't read from cache")]       navNoReadFromCache = 0x0004,
  78.                 [helpstring("Don't write from cache")]      navNoWriteToCache = 0x0008,
  79.             } BrowserNavConstants;
  80.  
  81.         [id(DISPID_REFRESH), helpstring("Refresh the currently viewed page."), helpcontext(0x0000)]
  82.             HRESULT Refresh();
  83.  
  84.         // The standard Refresh takes no parameters and we need some... use a new name
  85.         [id(105), helpstring("Refresh the currently viewed page."), helpcontext(0x0000)]
  86.             HRESULT Refresh2([in,optional] VARIANT * Level);
  87.  
  88.             // Level
  89.             typedef
  90.             [
  91.                 uuid(C317C261-A991-11cf-A731-00A0C9082637),
  92.                 helpstring("Constants for Refresh")
  93.             ]
  94.             enum RefreshConstants {                                         // must map to these in sdk\inc\docobj.h
  95.                 [helpstring("Refresh normal")]     REFRESH_NORMAL     = 0,  //== OLECMDIDF_REFRESH_NORMAL
  96.                 [helpstring("Refresh if expired")] REFRESH_IFEXPIRED  = 1,  //== OLECMDIDF_REFRESH_IFEXPIRED
  97.                 [helpstring("Refresh completely")] REFRESH_COMPLETELY = 3   //== OLECMDIDF_REFRESH_COMPLETELY
  98.             } RefreshConstants;
  99.  
  100.         [id(106), helpstring("Stops opening a file."), helpcontext(0x0000)]
  101.             HRESULT Stop();
  102.  
  103.         //
  104.         // Properties
  105.         //
  106.  
  107.         // Automation heirarchy...
  108.         [id(200), propget, helpstring("Returns the application automation object if accessible, this automation object otherwise.."), helpcontext(0x0000)]
  109.             HRESULT Application([out,retval] IDispatch** ppDisp);
  110.  
  111.         [id(201), propget, helpstring("Returns the automation object of the container/parent if one exists or this automation object."), helpcontext(0x0000)]
  112.             HRESULT Parent([out,retval] IDispatch** ppDisp);
  113.  
  114.         [id(202), propget, helpstring("Returns the container/parent automation object, if any."), helpcontext(0x0000)]
  115.             HRESULT Container([out,retval] IDispatch** ppDisp);
  116.  
  117.         [id(203), propget, helpstring("Returns the active Document automation object, if any."), helpcontext(0x0000)]
  118.             HRESULT Document([out,retval] IDispatch** ppDisp);
  119.  
  120.         [id(204), propget, helpstring("Returns True if this is the top level object."), helpcontext(0x0000)]
  121.             HRESULT TopLevelContainer([out, retval] boolean* pBool);
  122.  
  123.         [id(205), propget, helpstring("Returns the type of the contained document object."), helpcontext(0x0000)]
  124.             HRESULT Type([out,retval] BSTR* pbstrType);
  125.  
  126.         // Window stuff...
  127.         [id(206), propget, helpstring("The horizontal position (pixels) of the frame window relative to the screen/container."), helpcontext(0x0000)]
  128.             HRESULT Left([out, retval] long *pl);
  129.         [id(206), propput]
  130.             HRESULT Left([in] long Left);
  131.         [id(207), propget, helpstring("The vertical position (pixels) of the frame window relative to the screen/container."), helpcontext(0x0000)]
  132.             HRESULT Top([out, retval] long *pl);
  133.         [id(207), propput]
  134.             HRESULT Top([in] long Top);
  135.         [id(208), propget, helpstring("The horizontal dimension (pixels) of the frame window/object."), helpcontext(0x0000)]
  136.             HRESULT Width([out, retval] long *pl);
  137.         [id(208), propput]
  138.             HRESULT Width([in] long Width);
  139.         [id(209), propget, helpstring("The vertical dimension (pixels) of the frame window/object."), helpcontext(0x0000)]
  140.             HRESULT Height([out, retval] long *pl);
  141.         [id(209), propput]
  142.             HRESULT Height([in] long Height);
  143.  
  144.         // WebBrowser stuff...
  145.         [id(210), propget, helpstring("Gets the short (UI-friendly) name of the URL/file currently viewed."), helpcontext(0x0000)]
  146.             HRESULT LocationName([out,retval] BSTR * pbstrLocationName);
  147.  
  148.         [id(211), propget, helpstring("Gets the full URL/path currently viewed."), helpcontext(0x0000)]
  149.             HRESULT LocationURL([out,retval] BSTR * pbstrLocationURL);
  150.  
  151.         // Added a property to see if the viewer is currenly busy or not...
  152.         [id(212), propget, helpstring("Query to see if something is still in progress."), helpcontext(0x0000)]
  153.             HRESULT Busy([out,retval] boolean *pBool);
  154.     };
  155.  
  156.     // event interface for IWebBrowser controls ...
  157.     //
  158.     [
  159.         uuid(EAB22AC2-30C1-11CF-A7EB-0000C05BAE0B),
  160.         helpstring("Event interface for Web Browser Control"),
  161.         hidden
  162.     ]
  163.     dispinterface DWebBrowserEvents {
  164.         properties:
  165.         methods:
  166.  
  167.         [id(DISPID_BEFORENAVIGATE), helpstring("Fired when a new hyperlink is being navigated to."), helpcontext(0x0000)]
  168.             void BeforeNavigate([in] BSTR URL, long Flags, BSTR TargetFrameName, VARIANT * PostData, BSTR Headers, [in, out]boolean * Cancel);
  169.  
  170.         [id(DISPID_NAVIGATECOMPLETE), helpstring("Fired when a new hyperlink is being navigated to."), helpcontext(0x0000)]
  171.             void NavigateComplete([in] BSTR URL );
  172.  
  173.         [id(DISPID_STATUSTEXTCHANGE), helpstring("Statusbar text changed."), helpcontext(0x0000)]
  174.             void StatusTextChange([in]BSTR Text);
  175.  
  176.         [id(DISPID_PROGRESSCHANGE), helpstring("Fired when download progress is updated."), helpcontext(0x0000)]
  177.             void ProgressChange([in] long Progress, [in] long ProgressMax);
  178.  
  179.         [id(DISPID_DOWNLOADCOMPLETE), helpstring("Download of page complete."), helpcontext(0x0000)]
  180.             void DownloadComplete();
  181.  
  182.         [id(DISPID_COMMANDSTATECHANGE), helpstring("The enabled state of a command changed"), helpcontext(0x0000)]
  183.             void CommandStateChange([in] long Command, [in] boolean Enable);
  184.  
  185.         [id(DISPID_DOWNLOADBEGIN), helpstring("Download of a page started."), helpcontext(0x000)]
  186.             void DownloadBegin();
  187.  
  188.         [id(DISPID_NEWWINDOW), helpstring("Fired when a new window should be created."), helpcontext(0x0000)]
  189.             void NewWindow([in] BSTR URL, [in] long Flags, [in] BSTR TargetFrameName, [in] VARIANT * PostData, [in] BSTR Headers, [in,out] BOOLEAN * Processed);
  190.  
  191.         [id(DISPID_TITLECHANGE), helpstring("Document title changed."), helpcontext(0x0000)]
  192.             void TitleChange([in]BSTR Text);
  193.  
  194.         [id(DISPID_FRAMEBEFORENAVIGATE), helpstring("Fired when a new hyperlink is being navigated to in a frame."), helpcontext(0x0000)]
  195.             void FrameBeforeNavigate([in] BSTR URL, long Flags, BSTR TargetFrameName, VARIANT * PostData, BSTR Headers, [in, out]boolean * Cancel);
  196.  
  197.         [id(DISPID_FRAMENAVIGATECOMPLETE), helpstring("Fired when a new hyperlink is being navigated to in a frame."), helpcontext(0x0000)]
  198.             void FrameNavigateComplete([in] BSTR URL );
  199.  
  200.         [id(DISPID_FRAMENEWWINDOW), helpstring("Fired when a new window should be created."), helpcontext(0x0000)]
  201.             void FrameNewWindow([in] BSTR URL, [in] long Flags, [in] BSTR TargetFrameName, [in] VARIANT * PostData, [in] BSTR Headers, [in,out] BOOLEAN * Processed);
  202.  
  203.         // The following are IWebBrowserApp specific:
  204.         //
  205.         [id(DISPID_QUIT), helpstring("Fired when application is quiting."), helpcontext(0x0000)]
  206.             void Quit([in, out] boolean * Cancel);
  207.  
  208.         [id(DISPID_WINDOWMOVE), helpstring("Fired when window has been moved."), helpcontext(0x0000)]
  209.             void WindowMove();
  210.  
  211.         [id(DISPID_WINDOWRESIZE), helpstring("Fired when window has been sized."), helpcontext(0x0000)]
  212.             void WindowResize();
  213.  
  214.         [id(DISPID_WINDOWACTIVATE), helpstring("Fired when window has been activated."), helpcontext(0x0000)]
  215.             void WindowActivate();
  216.  
  217.         [id(DISPID_PROPERTYCHANGE), helpstring("Fired when the PutProperty method has been called."), helpcontext(0x0000)]
  218.             void PropertyChange([in] BSTR szProperty);
  219.  
  220.  
  221.     };
  222.  
  223.     // Flags for DWebBrowserEvents::CommandStateChange
  224.     typedef
  225.     [
  226.         uuid(34A226E0-DF30-11CF-89A9-00A0C9054129),
  227.         helpstring("Constants for WebBrowser CommandStateChange")
  228.     ]
  229.     enum CommandStateChangeConstants {
  230.         [helpstring("Command Change")]      CSC_UPDATECOMMANDS  = 0xFFFFFFFF,
  231.         [helpstring("Navigate Forward")]    CSC_NAVIGATEFORWARD = 0x00000001,
  232.         [helpstring("Navigate Back")]       CSC_NAVIGATEBACK    = 0x00000002,
  233.     } CommandStateChangeConstants;
  234.  
  235.  
  236.     // CLSID_WebBrowser
  237.     [
  238.         uuid(EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B),
  239.         helpstring("WebBrowser Control")
  240.     ]
  241.     coclass WebBrowser {
  242.         [default]         interface     IWebBrowser;
  243.         [default, source] dispinterface DWebBrowserEvents;
  244.     };
  245.  
  246.  
  247.     //
  248.     // IWebBrowserApp
  249.     //
  250.  
  251.  
  252.     [
  253.         uuid(0002DF05-0000-0000-C000-000000000046),
  254.         helpstring("Web Browser Application Interface."),
  255.         helpcontext(0x0000),
  256.         hidden,
  257.         oleautomation,
  258.         dual
  259.     ]
  260.     interface IWebBrowserApp: IWebBrowser
  261.     {
  262.         //
  263.         // Methods
  264.         //
  265.  
  266.         [id(300), helpstring("Exits application and closes the open document."), helpcontext(0x0000)]
  267.             HRESULT Quit();
  268.  
  269.         [id(301), helpstring("Converts client sizes into window sizes."), helpcontext(0x0000)]
  270.             HRESULT ClientToWindow([in,out] int* pcx, [in,out] int* pcy);
  271.  
  272.         [id(302), helpstring("Associates vtValue with the name szProperty in the context of the object."), helpcontext(0x0000)]
  273.             HRESULT PutProperty([in] BSTR szProperty, [in] VARIANT vtValue);
  274.  
  275.         [id(303), helpstring("Retrieve the Associated value for the property vtValue in the context of the object."), helpcontext(0x0000)]
  276.             HRESULT GetProperty([in] BSTR szProperty, [out, retval] VARIANT *pvtValue);
  277.  
  278.         //
  279.         // Properties
  280.         //
  281.  
  282.         [id(0), propget, helpstring("Returns name of the application."), helpcontext(0x0000)]
  283.             HRESULT Name([out,retval] BSTR* pbstrName);
  284.  
  285.         [id(DISPID_HWND), propget, helpstring("Returns the HWND of the current IE window."), helpcontext(0x0000)]
  286.             HRESULT HWND([out,retval] long *pHWND);
  287.  
  288.         [id(400), propget, helpstring("Returns file specification of the application, including path."), helpcontext(0x0000)]
  289.             HRESULT FullName([out,retval] BSTR* pbstrFullName);
  290.  
  291.         [id(401), propget, helpstring("Returns the path to the application."), helpcontext(0x0000)]
  292.             HRESULT Path([out,retval] BSTR* pbstrPath);
  293.  
  294.         [id(402), propget, helpstring("Determines whether the application is visible or hidden."), helpcontext(0x0000)]
  295.             HRESULT Visible([out, retval] boolean* pBool);
  296.         [id(402), propput, helpstring("Determines whether the application is visible or hidden."), helpcontext(0x0000)]
  297.             HRESULT Visible([in] boolean Value);
  298.  
  299.         [id(403), propget, helpstring("Turn on or off the statusbar."), helpcontext(0x0000)]
  300.             HRESULT StatusBar([out, retval] boolean* pBool);
  301.         [id(403), propput, helpstring("Turn on or off the statusbar."), helpcontext(0x0000)]
  302.             HRESULT StatusBar([in] boolean Value);
  303.  
  304.         [id(404), propget, helpstring("Text of Status window."), helpcontext(0x0000)]
  305.             HRESULT StatusText([out, retval] BSTR *pbstr);
  306.         [id(404), propput, helpstring("Text of Status window."), helpcontext(0x0000)]
  307.             HRESULT StatusText([in] BSTR bstr);
  308.  
  309.         [id(405), propget, helpstring("Controls which toolbar is shown."), helpcontext(0x0000)]
  310.             HRESULT ToolBar([out, retval] int * pValue);
  311.         [id(405), propput, helpstring("Controls which toolbar is shown."), helpcontext(0x0000)]
  312.             HRESULT ToolBar([in] int Value);
  313.  
  314.         [id(406), propget, helpstring("Controls whether menubar is shown."), helpcontext(0x0000)]
  315.             HRESULT MenuBar([out, retval] boolean * Value);
  316.         [id(406), propput, helpstring("Controls whether menubar is shown."), helpcontext(0x0000)]
  317.             HRESULT MenuBar([in] boolean Value);
  318.  
  319.         [id(407), propget, helpstring("Maximizes window and turns off statusbar, toolbar, menubar, and titlebar."), helpcontext(0x0000)]
  320.             HRESULT FullScreen([out, retval] boolean * pbFullScreen);
  321.         [id(407), propput, helpstring("Maximizes window and turns off statusbar, toolbar, menubar, and titlebar."), helpcontext(0x0000)]
  322.             HRESULT FullScreen([in] boolean bFullScreen);
  323.  
  324.     };
  325.  
  326.  
  327.     // event interface for IWebBrowserApp is the same as DWebBrowserEvents
  328.     // the old uuid for DInternetExplorerEvents was
  329.     //  uuid(0002DF06-0000-0000-C000-0000000000000046),
  330.  
  331.  
  332.     // CLSID_InternetExplorer
  333.     [
  334.         uuid(0002DF01-0000-0000-C000-000000000046),
  335.         helpstring("Internet Explorer Application."),
  336.     ]
  337.     coclass InternetExplorer
  338.     {
  339.         [default]         interface     IWebBrowserApp;
  340.         [default, source] dispinterface DWebBrowserEvents;
  341.     }
  342.  
  343. };
  344.  
  345.  
  346.