home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / chap14 / cosmo / cosmo000.odl < prev    next >
Encoding:
Text File  |  1995-05-03  |  10.2 KB  |  346 lines

  1. /*
  2.  * COSMO000.ODL
  3.  * Neutral/English Language Cosmo Type Library Chapter 14
  4.  *
  5.  * "Neutral" language is considered to be English.  We register
  6.  * this under LCID of 0 so the lcid before "library" has to match.
  7.  *
  8.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Microsoft
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14.  
  15. //LIBID_Cosmo2TypeLibrary
  16. [
  17. uuid(00021165-0000-0000-C000-000000000046)
  18.     , helpstring("Cosmo (Chapter 14) Type Library")
  19.     , lcid(0x0000)
  20.     , version(1.0)
  21. ]
  22. library CosmoTypeLibrary
  23.     {
  24.    #ifdef WIN32
  25.     importlib("STDOLE32.TLB");
  26.    #else
  27.     importlib("STDOLE.TLB");
  28.    #endif
  29.  
  30.     /*
  31.      * IID_ICosmoFigure, the interface of a Cosmo Figure.
  32.      * Since each Cosmo document has one figure, then this
  33.      * is also considered the 'document' interface.
  34.      */
  35.     [
  36.     uuid(00021161-0000-0000-C000-000000000046)
  37.         , helpstring("Definition of interface ICosmoFigure")
  38.         , odl
  39.     ]
  40.     interface ICosmoFigure : IUnknown
  41.         {
  42.         //Standard Document Properties
  43.         [propget, helpstring("Cosmo's application object")]
  44.             IDispatch *    Application(void);
  45.  
  46.         [propget, helpstring("Cosmo's application object")]
  47.             IDispatch *    Parent(void);
  48.  
  49.         [propget, helpstring("The full pathname of the figure")]
  50.             BSTR       FullName(void);
  51.  
  52.         [id(0), propget, helpstring("The simple name of the figure")]
  53.             BSTR       Name(void);
  54.  
  55.         [propget, helpstring("The path of the figure without the name")]
  56.             BSTR       Path(void);
  57.  
  58.         [propget, helpstring("The saved state of the figure")]
  59.             boolean    Saved(void);
  60.  
  61.  
  62.         //Custom Properties
  63.         [propget, helpstring("The number of points in the figure")]
  64.             short NumberOfPoints(void);
  65.  
  66.         [propget, helpstring("The background color of the figure")]
  67.             long  BackColor(void);
  68.  
  69.         [propput]
  70.             void  BackColor([in] long BackColor);
  71.  
  72.         [propget, helpstring("The line color of the figure")]
  73.             long  LineColor(void);
  74.  
  75.         [propput]
  76.             void  LineColor([in] long LineColor);
  77.  
  78.         [propget, helpstring("The line style of the figure")]
  79.             short LineStyle(void);
  80.  
  81.         [propput]
  82.             void  LineStyle([in] short Style);
  83.  
  84.         [propget, helpstring("The horizontal position (pixels) of the figure window relative to the frame")]
  85.             long  Left(void);
  86.  
  87.         [propput]
  88.             void  Left([in] long Left);
  89.  
  90.         [propget, helpstring("The vertical position (pixels) of the figure window relative to the frame")]
  91.             long  Top(void);
  92.  
  93.         [propput]
  94.             void  Top([in] long Top);
  95.  
  96.         [propget, helpstring("The horizontal dimension (pixels) of the figure window")]
  97.             long  Width(void);
  98.  
  99.         [propput]
  100.             void  Width([in] long Width);
  101.  
  102.         [propget, helpstring("The vertical dimension (pixels) of the figure window")]
  103.             long  Height(void);
  104.  
  105.         [propput]
  106.             void  Height([in] long Height);
  107.  
  108.         [propget, helpstring("Controls the visibility of the figure window")]
  109.             boolean Visible(void);
  110.  
  111.         [propput]
  112.             void    Visible([in] boolean Visible);
  113.  
  114.  
  115.  
  116.         //Standard Methods
  117.         [helpstring("Activate this figure window")]
  118.             void  Activate(void);
  119.  
  120.         [helpstring("Close this figure window")]
  121.             void  Close([in, optional] VARIANT SaveChanges
  122.                 , [in, optional] VARIANT Path);
  123.  
  124.         [helpstring("Discard changes to this figure and reload it")]
  125.             void  RevertToSaved(void);
  126.  
  127.         [helpstring("Save this figure to the pathname in the FullName property")]
  128.             void  Save(void);
  129.  
  130.         /*
  131.          * The pathname could be optional for SaveAs, but I don't
  132.          * see how that would help.  So here it's required.
  133.          */
  134.         [helpstring("Save this figure to the specified pathname")]
  135.             void  SaveAs([in] BSTR Path);
  136.  
  137.         //Custom Methods
  138.         [helpstring("Replace the figure with the figure in the given pathname")]
  139.             void  Import([in] BSTR ImportPath);
  140.  
  141.         [helpstring("Copy the figure to the clipboard")]
  142.             void  Copy(void);
  143.  
  144.         [helpstring("Move the figure to the clipboard")]
  145.             void  Cut(void);
  146.  
  147.         [helpstring("Replace the figure with the one on the clipboard")]
  148.             void  Paste(void);
  149.  
  150.         //Custom Methods
  151.         [helpstring("Add a point, on a 32767*32767 grid, to the figure")]
  152.             boolean AddPoint([in] short x, [in] short y);
  153.  
  154.         [helpstring("Remove the last added point from the figure")]
  155.             void RemovePoint(void);
  156.         }
  157.  
  158.  
  159.  
  160.     //IID_ICosmoFigures, the interface of the Cosmo Figures collection
  161.     [
  162.     uuid(00021160-0000-0000-C000-000000000046)
  163.         , helpstring("Definition of interface ICosmoFigures")
  164.         , odl
  165.     ]
  166.     interface ICosmoFigures : IUnknown
  167.         {
  168.         //Standard Properties
  169.         [propget, helpstring("Cosmo's application object")]
  170.             IDispatch *Application(void);
  171.  
  172.         [propget, helpstring("Cosmo's application object")]
  173.             IDispatch *Parent(void);
  174.  
  175.         [propget, helpstring("The number of figures currently open")]
  176.             long       Count(void);
  177.  
  178.  
  179.         //Standard Methods
  180.         [id(0), helpstring("Return the figure for the given index")]
  181.             IDispatch *Item([in,optional] VARIANT index);
  182.  
  183.         [helpstring("Create a new figure")]
  184.             IDispatch *Add(void);
  185.  
  186.         [helpstring("Opens an existing figure")]
  187.             IDispatch *Open([in] BSTR Path);
  188.  
  189.         [helpstring("Close all figures")]
  190.             void       Close(void);
  191.  
  192.         [id(-4), helpstring("Enumerates the figures")]
  193.             IUnknown *_NewEnum(void);
  194.         }
  195.  
  196.  
  197.  
  198.     /*
  199.      * IID_ICosmoApplication, Cosmo's application interface
  200.      */
  201.     [
  202.     uuid(0002115F-0000-0000-C000-000000000046)
  203.         , helpstring("Definition of interface ICosmoApplication")
  204.         , odl
  205.     ]
  206.     interface ICosmoApplication : IUnknown
  207.         {
  208.         //Standard Properties
  209.         //DISPID_VALUE returns the same object as invoked
  210.         [id(0), propget, helpstring("The application object")]
  211.             IDispatch *Application(void);
  212.  
  213.         [propget, helpstring("The active figure")]
  214.             IDispatch *ActiveFigure(void);
  215.  
  216.         //You can make this read-write, but ours is read-only
  217.         [propget, helpstring("The application caption")]
  218.             BSTR       Caption(void);
  219.  
  220.         [propget, helpstring("The collection of open figures")]
  221.             IDispatch *Figures(void);
  222.  
  223.         [propget, helpstring("The full pathname of the application module")]
  224.             BSTR       FullName(void);
  225.  
  226.         [propget, helpstring("The module name of the application")]
  227.             BSTR       Name(void);
  228.  
  229.         [propget, helpstring("The application path without the module name")]
  230.             BSTR       Path(void);
  231.  
  232.  
  233.         [propget, helpstring("The horizontal position (pixels) of the frame window relative to the screen")]
  234.             long  Left(void);
  235.  
  236.         [propput]
  237.             void  Left([in] long Left);
  238.  
  239.         [propget, helpstring("The vertical position (pixels) of the frame window relative to the screen")]
  240.             long  Top(void);
  241.  
  242.         [propput]
  243.             void  Top([in] long Top);
  244.  
  245.         [propget, helpstring("The horizontal dimension (pixels) of the frame window")]
  246.             long  Width(void);
  247.  
  248.         [propput]
  249.             void  Width([in] long Width);
  250.  
  251.         [propget, helpstring("The vertical dimension (pixels) of the frame window")]
  252.             long  Height(void);
  253.  
  254.         [propput]
  255.             void  Height([in] long Height);
  256.  
  257.         [propget, helpstring("Controls the visibility of the application")]
  258.             boolean Visible(void);
  259.  
  260.         [propput]
  261.             void    Visible([in] boolean Visible);
  262.  
  263.         [propget, helpstring("The text in the status bar")]
  264.             BSTR    StatusBar(void);
  265.  
  266.         [propput]
  267.             void    StatusBar([in] BSTR Text);
  268.  
  269.         //Methods
  270.         [helpstring("Terminates the application")]
  271.             void Quit(void);
  272.         }
  273.  
  274.  
  275.     /*
  276.      * Now define dispinterfaces that have the same members
  277.      * as the interfaces we just defined.  Note that if we
  278.      * were using dual interfaces we'd add 'dual' to the
  279.      * interfaces above.
  280.      */
  281.  
  282.     //DIID_DICosmoFigure
  283.     [
  284.     uuid(00021164-0000-0000-C000-000000000046)
  285.         , helpstring("Definition of dispinterface DICosmoFigure")
  286.     ]
  287.     dispinterface DICosmoFigure
  288.         {
  289.         interface   ICosmoFigure;
  290.         }
  291.  
  292.  
  293.     //DIID_DICosmoFigures
  294.     [
  295.     uuid(00021163-0000-0000-C000-000000000046)
  296.         , helpstring("Definition of dispinterface DICosmoFigures")
  297.     ]
  298.     dispinterface DICosmoFigures
  299.         {
  300.         interface   ICosmoFigures;
  301.         }
  302.  
  303.  
  304.     //DIID_DICosmoApplication
  305.     [
  306.     uuid(00021162-0000-0000-C000-000000000046)
  307.         , helpstring("Definition of dispinterface DICosmoApplications")
  308.     ]
  309.     dispinterface DICosmoApplication
  310.         {
  311.         interface   ICosmoApplication;
  312.         }
  313.  
  314.  
  315.     /*
  316.      * Now we finally define the component classes that are
  317.      * involved with this automated version of Cosmo.  We'll have
  318.      * two:  CLSID_Cosmo2Figure and CLSID_Cosmo2Application.
  319.      * CLSID_Cosmo2Figure is also the CLSID stored in our
  320.      * compound files.
  321.      */
  322.  
  323.     //CLSID_Cosmo2Figure
  324.     [
  325.     uuid(00021107-0000-0000-C000-000000000046)
  326.         , helpstring("Cosmo Figure Object Type Information")
  327.     ]
  328.     coclass Cosmo2Figure
  329.         {
  330.         dispinterface   DICosmoFigure;
  331.         interface       ICosmoFigure;
  332.         }
  333.  
  334.     //CLSID_Cosmo2Application
  335.     [
  336.     uuid(00021166-0000-0000-C000-000000000046)
  337.         , helpstring("Cosmo Application Type Information")
  338.     ]
  339.     coclass Cosmo2Application
  340.         {
  341.         dispinterface   DICosmoApplication;
  342.         interface       ICosmoApplication;
  343.         }
  344.  
  345.     };
  346.