home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iacceltb.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.7 KB  |  126 lines

  1. #ifndef _IACCELTB_
  2.   #define _IACCELTB_
  3. /*******************************************************************************
  4. * FILE NAME: iacceltb.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IAcceleratorTable                                                        *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <ibase.hpp>
  19. #include <ivbase.hpp>
  20.  
  21.  
  22. class IAcceleratorKey;
  23. class IAcceleratorTableCursorData;
  24. class IAcceleratorTableData;
  25. class IAccelTblHandle;
  26. class IResourceId;
  27. class IWindow;
  28. class IWindowHandle;
  29.  
  30. #pragma pack(4)
  31.  
  32. class IAcceleratorTable : public IBase {
  33. typedef IBase
  34.   Inherited;
  35. public:
  36.  
  37. /*------------------------------- Constructors -------------------------------*/
  38.   IAcceleratorTable ( const IWindow*           window = 0 );
  39.   IAcceleratorTable ( const IAccelTblHandle&   accelTblHandle );
  40.   IAcceleratorTable ( const IResourceId&       resId );
  41.  
  42.   IAcceleratorTable ( const IAcceleratorTable& accelTbl );
  43. IAcceleratorTable
  44.  &operator=         ( const IAcceleratorTable& accelTbl );
  45.  ~IAcceleratorTable ( );
  46.  
  47. /*----------------------------- Handle Management ----------------------------*/
  48. IAccelTblHandle
  49.   handle        ( ) const;
  50. static void
  51.   destroyHandle ( IAccelTblHandle& accelTblHandle );
  52.  
  53. /*------------------------------- Nested Types -------------------------------*/
  54. class Cursor : public IVBase {
  55.   typedef IVBase
  56.     Inherited;
  57.   public:
  58.   /*------------------------------ Constructors ------------------------------*/
  59.     Cursor ( IAcceleratorTable& accelTbl );
  60.   virtual
  61.    ~Cursor ( );
  62.  
  63.   /*---------------------------- Cursor Functions ----------------------------*/
  64.   virtual Boolean
  65.     setToFirst ( ),
  66.     setToNext  ( ),
  67.     isValid    ( ) const;
  68.   virtual void
  69.     invalidate ( );
  70.   IAcceleratorKey
  71.     element    ( ) const;
  72.  
  73.   private:
  74.   /*---------------------------- Hidden Functions ----------------------------*/
  75.     Cursor    ( const Cursor& cursor );
  76.   Cursor
  77.    &operator= ( const Cursor& cursor );
  78.  
  79.   /*-------------------------------- Private ---------------------------------*/
  80.   friend class IAcceleratorTable;
  81.   IAcceleratorTableCursorData
  82.    *fData;
  83.   };  // IAcceleratorTable::Cursor
  84.  
  85. /*------------------------------ Querying Keys -------------------------------*/
  86. static IAcceleratorKey
  87.   keyAt           ( const Cursor&          cursor );
  88. Boolean
  89.   containsKeyLike ( const IAcceleratorKey& key ) const,
  90.   locateKeyLike   ( const IAcceleratorKey& key,
  91.                     Cursor&                cursor ) const;
  92. unsigned long
  93.   keyCount        ( ) const;
  94.  
  95. /*------------------------------ Changing Keys -------------------------------*/
  96. IAcceleratorTable
  97.  &removeKeyAt     ( Cursor&                cursor,
  98.                     Boolean                updateWindow = true ),
  99.  &removeAllKeys   ( Boolean                updateWindow = true ),
  100.  &replaceKeyAt    ( const Cursor&          cursor,
  101.                     const IAcceleratorKey& newKey,
  102.                     Boolean                updateWindow = true );
  103. Boolean
  104.   addKey          ( const IAcceleratorKey& newKey,
  105.                     Boolean                updateWindow = true ),
  106.   addOrReplaceKey ( const IAcceleratorKey& newKey,
  107.                     Boolean                updateWindow = true ),
  108.   removeKeyLike   ( const IAcceleratorKey& key,
  109.                     Boolean                updateWindow = true );
  110.  
  111. private:
  112. /*--------------------------------- Private ----------------------------------*/
  113. IAcceleratorTable
  114.  &initialize   ( const IAccelTblHandle& accelTblHandle );
  115. Boolean
  116.   updateWindow ( );
  117. friend class IAcceleratorList;
  118. friend class IAcceleratorTable::Cursor;
  119. IAcceleratorTableData
  120.  *fData;
  121. };  // IAcceleratorTable
  122.  
  123. #pragma pack()
  124.  
  125. #endif /* _IACCELTB_ */
  126.