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

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