home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / EDITRSET.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  4KB  |  147 lines

  1. //====START_GENERATED_PROLOG======================================
  2. //
  3. //
  4. //   COMPONENT_NAME: odutils
  5. //
  6. //   CLASSES:   EditorSet
  7. //        EditorSetIterator
  8. //
  9. //   ORIGINS: 82,27
  10. //
  11. //
  12. //   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13. //   All Rights Reserved
  14. //   Licensed Materials - Property of IBM
  15. //   US Government Users Restricted Rights - Use, duplication or
  16. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17. //       
  18. //   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19. //   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. //   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. //   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22. //   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23. //   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24. //   OR PERFORMANCE OF THIS SOFTWARE.
  25. //
  26. //====END_GENERATED_PROLOG========================================
  27. //
  28. // @(#) 1.4 com/src/utils/include/EditrSet.h, odutils, od96os2, odos29646d 7/15/96 18:00:13 [ 11/15/96 15:28:59 ]
  29. /*
  30.     File:        EditrSet.h
  31.  
  32.     Contains:    Class definition for EditerSet and ODEditerSetIterator
  33.  
  34.     Owned by:    Eric House 
  35.  
  36.     Copyright:    ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  37.  
  38.     
  39. */
  40.  
  41. #ifndef _EDITRSET_
  42. #define _EDITRSET_
  43.  
  44. #ifndef _PLFMDEF_
  45. #include "PlfmDef.h"
  46. #endif
  47.  
  48. #ifndef _ODOBJ_
  49. #include "ODObject.xh"
  50. #endif
  51.  
  52. #ifndef _ODTYPES_
  53. #include "ODTypes.h"
  54. #endif
  55.  
  56.  
  57. //=====================================================================================
  58. // Classes used by this interface
  59. //=====================================================================================
  60.  
  61. class EditorSetIterator ;
  62. class OrderedCollection;
  63. class OrderedCollectionIterator;
  64.  
  65. //=====================================================================================
  66. // Class EditorSet
  67. //=====================================================================================
  68.  
  69. class EditorSet
  70. {
  71.     
  72. public:
  73.  
  74.     EditorSet();
  75.     void InitEditorSet();
  76.     virtual ~EditorSet();
  77.  
  78.     ODMethod void AddEditor(ODEditor editor);
  79.     
  80.         // Adds an type to the end of the set, creating a copy of the argument in the set.
  81.  
  82.     ODMethod void AddEditorSet(EditorSet* editors);
  83.     
  84.         // Unions the two into this (leaving the argument unchanged).
  85.  
  86. #ifndef OD_BUG  // Method doesn't work, and no one in DR4 uses it.
  87.     ODMethod void RemoveEditor(ODEditor editor);
  88.     
  89.         // Removes an editor from a set.  Does nothing if the argument editor is not present.
  90.     
  91.     ODMethod void RemoveEditor( EditorSet* editors );
  92.     
  93.         // Removes all editors present in the argument set.
  94. #endif
  95.  
  96.     ODMethod void RemoveAllEditors();
  97.     
  98.         // Removes all editors from the set.
  99.  
  100.     ODMethod ODBoolean ContainsEditor(ODEditor editor);
  101.     
  102.         // Returns true if the set contains the specified editor.
  103.         // Otherwise, returns false.
  104.  
  105.     ODMethod ODULong GetEditorCount();
  106.         
  107.     ODMethod EditorSetIterator* CreateIterator();
  108.     
  109.         // Returns an iterator for the set, which can be used to retrieve editors
  110.         // from the set in order.
  111.  
  112. private:
  113.  
  114.     OrderedCollection*    fSet;
  115.  
  116.     Environment*    fEv;
  117.  
  118.     friend class EditorSetIterator;
  119. };
  120.     
  121. //=====================================================================================
  122. // Class EditorSetIterator
  123. //=====================================================================================
  124.  
  125. class EditorSetIterator
  126. {
  127.     
  128.  
  129.     public:
  130.         EditorSetIterator(EditorSet* set);
  131.         virtual ~EditorSetIterator();
  132.  
  133.         ODVMethod ODEditor    First();
  134.         ODVMethod ODEditor    Next();
  135.         ODVMethod ODBoolean    IsNotComplete();
  136.         
  137.             // These methods return a pointer to a string within the set.
  138.             // The client must not dispose this memory, and must be aware that
  139.             // These methods return nil if the requested item does not exist.
  140.         
  141.     private:
  142.         OrderedCollectionIterator*    fIterator;
  143. };
  144.  
  145.  
  146. #endif
  147.