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

  1. #ifndef _ICOMBOVW_
  2.   #define _ICOMBOVW_
  3. /*******************************************************************************
  4. * FILE NAME: icombovw.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     ICollectionViewComboBox                                                  *
  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.  
  19. #include <icombobs.hpp>
  20. #include <istrgen.hpp>
  21. #include <icolobsv.hpp>
  22. #include <irect.hpp>
  23. #include <inotify.hpp>
  24.  
  25. class IString;
  26. class IWindowHandle;
  27. template <class Element, class Collection> class ICollectionViewComboBoxData;
  28.  
  29. #pragma implementation("icombovw.c")
  30. #pragma define(ISequence <unsigned long > )
  31. #pragma pack(4)
  32.  
  33.  
  34. template <class Element, class Collection>
  35.   class ICollectionViewComboBox : public IBaseComboBox
  36. {
  37. typedef IBaseComboBox
  38.   Inherited;
  39. #pragma define(ICollectionObserver< Element, ICollectionViewComboBox<Element,Collection>, Collection > )
  40.  
  41. public:
  42.  
  43. /*------------------------- Constructors -------------------------------------*/
  44.   ICollectionViewComboBox ( unsigned long                    identifier,
  45.                             IWindow*                         parent,
  46.                             IWindow*                         owner,
  47.                             const IRectangle&                initial =
  48.                                IRectangle  ( ),
  49.                             const IBaseComboBox::Style&      style   =
  50.                                IBaseComboBox::defaultStyle( ),
  51.                             const IStringGenerator<Element>& stringGenerator =
  52.                                IStringGenerator<Element>( ) );
  53.  
  54.   ICollectionViewComboBox ( unsigned long                    identifier,
  55.                             IWindow*                         parent,
  56.                             const IStringGenerator<Element>& stringGenerator =
  57.                                IStringGenerator<Element>( ) );
  58.  
  59.   ICollectionViewComboBox ( const IWindowHandle&             handle,
  60.                             const IStringGenerator<Element>& stringGenerator =
  61.                                IStringGenerator<Element>( ) );
  62.  
  63. virtual
  64.  ~ICollectionViewComboBox ( );
  65.  
  66.  
  67. /*------------------------- Collection ---------------------------------------*/
  68. virtual Collection
  69.  *items                   ( ) const;
  70.  
  71. virtual ICollectionViewComboBox<Element,Collection>
  72.  &setItems                ( Collection* collection );
  73.  
  74. /*------------------------- String Generator ---------------------------------*/
  75. virtual IStringGenerator<Element>
  76.  &setStringGenerator      ( const IStringGenerator<Element>& stringGenerator );
  77.  
  78. virtual IStringGenerator<Element>
  79.  &stringGenerator         ( );
  80.  
  81. /*------------------------- Collection-Reporting Protocol --------------------*/
  82. virtual ICollectionViewComboBox<Element,Collection>
  83.  &elementChanged             ( unsigned long   position,
  84.                                const Element&  element  ),
  85.  &elementAdded               ( unsigned long   position,
  86.                                const Element&  element  ),
  87.  &elementDeleted             ( unsigned long   position ),
  88.  &elementsChanged            ( ),
  89.  &collectionReplaced         ( );
  90.  
  91. /*------------------------- Selection ----------------------------------------*/
  92. static const unsigned long
  93.   noSelection;
  94.  
  95. virtual ICollectionViewComboBox<Element, Collection>
  96.  &select                     ( unsigned long   collectionPosition,
  97.                                Boolean         select = true ),
  98.  &deselect                   ( unsigned long   collectionPosition );
  99.  
  100. virtual Element
  101.   selectedElement            ( ) const;
  102.  
  103. virtual unsigned long
  104.   selectedCollectionPosition ( );
  105.  
  106. /*------------------------- Notification Members -----------------------------*/
  107. static INotificationId const
  108.   itemChangedId,
  109.   itemsId;
  110.  
  111. private:
  112. /*------------------------- Hidden Members -----------------------------------*/
  113.   ICollectionViewComboBox
  114.              ( const ICollectionViewComboBox< Element, Collection > & source );
  115. ICollectionViewComboBox<Element,Collection>
  116.  &operator=  ( const ICollectionViewComboBox< Element, Collection > & source );
  117.  
  118. /*------------------------- Private ------------------------------------------*/
  119. ICollectionViewComboBoxData<Element, Collection>
  120.  *fCollectionViewComboBoxData;
  121.  
  122. unsigned long
  123.   insert     ( unsigned long    index,
  124.                const char*      text  ),
  125.   deleteItem ( unsigned long    index );
  126.  
  127. ICollectionViewComboBox<Element, Collection>
  128.  &deleteAll  ( );
  129.  
  130. }; // ICollectionViewComboBox<Element,Collection>
  131.  
  132. #if ! defined (__TEMPINC__)
  133. #include <icombovw.c>
  134. #endif
  135.  
  136.  
  137. #pragma pack()
  138.  
  139. #endif // _ICOMBOVW_
  140.