home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odtlktv4.zip / ODTLKT / TOOLKIT / IDL / ARBITRAT.IDL next >
Text File  |  1995-12-13  |  6KB  |  160 lines

  1. /********************************************************************/
  2. /*  Licensed Materials - Property of IBM                            */
  3. /*                                                                  */
  4. /*                                                                  */
  5. /* Copyright (C) International Business Machines Corp., 1994.       */
  6. /* Copyright (C) Apple Computer, Inc., 1994                         */
  7. /*                                                                  */
  8. /*  US Government Users Restricted Rights -                         */
  9. /*  Use, duplication, or disclosure restricted                      */
  10. /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  11. /*                                                                  */
  12. /*                                                                  */
  13. /********************************************************************/
  14.  
  15. #ifndef _ARBITRAT_
  16. #define _ARBITRAT_
  17.  
  18. #ifndef _ODOBJECT_
  19. #include "ODObject.idl"
  20. #endif
  21.  
  22. //==============================================================================
  23. // Theory of Operation
  24. //==============================================================================
  25.  
  26. /*
  27.   The arbitrator is used to manage competition for facilities which can only
  28.   be controlled by a single part at a time. These facilities are referred to
  29.   as "focus types". An example is the keystroke focus. Keyboard events are
  30.   sent to the part which has the keystroke focus. Another example is the menu
  31.   focus. One part owns the menu bar at any time. Many focus types are related
  32.   to event distribution, but focus types could also be associated with ports,
  33.   for example.
  34.  
  35.   Rather than having an all-encompassing notion of "active" part, parts simply
  36.   request ownership of a set of focus types. It is possible, in principle, to
  37.   have one part receive keystroke events while another receives sound input,
  38.   though the human interface guidelines may encourage parts to request and 
  39.   relinquish most focus types along with the menu focus.
  40.  
  41.   New focus types can be added. This might be done by a part handler which is
  42.   associated with some exotic input device.
  43.  
  44.   Parts request ownership of a set of focus types. This is necessary to 
  45.   avoid deadlock.
  46.  
  47. */
  48.  
  49. //==============================================================================
  50. // Constants
  51. //==============================================================================
  52.  
  53. //==============================================================================
  54. // Scalar Types
  55. //==============================================================================
  56.  
  57. //=====================================================================================
  58. // Class defined in this interface
  59. //=====================================================================================
  60.  
  61. interface  ODArbitrator;
  62.  
  63. //=====================================================================================
  64. // Classes used by this interface
  65. //=====================================================================================
  66.  
  67. interface  ODFocusModule;
  68. interface  ODFocusSet;
  69. interface  ODFocusOwnerIterator;
  70. interface  ODSession;
  71. interface  ODFrame;
  72.  
  73. //=====================================================================================
  74. // Implementation Types
  75. //=====================================================================================
  76.  
  77.  
  78. //=====================================================================================
  79. // Global Variables
  80. //=====================================================================================
  81.  
  82. //=====================================================================================
  83. // Class ODArbitrator
  84. //=====================================================================================
  85.  
  86. interface ODArbitrator :  ODObject
  87. {    
  88.    ODBoolean RequestFocusSet(in ODFocusSet focusSet,
  89.                    in ODFrame requestingFrame);
  90.  
  91.    ODBoolean RequestFocus(in ODTypeToken focus,
  92.                   in ODFrame requestingFrame);
  93.  
  94.    void RelinquishFocusSet(in ODFocusSet focusSet,
  95.                   in ODFrame relinquishingFrame);
  96.  
  97.    void RelinquishFocus(in ODTypeToken focus,
  98.                in ODFrame relinquishingFrame);
  99.  
  100.    void TransferFocus(in ODTypeToken focus,
  101.                in ODFrame transferringFrame,
  102.             in ODFrame newOwner);
  103.  
  104.    void TransferFocusSet(in ODFocusSet focusSet, 
  105.                in ODFrame transferringFrame,
  106.             in ODFrame newOwner);
  107.  
  108.    ODFrame AcquireFocusOwner(in ODTypeToken focus);
  109.  
  110.    ODFocusOwnerIterator CreateOwnerIterator(in ODTypeToken focus);
  111.  
  112.    void RegisterFocus(in ODTypeToken focus,
  113.                in ODFocusModule focusModule);
  114.  
  115.    void UnregisterFocus(in ODTypeToken focus);
  116.  
  117.    ODBoolean IsFocusRegistered(in ODTypeToken focus);
  118.  
  119.    ODBoolean IsFocusExclusive(in ODTypeToken focus);
  120.  
  121.    ODFocusModule GetFocusModule(in ODTypeToken focus);
  122.  
  123.    ODFocusSet CreateFocusSet();
  124.  
  125.  
  126. #ifdef __SOMIDL__
  127.   implementation
  128.   {
  129.     functionprefix = ODArbitrator;
  130.  
  131.     override:
  132.     somInit,
  133.     somUninit,
  134.         Purge;
  135.     releaseorder:
  136.         RequestFocusSet,
  137.         RequestFocus,
  138.         RelinquishFocusSet,
  139.         RelinquishFocus,
  140.         TransferFocus,
  141.         TransferFocusSet,
  142.         AcquireFocusOwner,
  143.         CreateOwnerIterator,
  144.         RegisterFocus,
  145.         UnregisterFocus,
  146.         IsFocusRegistered,
  147.         IsFocusExclusive,
  148.         GetFocusModule,
  149.     CreateFocusSet,
  150.     reserved1;
  151.  
  152.     majorversion = 1; minorversion = 0;
  153.  
  154.  
  155.   };
  156. #endif
  157. };
  158.  
  159. #endif // _ARBITRAT_
  160.