home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / ICNRCTL.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  91KB  |  1,644 lines

  1. #ifndef _ICNRCTL_
  2. #define _ICNRCTL_
  3. /*******************************************************************************
  4. * FILE NAME: icnrctl.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IContainerControl - Base container control class                         *
  9. *     IContainerControl::ObjectCursor - Cursor objects in a container          *
  10. *     IContainerControl::TextCursor - Cursor objects text in a container       *
  11. *     IContainerControl::ColumnCursor - Cursor columns in a container          *
  12. *     IContainerControl::FilterFn - Filter objects in a container              *
  13. *     IContainerControl::CompareFn - Sort objects in a container               *
  14. *     IContainerControl::Iterator - Iterate objects in a container             *
  15. *                                                                              *
  16. * COPYRIGHT:                                                                   *
  17. *   (C) Copyright IBM Corporation 1992                                         *
  18. *   All Rights Reserved                                                        *
  19. *   Licensed Materials * Property of IBM                                       *
  20. *                                                                              *
  21. * HISTORY:                                                                     *
  22. *******************************************************************************/
  23.  
  24. #ifndef _ICONTROL_
  25.   #include <icontrol.hpp>
  26. #endif
  27.  
  28. #ifndef _ICNROBJ_
  29.   #include <icnrobj.hpp>
  30. #endif
  31.  
  32. #ifndef _IRECT_
  33.   #include <irect.hpp>
  34. #endif
  35.  
  36. /*----------------------------------------------------------------------------*/
  37. /* Align classes on four byte boundary.                                       */
  38. /*----------------------------------------------------------------------------*/
  39. #pragma pack(4)
  40.  
  41. /*----------------------------------------------------------------------------*/
  42. /* Turn off warning for compiler generated copy/assignment                    */
  43. /*----------------------------------------------------------------------------*/
  44. #pragma info(nocpy)
  45.  
  46.  
  47. //  Forward Declarations
  48. class IContainerControl;
  49. class IContainerColumn;
  50. class IContainerObject;
  51. class IResourceId;
  52. class IPrivateResource;
  53. class IMultiLineEdit;
  54. struct ICnrInfo;
  55. class IColor;
  56. class ICnrControlList;
  57. class ICnrObjectSet;
  58.  
  59.  
  60. class IContainerControl : public IControl
  61. {
  62. typedef IControl
  63.   Inherited;
  64. /*******************************************************************************
  65. * The IContainerControl class is used to display a container of objects in any *
  66. * of the supported views (icon, name, tree, details, and text).                *
  67. *                                                                              *
  68. * Like other controls in the library, this control can be constructed in one   *
  69. * of the following ways:                                                       *
  70. *      - On a window                                                           *
  71. *      - Loaded in a dialog template                                           *
  72. *      - As a pre-existing control.                                            *                         *
  73. *                                                                              *
  74. * EXAMPLE:                                                                     *
  75. * // Frame Window Constructor                                                  *
  76. * CustomerList :: CustomerList(const IRectangle& rect,                         *
  77. *                                Boolean fLoadObjectsIn)                       *
  78. *   : IFrameWindow(CNR_MAINWINDOW)                                             *
  79. *    //  Create a Container Control                                            *
  80. * pCustContainer = new IContainerControl(CNR_RESID, this, this);               *
  81. *   // Make the container the client                                           *
  82. * setClient(pCustContainer);                                                   *
  83. *   // Now construct columns and objects                                       *
  84. *******************************************************************************/
  85.  
  86. public:
  87. /*-------------------------- Related Types -------------------------------------
  88. | The following enumerations are defined:                                      |
  89. |   EnumerationOrder    - Order in which icons are enumerated:                 |
  90. |                                                                              |
  91. |                         itemOrder - Container records are enumerated in item |
  92. |                                     order, lowest to highest.  Item order is |
  93. |                                     similar to the order in which the        |
  94. |                                     records were added to the container,     |
  95. |                                     except records can be explicitly         |
  96. |                                     inserted into the item order.            |
  97. |                         zOrder    - Container records are enumerated by      |
  98. |                                     z-order, first to last.  zOrder is the   |
  99. |                                     order in which the icons are painted on  |
  100. |                                     the display in the icon view.            |
  101. |                                                                              |
  102. |   TitleAlignment      - Title alignment types:                               |
  103. |                                                                              |
  104. |                         left     - Container titles are left-aligned.        |
  105. |                         right    - Container titles are right-aligned.       |
  106. |                         centered - Container titles are centered.            |
  107. ------------------------------------------------------------------------------*/
  108. enum EnumerationOrder { itemOrder, zOrder};
  109. enum TitleAlignment { left, right, centered};
  110.  
  111. /*-------------------------------- Style ----------------------------------
  112.   The following functions provide a means to set and query container styles:
  113.  
  114.     Style - Nested class that provides static members that define the set of
  115.             valid container styles.  These styles can be used in conjunction
  116.             with the styles defined by the nested classes IWindow::Style and
  117.             IControl::Style.  For example, you could define an instance of
  118.             the IContainerControl::Style class and initialize it like:
  119.               IContainerControl::Style
  120.                 style = IContainerControl::readOnly | IWindow::visible;
  121.             An object of this type is provided when the container is created.
  122.             A customizable default is used if no styles are specified.  Once
  123.             the object is constructed, IContainerControl, IWindow, and
  124.             IControl member functions can be used to set or query the
  125.             object's style.
  126.  
  127.             The declaration of the IContainerControl::Style nested class is
  128.             generated by the INESTEDBITFLAGCLASSDEF2 macro.
  129.  
  130.   The valid container styles are:
  131.     classDefaultStyle - Original default style for this class, which is
  132.                         singleSelection | IWindow::visible.
  133.     readOnly          - Specifies that the text in the container is not
  134.                         editable.
  135.     autoPosition      - Objects added to the container are positioned in the
  136.                         icon view automatically.
  137.     extendedSelection - Specifies that the container use extended selection.
  138.                         This style overrides multipleSelection, but is
  139.                         overridden by singleSelection, if combined with
  140.                         either or both.
  141.     singleSelection   - Specifies that the container use single selection.
  142.                         This style is the default.  It overrides both
  143.                         extendedSelection and multipleSelection if combined
  144.                         with either or both.
  145.     multipleSelection - Specifies that the container use multiple selection.
  146.                         This style is overridden by both singleSelection and
  147.                         extendedSelection if combined with either or both.
  148.     verifyPointers    - Validates that container objects exist.
  149.  
  150.   The following functions provide a means of getting and setting the default
  151.   style for this class:
  152.     defaultStyle    - Returns the current default style.  This is the same as
  153.                       classDefaultStyle unless setDefaultStyle has been
  154.                       called.
  155.     setDefaultStyle - Sets the default style for all subsequent containers.
  156. -------------------------------------------------------------------------*/
  157. INESTEDBITFLAGCLASSDEF2( Style, IContainerControl, IWindow, IControl);
  158.  
  159. static const Style
  160.   classDefaultStyle,
  161.   readOnly,
  162.   autoPosition,
  163.   extendedSelection,
  164.   singleSelection,    /* default */
  165.   multipleSelection,
  166.   verifyPointers;
  167.  
  168. static Style
  169.   defaultStyle    ( );
  170. static void
  171.   setDefaultStyle ( Style style);
  172.  
  173. /*-------------------------------- Attribute ------------------------------
  174.   The following functions provide a means to set and query container
  175.   attributes:
  176.  
  177.     Attribute - This nested class provides static members that define the
  178.                 set of valid container attributes.  For example, you could
  179.                 define an instance of the IContainerControl::Attribute class
  180.                 and initialize it like:
  181.                      IContainerControl::Attribute
  182.                        attribute = IContainerControl::detailsView |
  183.                                    IContainerControl::alignTitleCentered |
  184.                                    IContainerControl::handleDrawItem;
  185.                 An object of this type is provided when the container is
  186.                 created.  A customizable default is used if no attributes
  187.                 are specified.  Once the object is constructed,
  188.                 IContainerControl member functions can be used to set or
  189.                 query the object's attributes.
  190.  
  191.                 The declaration of the IContainerControl::Attribute nested
  192.                 class is generated by the INESTEDBITFLAGCLASSDEF0 macro.
  193.  
  194.   The valid container attributes are:
  195.     classDefaultAttribute - Original default attribute for this class, which
  196.                             is orderedTargetEmphasis | detailsViewTitles |
  197.                             visibleTreeLine | readOnlyTitle | iconView.
  198.     textView              - Shows the text view of the container.
  199.     iconView              - Shows the icon view of the container.
  200.     nameView              - Shows the name view of the container.
  201.     detailsView           - Shows the details view of the container.
  202.     treeView              - Shows the tree view of the container.
  203.     flowedView            - Shows the flowed view of the container.
  204.     readOnlyTitle         - Disables editing of the container title.
  205.     titleSeparator        - Adds a separator line after the title.
  206.     detailsViewTitles     - Shows the details view titles.
  207.     visibleTitle          - Shows the container title.
  208.     alignTitleCentered    - Centers the container title.
  209.     alignTitleLeft        - Left-justifies the container title.
  210.     alignTitleRight       - Right-justifies the container title.
  211.     handleDrawItem        - Causes draw item messages to be dispatched.
  212.     handleDrawBackground  - Causes draw background messages to be dispatched.
  213.     orderedTargetEmphasis - Sets ordered target emphasis.
  214.     mixedTargetEmphasis   - Sets mixed target emphasis.
  215.     visibleTreeLine       - Shows the tree line in the tree view.
  216.  
  217.   The following functions provide means of getting and setting the default
  218.   attribute for this class:
  219.     defaultAttribute    - Returns the current default attribute.  This is the
  220.                           same as classDefaultAttribute unless
  221.                           setDefaultAttribute has been called.
  222.     setDefaultAttribute - Sets the default attribute for all subsequent
  223.                           containers.
  224. -------------------------------------------------------------------------*/
  225. INESTEDBITFLAGCLASSDEF0( Attribute, IContainerControl);
  226.  
  227. static const Attribute
  228.   textView,
  229.   iconView,           /* default */
  230.   nameView,
  231.   detailsView,
  232.   treeView,
  233.   flowedView,
  234.   readOnlyTitle,      /* default */
  235.   titleSeparator,
  236.   detailsViewTitles,  /* default */
  237.   visibleTitle,
  238.   alignTitleCentered,
  239.   alignTitleLeft,
  240.   alignTitleRight,
  241.   handleDrawItem,
  242.   handleDrawBackground,
  243.   orderedTargetEmphasis,
  244.   mixedTargetEmphasis,
  245.   visibleTreeLine,          /* default */
  246.   classDefaultAttribute;
  247.  
  248. static Attribute
  249.   defaultAttribute    ( );
  250. static void
  251.   setDefaultAttribute ( Attribute attribute);
  252.  
  253. /*------------------------ Constructors ----------------------------------------
  254. | You can construct an instance of this class in the following ways:           |
  255. |    - On a window by specifying the parent and owner.                         |
  256. |    - From a container control on a loaded dialog template.                   |
  257. |    - From an existing container control's window handle.                     |
  258. ------------------------------------------------------------------------------*/
  259.   /* Construct a control from scratch */
  260.   IContainerControl ( unsigned long     id,
  261.                       IWindow*          parent,
  262.                       IWindow*          owner,
  263.                       const IRectangle& location  = IRectangle(),
  264.                       const Style&      style     = defaultStyle(),
  265.                       const Attribute&  attribute = defaultAttribute());
  266.  
  267.   /* Construct from a control on a Dialog */
  268.   IContainerControl ( unsigned long id,
  269.                       IWindow*      parentDialog);
  270.  
  271.   /* Construct from an existing control */
  272.   IContainerControl ( const IWindowHandle& handle);
  273.  
  274.  
  275. virtual
  276.  ~IContainerControl ( );
  277.  
  278. /*------------------------ Comparison ------------------------------------------
  279. | The following function is used to compare two IContainerControls:            |
  280. |   operator ==  - Returns true if two containers are the same.                |
  281. ------------------------------------------------------------------------------*/
  282. Boolean
  283.   operator==( const IContainerControl& that);
  284.  
  285.  
  286. /*------------------------ Initialization --------------------------------------
  287. | initialize  - Sets up the container environment. Called automatically if the |
  288. |               first container component created is an IContainerControl, but |
  289. |               must be called explicitly if IContainerObjects are created     |
  290. |               before the container is constructed.                           |
  291. ------------------------------------------------------------------------------*/
  292. static void
  293.      initialize ( );
  294.  
  295. class FilterFn : public IVBase
  296. {
  297. /***************************************************************************
  298. *  The IContainerControl::FilterFn class is used by the container to show  *
  299. *  a subset of the existing objects by filtering out some of the objects.  *
  300. *  When filtering is requested in the container, a FilterFn object is      *
  301. *  passed on input.  The FilterFn::isMemberOf function will be called for  *
  302. *  each object in the container.                                           *
  303. *                                                                          *
  304. * EXAMPLE:                                                                 *
  305. *                                                                          *
  306. *  class BlueFilter : public IContainerControl::FilterFn                   *
  307. *  {                                                                       *
  308. *  virtual Boolean                                                         *
  309. *    isMemberOf( IContainerObject* object,                                 *
  310. *                IContainerControl* container) const                       *
  311. *    {                                                                     *
  312. *      if (((ColorObject*)object)->isBlue())                               *
  313. *         return true;                                                     *
  314. *      return false;                                                       *
  315. *    }                                                                     *
  316. *  };                                                                      *
  317. *                                                                          *
  318. *  BlueFilter blueFilter;                                                  *
  319. *  container().filter(blueFilter);                                         *
  320. *
  321. ***************************************************************************/
  322. typedef IVBase
  323.   Inherited;
  324. public:
  325. /*------------------------ Constructors -------------------------------------
  326. | The only way to construct an instance of this class is to use the default |
  327. | constructor with no arguments.                                            |
  328. ---------------------------------------------------------------------------*/
  329.   FilterFn ( );
  330.  ~FilterFn ( );
  331.  
  332. /*------------------------ Object Filtering ---------------------------------
  333. | The following function is used to filter objects from the container:      |
  334. |  isMemberOf - Returns true if the object is to remain in the container    |
  335. |               and false if it is to be removed.                           |
  336. ---------------------------------------------------------------------------*/
  337. virtual Boolean
  338.   isMemberOf  ( IContainerObject* object,
  339.                 IContainerControl* container) const = 0;
  340.  
  341. };  /* end FilterFn */
  342.  
  343. class CompareFn : public IVBase
  344. {
  345. /***************************************************************************
  346. *  The IContainerControl::CompareFn class is used by the container to sort *
  347. *  the objects in the container.  When sorting is requested in the         *
  348. *  container, a CompareFn object is passed on input.  The                  *
  349. *  CompareFn::isEqual function will be called as needed by the container   *
  350. *  to sort the objects.                                                    *
  351. *                                                                          *
  352. *  EXAMPLE:                                                                *
  353. *                                                                          *
  354. *   class AgeSort    : public IContainerControl::CompareFn                 *
  355. *   {                                                                      *
  356. *   virtual int                                                            *
  357. *     isEqual( IContainerObject* object1,                                  *
  358. *              IContainerObject* object2,                                  *
  359. *              IContainerControl* container) const                         *
  360. *    {                                                                     *
  361. *      if (((Customer*)object1)->age() < ((Customer*)object2)->age())      *
  362. *         return -1;                                                       *
  363. *      else if (((Customer*)object1)->age() > ((Customer*)object2)->age()) *
  364. *         return 1;                                                        *
  365. *      else;                                                               *
  366. *         return 0;                                                        *
  367. *    }                                                                     *
  368. *   };                                                                     *
  369. *                                                                          *
  370. *   AgeSort ageSort;                                                       *
  371. *   container().sort(ageSort);                                             *
  372. *                                                                          *
  373. ***************************************************************************/
  374. typedef IVBase Inherited;
  375. public:
  376. /*------------------------ Constructors -------------------------------------
  377. | The only way to construct an instance of this class is to use the default |
  378. | constructor with no arguments.                                            |
  379. ---------------------------------------------------------------------------*/
  380.   CompareFn  ( );
  381.  ~CompareFn  ( );
  382.  
  383. /*------------------------ Object Sorting -----------------------------------
  384. | The following function is used to compare objects in the container:       |
  385. |  isEqual - If the isEqual function returns a value:                       |
  386. |      Less than 0     - The first object is less than the second object.   |
  387. |      0               - The first object is equal to the second object.    |
  388. |      Greater than 0  - The first object is greater than the second object.|
  389. ---------------------------------------------------------------------------*/
  390. virtual int
  391.   isEqual     ( IContainerObject* object1,
  392.                 IContainerObject* object2,
  393.                 IContainerControl* container) const = 0;
  394.  
  395. };  /* end CompareFn */
  396.  
  397. class ObjectCursor : public IVBase
  398. {
  399. typedef IVBase
  400.   Inherited;
  401. /***************************************************************************
  402. *  The IContainerControl::ObjectCursor class is used to iterate the        *
  403. *  container by finding objects based on the selection criteria            *
  404. *  established during construction of the cursor.  The cursor is only      *
  405. *  valid until objects are added to or removed from the container.         *
  406. *                                                                          *
  407. * EXAMPLE:                                                                 *
  408. *  // smack all the objects in a container                                 *
  409. *  IContainerControl::ObjectCursor cursor(*pCustContainer)                 *
  410. *  for (cursor.setToFirst();                                               *
  411. *       cursor.isValid();                                                  *
  412. *       cursor.setToNext() )                                               *
  413. *  {                                                                       *
  414. *     object.objectAt(cursor).smack();                                     *
  415. *  }                                                                       *
  416. *                                                                          *
  417. ***************************************************************************/
  418. public:
  419. /*------------------------ Constructors -------------------------------------
  420. | You can construct an instance of this class in the following ways:        |
  421. |   - A cursor to iterate all records in the container or records meeting   |
  422. |     the emphasis selection criteria. Records can be found in item order   |
  423. |     (the default) or z-order.                                             |
  424. |   - A cursor to find all objects that have the passed object as a parent. |
  425. ---------------------------------------------------------------------------*/
  426.   ObjectCursor ( const IContainerControl&   container,
  427.                  IContainerObject::Emphasis emphasis    = IContainerObject::none,
  428.                  EnumerationOrder           enumeration = itemOrder);
  429.  
  430. /* Construct an iterator for Child (or All Descendents) Iteration */
  431.   ObjectCursor ( const IContainerControl& container,
  432.                  const IContainerObject*  parentObject,
  433.                  const Boolean            allDescendents = false);
  434.  ~ObjectCursor ( );
  435.  
  436. /*------------------------ Cursor Movement ----------------------------------
  437. | The following functions are used to position the ObjectCursor based on    |
  438. |   the type of objects indicated in the construction of the cursor:        |
  439. |  setToFirst    - Points to the first object in the container.             |
  440. |  setToNext     - Points to the next or first object in the container.     |
  441. |  setToLast     - Points to the last object in the container.              |
  442. |  setToPrevious - Points to the previous or last object in the container.  |
  443. ---------------------------------------------------------------------------*/
  444. virtual  Boolean
  445.   setToFirst    ( ),
  446.   setToNext     ( ),
  447.   setToLast     ( ),
  448.   setToPrevious ( );
  449.  
  450. /*------------------------ Object Retrieval ---------------------------------
  451. | The following functions are used to retrieve objects:                     |
  452. |  first      - Points to and returns the first object in the container.    |
  453. |  next       - Points to and returns the next or first object in the       |
  454. |               container.                                                  |
  455. |  last       - Points to and returns the last object in the container.     |
  456. |  previous   - Points to and returns the previous or last object in the    |
  457. |               container.                                                  |
  458. |  current    - Returns the current object of this cursor.                  |
  459. |  setCurrent - Sets the cursor to point to a particular object.            |
  460. ---------------------------------------------------------------------------*/
  461. virtual IContainerObject
  462.  *first       ( ),
  463.  *next        ( ),
  464.  *previous    ( ),
  465.  *last        ( ),
  466.  *current     ( ) const;
  467. ObjectCursor
  468.  &setCurrent  ( const IContainerObject* currentObject);
  469.  
  470. /*------------------------ Cursor Validation --------------------------------
  471. | The following functions are used in cursor validation:                    |
  472. |  isValid    - Queries whether the cursor is pointing to a valid object.   |
  473. |  invalidate - Flags the cursor as invalid.                                |
  474. ---------------------------------------------------------------------------*/
  475. virtual  Boolean
  476.   isValid       ( ) const;
  477. virtual ObjectCursor
  478.  &invalidate    ( );
  479.  
  480. private:
  481.  
  482.  
  483. IContainerObject
  484.  *object          ( const IContainerObject* objectAfter,
  485.                     unsigned long           command),
  486.  *selectedObject  ( const IContainerObject* objectAfter,
  487.                     unsigned long           emphasis),
  488.  *lastObject      ( const IContainerObject* objectAfter = 0),
  489.  *previousObject  ( const IContainerObject* objectBefore),
  490.  *nextObject      ( const IContainerObject* objectAfter),
  491.  *nextBranchObject( const IContainerObject* objectAfter);
  492.  
  493. enum State { all=1, child=2, emphasis=4, allSubTree=8 };
  494.  
  495.  
  496. IContainerObject
  497.  *pcnrobjClCurrent,
  498.  *pcnrobjClParent;
  499. unsigned long
  500.   ulClChanges;
  501. IContainerControl
  502.  *pcnrctlClOwner;
  503. unsigned long
  504.   flClEmphasis;
  505. unsigned long
  506.   flClEnumeration;
  507. unsigned long
  508.   flClState;
  509. };  /* end ObjectCursor */
  510.  
  511. class TextCursor : public IVBase
  512. {
  513. typedef IVBase
  514.   Inherited;
  515. /***************************************************************************
  516. *  The IContainerControl::TextCursor class is used to iterate the          *
  517. *  container and find objects that contain the text string indicated       *
  518. *  during construction of the cursor.                                      *
  519. *                                                                          *
  520. * EXAMPLE:                                                                 *
  521. *  // Find all objects with "Sev 1"                                        *
  522. *  IContainerControl::ObjectCursor cursor(*pCustContainer, "Sev 1")        *
  523. *  for (cursor.setToFirst();                                               *
  524. *       cursor.isValid();                                                  *
  525. *       cursor.setToNext() )                                               *
  526. *  {                                                                       *
  527. *     object.objectAt(cursor).notifyIBM();                                 *
  528. *  }                                                                       *
  529. *                                                                          *
  530. ***************************************************************************/
  531. public:
  532. /*------------------------ Constructors -------------------------------------
  533. | An instance of this class can be constructed by providing a text string   |
  534. | to be used for searching the container.  In addition, the search can be   |
  535. | specified to:                                                             |
  536. |   - Return a case sensitive match only.                                   |
  537. |   - Return a match only when the text is the first in the record.         |
  538. |   - Return an exact match of the text string only.                        |
  539. |                                                                           |
  540. | When a TextCursor is constructed, it is valid only for the objects shown  |
  541. | in the view that the container is currently displaying.  For example, if  |
  542. | the container is displaying the icon view when the TextCursor is          |
  543. | constructed, and you want the application to iterate a text cursor for    |
  544. | children in a tree view, you must switch the container to the tree view   |
  545. | and create a new TextCursor.                                              |
  546. |                                                                           |
  547. | If you create a details view TextCursor, all text columns are searched    |
  548. | for the given string.                                                     |
  549. ---------------------------------------------------------------------------*/
  550. /* Construct an iterator for text occurances */
  551.   TextCursor ( const IContainerControl& container,
  552.                const char*  text,
  553.                Boolean      isCaseSensitive = true,
  554.                Boolean      isFirstInRecord = false,
  555.                Boolean      isExactMatch = false );
  556.  ~TextCursor ( );
  557.  
  558. /*------------------------ Cursor Movement ----------------------------------
  559. | The following functions are used to position the TextCursor:              |
  560. |  setToFirst    - Points to the first object in the container with the     |
  561. |                  matching text.                                           |
  562. |  setToNext     - Points to the next or first object in the container with |
  563. |                  the matching text.                                       |            |
  564. |  setToLast     - Points to the last object in the container with the      |
  565. |                  matching text.                                           |
  566. |  setToPrevious - Points to the previous or last object in the container   |
  567. |                  with the matching text.                                  |
  568. ---------------------------------------------------------------------------*/
  569. virtual  Boolean
  570.   setToFirst    ( ),
  571.   setToNext     ( ),
  572.   setToLast     ( ),
  573.   setToPrevious ( );
  574.  
  575. /*------------------------ Object Retrieval ---------------------------------
  576. | The following functions are used to retrieve objects using a TextCursor:  |
  577. |  first      - Points to and returns the first object in the container     |
  578. |               with the matching text.                                     |
  579. |  next       - Points to and returns the next or first object in the       |
  580. |               container with the matching text.                           |
  581. |  last       - Points to and returns the last object in the container with |
  582. |               the matching text.                                          |
  583. |  previous   - Points to and returns the previous or last object in the    |
  584. |               container with the matching text.                           |
  585. |  current    - Returns the current object of this cursor.                  |
  586. |  setCurrent - Sets the cursor to point to a particular object.            |
  587. ---------------------------------------------------------------------------*/
  588. virtual IContainerObject
  589.   *first       ( ),
  590.   *next        ( ),
  591.   *previous    ( ),
  592.   *last        ( ),
  593.   *current     ( ) const;
  594. TextCursor
  595.  &setCurrent   ( const IContainerObject* currentObject);
  596.  
  597. /*------------------------ Cursor Validation --------------------------------
  598. | The following functions are used in cursor validation:                    |
  599. |  isValid    - Queries whether the cursor is pointing to a valid object.   |
  600. |  invalidate - Flags the cursor as invalid.                                |
  601. ---------------------------------------------------------------------------*/
  602. virtual  Boolean
  603.   isValid      ( ) const;
  604. virtual TextCursor
  605.  &invalidate   ( );
  606.  
  607. private:
  608. IContainerObject
  609.  *find( unsigned long ulView,
  610.         IContainerObject* objectAfter,
  611.         const char* pszText,
  612.         Boolean fIsCaseSensitive,
  613.         Boolean fIsFirstInRecord);
  614. IContainerObject
  615.  *pcnrobjClCurrent,
  616.  *pcnrobjClParent;
  617. unsigned long
  618.   ulClView;
  619. unsigned long
  620.   ulClChanges;
  621. IContainerControl
  622.  *pcnrctlClOwner;
  623. IString
  624.   strClSearchString;
  625. Boolean
  626.   fClIsCaseSensitive,
  627.   fClIsFirstInRecord,
  628.   fClIsExactMatch;
  629. };  /* end TextCursor */
  630.  
  631.  
  632. class ColumnCursor : public IVBase
  633. {
  634. typedef IVBase
  635.   Inherited;
  636. /***************************************************************************
  637. * The IContainerControl::ColumnCursor class is used to iterate the         *
  638. * container's details view columns.                                        *
  639. *                                                                          *
  640. * EXAMPLE:                                                                 *
  641. *  ** smack all the columns in a container **                              *
  642. *  IContainerControl::ColumnCursor cursor(*pCustContainer);                *
  643. *  for (cursor.setToFirst();                                               *
  644. *       cursor.isValid();                                                  *
  645. *       cursor.setToNext() )                                               *
  646. *  {                                                                       *
  647. *     object.columnAt(cursor).smack();                                     *
  648. *  }                                                                       *
  649. *                                                                          *
  650. ****************************************************************************/
  651. public:
  652. /*------------------------ Constructors -------------------------------------
  653. | Objects of this class are constructed by passing in:                      |
  654. |   - The container over which the iteration is to occur, and               |
  655. |   - An optional value that indicates whether all columns, or only visible |
  656. |     columns, will be iterated.                                            |
  657. ---------------------------------------------------------------------------*/
  658.   ColumnCursor  ( const IContainerControl& container,
  659.                   Boolean                  visibleOnly=false);
  660.  ~ColumnCursor  ( );
  661.  
  662. /*------------------------ Cursor Movement ----------------------------------
  663. | The following functions are used to move the cursor and retrieve columns: |
  664. |  setToFirst    - Points to the first column in the container.             |
  665. |  setToNext     - Points to the next or first column in the container.     |
  666. |  setToLast     - Points to the last column in the container.              |
  667. |  setToPrevious - Points to the previous or last column in the container.  |
  668. ---------------------------------------------------------------------------*/
  669. virtual  Boolean
  670.   setToFirst     ( ),
  671.   setToNext      ( ),
  672.   setToLast      ( ),
  673.   setToPrevious  ( );
  674.  
  675. /*------------------------ Column Retrieval ---------------------------------
  676. | The following functions are used to move the cursor and retrieve columns: |
  677. |   first      - Points to and returns the first column in the container.   |
  678. |   next       - Points to and returns the next or first column in the      |
  679. |                container.                                                 |
  680. |   last       - Points to and returns the last column in the container.    |
  681. |   previous   - Points to and returns the previous or last column in the   |
  682. |                container.                                                 |
  683. |   current    - Returns the current column of this cursor.                 |
  684. |   setCurrent - Sets the cursor to point to a particular column.  This     |
  685. |                function does not check for visibility.                    |
  686. ---------------------------------------------------------------------------*/
  687. virtual IContainerColumn
  688.  *first        ( ),
  689.  *next         ( ),
  690.  *previous     ( ),
  691.  *last         ( ),
  692.  *current      ( ) const;
  693. ColumnCursor
  694.  &setCurrent   ( const IContainerColumn* currentColumn);
  695.  
  696. /*------------------------ Cursor Validation --------------------------------
  697. | The following functions are used in cursor validation:                    |
  698. |  isValid    - Queries whether the cursor is pointing to a valid column.   |
  699. |  invalidate - Flags the cursor as invalid.                                |
  700. ---------------------------------------------------------------------------*/
  701. virtual  Boolean
  702.   isValid     ( ) const;
  703. virtual ColumnCursor
  704.  &invalidate  ( );
  705.  
  706. private:
  707. IContainerColumn
  708.   *pcnrcolClCurrent;
  709. unsigned long
  710.   ulClChanges;
  711. IContainerControl
  712.   *pcnrctlClOwner;
  713. Boolean
  714.   fClVisible;
  715. };  /* end ColumnCursor */
  716.  
  717. class Iterator : public IVBase
  718. {
  719. /***************************************************************************
  720. *  The IContainerControl::Iterator class is used by the container to apply *
  721. *  a function to the objects in the container.  To perform a function on   *
  722. *  the elements of the container, subclass Iterator and provide the        *
  723. *  behavior for the applyTo function.  Then, call                          *
  724. *  IContainerControl::allObjectsDo with an instance of this class.  The    *
  725. *  allObjectsDo function will call the applyTo function for all objects in *
  726. *  the container or until a false is returned.                             *
  727. *                                                                          *
  728. * EXAMPLE:                                                                 *
  729. *                                                                          *
  730. *  class Recalculate    : public IContainerControl::Iterator               *
  731. *  {                                                                       *
  732. *  virtual Boolean                                                         *
  733. *    applyTo( IContainerObject* object)                                    *
  734. *    {                                                                     *
  735. *        //  Update the state of the object                                *
  736. *      return true;                                                        *
  737. *    }                                                                     *
  738. *  };                                                                      *
  739. *                                                                          *
  740. *  Recalculate calculator;                                                 *
  741. *  container().allObjectsDo(calculator);                                   *
  742. *                                                                          *
  743. ***************************************************************************/
  744. typedef IVBase
  745.   Inherited;
  746. public:
  747. /*------------------------ Constructors -------------------------------------
  748. | The only way to construct an instance of this class is to use the default |
  749. | constructor with no arguments.                                            |
  750. ---------------------------------------------------------------------------*/
  751.   Iterator    ( );
  752.  ~Iterator    ( );
  753.  
  754. /*------------------------ Filter Behavior ----------------------------------
  755. | The following function is used to apply a behavior to all objects in a    |
  756. | container:                                                                |
  757. |  applyTo    - Returns true if the iteration is to continue or false       |
  758. |               if it is to stop.                                           |
  759. ---------------------------------------------------------------------------*/
  760. virtual Boolean
  761.   applyTo     ( IContainerObject* object) = 0;
  762.  
  763. };  /* end Iterator */
  764.  
  765.  
  766. /*-------------------------------- Accessors -----------------------------------
  767. | The following functions provide means of getting and setting the accessible  |
  768. | attributes of instances of this class:                                       |
  769. |   setTitle                 - Sets the container title using text or a        |
  770. |                              resource ID.                                    |
  771. |   setTitleAlignment        - Sets the alignment attributes for the title.    |
  772. |   showTitle                - Shows the container title.                      |
  773. |   hideTitle                - Removes the container title from the container. |
  774. |   enableTitleUpdate        - Allows the container title to be edited.        |
  775. |   disableTitleUpdate       - Prevents the container title from being edited. |
  776. |   showTitleSeparator       - Displays a horizontal separator between the     |
  777. |                              title and the work area.                        |
  778. |   hideTitleSeparator       - Removes the title separator from the container  |
  779. |                              window.                                         |
  780. |   showDetailsViewTitles    - Displays column headings in details view.       |
  781. |   hideDetailsViewTitles    - Removes column headings from details view.      |
  782. |   setLineSpacing           - Sets the vertical distance between records.     |
  783. |   setIconSize              - Sets the icon or bit-map size for all objects.  |
  784. |   setSingleSelection       - Sets the selection mode to single selection.    |
  785. |   setMultipleSelection     - Sets the selection mode to multiple selection.  |
  786. |   setExtendedSelection     - Sets the selection mode to extended selection.  |
  787. |   setNormalTargetEmphasis  - Sets the drag mode to normal target emphasis.   |
  788. |   setOrderedTargetEmphasis - Sets the drag mode to ordered target emphasis.  |
  789. |   setMixedTargetEmphasis   - Sets the drag mode to mixed target emphasis.    |
  790. |   title                    - Returns the title of the container.             |
  791. |   isTitleVisible           - Queries whether the container title is          |
  792. |                              currently displayed.                            |
  793. |   lineSpacing              - Returns the space between lines, in pixels.     |
  794. |   iconSize                 - Returns the icon or bit-map size of all         |
  795. |                              objects.                                        |
  796. ------------------------------------------------------------------------------*/
  797. IContainerControl
  798.  &setTitle                 ( const char*        title),
  799.  &setTitle                 ( const IResourceId& resourceId),
  800.  &setTitleAlignment        ( TitleAlignment     alignment = centered),
  801.  &showTitle                ( Boolean            show = true),
  802.  &hideTitle                ( ),
  803.  &enableTitleUpdate        ( Boolean            enable = true),
  804.  &disableTitleUpdate       ( ),
  805.  &showTitleSeparator       ( Boolean            show = true),
  806.  &hideTitleSeparator       ( ),
  807.  &showDetailsViewTitles    ( Boolean            show = true),
  808.  &hideDetailsViewTitles    ( ),
  809.  &setLineSpacing           ( long               lineSpacing),
  810.  &setIconSize              ( const ISize&       iconSize),
  811.  &setSingleSelection       ( ),
  812.  &setMultipleSelection     ( ),
  813.  &setExtendedSelection     ( ),
  814.  &setNormalTargetEmphasis  ( ),
  815.  &setOrderedTargetEmphasis ( ),
  816.  &setMixedTargetEmphasis   ( );
  817.  
  818. IString
  819.    title                   ( ) const;
  820.  
  821. Boolean
  822.   isTitleVisible           ( ) const;
  823.  
  824. long
  825.   lineSpacing              ( ) const;
  826.  
  827. ISize
  828.   iconSize                 ( ) const;
  829.  
  830.  
  831.  
  832.  
  833. /*-------------------------- Automatic Deletion Behavior ----------------------
  834. | The following functions are used to describe behavior that should occur      |
  835. | automatically when a container is deleted:                                   |
  836. |   setDeleteObjectsOnClose  - Deletes all objects in the container when the   |
  837. |                              container is deleted.  Since objects can be in  |
  838. |                              multiple containers, the container's default    |
  839. |                              behavior only removes objects but does not      |
  840. |                              delete them when the container is deleted.      |
  841. |   setDeleteColumnsOnClose  - Deletes all columns in the container when the   |
  842. |                              container is deleted.  Only columns allocated   |
  843. |                              using operator new should be set for automatic  |
  844. |                              deletion.  Since columns can be in multiple     |
  845. |                              containers, the container's default behavior    |
  846. |                              only removes columns but does not delete them   |
  847. |                              when the container is deleted.                  |
  848. |   willDeleteObjectsOnClose - Returns true if container objects will be       |
  849. |                              deleted when the container is deleted.          |
  850. |   willDeleteColumnsOnClose - Returns true if the columns will be deleted     |
  851. |                              when the container is deleted.                  |
  852. ------------------------------------------------------------------------------*/
  853. IContainerControl
  854.  &setDeleteObjectsOnClose  ( Boolean            destroy = true),
  855.  &setDeleteColumnsOnClose  ( Boolean            destroy = true);
  856.  
  857. Boolean
  858.   willDeleteObjectsOnClose ( ) const,
  859.   willDeleteColumnsOnClose ( ) const;
  860.  
  861. /*----------------------------- Color ------------------------------------------
  862. | The following functions are used to change or query colors in the container: |
  863. |  setColor   - Changes the color of a particular ColorArea.                   |
  864. |  color      - Returns the color of a particular ColorArea.                   |
  865. |  ColorArea  - The areas of the container whose color can be set or           |
  866. |               determined.  They are:                                         |
  867. |                                                                              |
  868. |               background          - The background of the container window.  |
  869. |               foreground          - The foreground or unselected text in     |
  870. |                                     the container.                           |
  871. |               border              - The border of the container window.      |
  872. |               highlightBackground - The color of selection emphasis, the     |
  873. |                                     color of the cursor of an unselected     |
  874. |                                     item in the details view, and the color  |
  875. |                                     of the cursor in all other views.        |
  876. |               highlightForeground - The color of the text of a selected item |
  877. |                                     in all views and the color of the cursor |
  878. |                                     of a selected item in the details view.  |
  879. ------------------------------------------------------------------------------*/
  880. enum ColorArea {
  881.   background=1,
  882.   foreground,
  883.   border,
  884.   highlightBackground,
  885.   highlightForeground
  886. };
  887.  
  888. virtual IContainerControl
  889.   &setColor         ( ColorArea value, const IColor& color);
  890.  
  891. IColor
  892.   color             ( ColorArea value) const;
  893.  
  894.  
  895. /*-------------------- Changing Views ------------------------------------------
  896. | The following functions are used to change the view:                         |
  897. |   showTextView       - Sets the current view to the non-flowed text view.    |
  898. |   showFlowedTextView - Sets the current view to the flowed text view.        |
  899. |   showNameView       - Sets the current view to the non-flowed name view.    |
  900. |   showFlowedNameView - Sets the current view to the flowed name view.        |
  901. |   showDetailsView    - Sets the current view to the details view.            |
  902. |   showTreeIconView   - Sets the current view to the tree icon view.          |
  903. |   showTreeTextView   - Sets the current view to the tree text view.          |
  904. |   showTreeNameView   - Sets the current view to the tree name view.          |
  905. |   showIconView       - Sets the current view to the icon view.               |
  906. |   arrangeIconView    - Arranges the icon view.                               |
  907. ------------------------------------------------------------------------------*/
  908. IContainerControl
  909.  &showTextView             ( ),
  910.  &showFlowedTextView       ( ),
  911.  &showNameView             ( ),
  912.  &showFlowedNameView       ( ),
  913.  &showDetailsView          ( ),
  914.  &showTreeIconView         ( ),
  915.  &showTreeTextView         ( ),
  916.  &showTreeNameView         ( ),
  917.  &showIconView             ( ),
  918.  &arrangeIconView          ( );
  919.  
  920. /*-------------- Determining the View ------------------------------------------
  921. | The following functions are used to query the view:                          |
  922. |   isTextView    - Queries whether the container is currently in the text     |
  923. |                   view.                                                      |
  924. |   isNameView    - Queries whether the container is currently in the name     |
  925. |                   view.                                                      |
  926. |   isDetailsView - Queries whether the container is currently in the details  |
  927. |                   view.                                                      |
  928. |   isTreeView    - Queries whether the container is currently in the tree     |
  929. |                   view.                                                      |
  930. |   isIconView    - Queries whether the container is currently in the icon     |
  931. |                   view.                                                      |
  932. |   isFlowed      - Queries whether the current container view is flowed.      |
  933. |                   This function applies to the name and text views only.     |
  934. ------------------------------------------------------------------------------*/
  935. Boolean
  936.   isTextView      ( ) const,
  937.   isNameView      ( ) const,
  938.   isDetailsView   ( ) const,
  939.   isTreeView      ( ) const,
  940.   isIconView      ( ) const,
  941.  
  942.   isFlowed        ( ) const;
  943.  
  944. /*-------------------- Container Refresh ---------------------------------------
  945. | The following functions are used to refresh the container:                   |
  946. |   setRefreshOn         - Enables refreshing the container after changes.     |
  947. |   setRefreshOff        - Disables refreshing the container after changes.    |
  948. |   refresh              - Refreshes all objects in the container.             |
  949. |   refreshAllContainers - Refreshes all containers.                           |
  950. |   isRefreshOn          - Queries the refresh state of the container.         |
  951. ------------------------------------------------------------------------------*/
  952. IContainerControl
  953.  &setRefreshOn           ( Boolean on = true),
  954.  &setRefreshOff          ( ),
  955.  &refresh                ( );
  956.  
  957. static void
  958.   refreshAllContainers   ( );
  959.  
  960. Boolean
  961.   isRefreshOn            ( );
  962.  
  963. /*-------------- Querying the Container Viewport Rectangle ---------------------
  964. | The following functions are used to determine the work area relative to      |
  965. | either the workspace or the window:                                          |
  966. |   viewPortOnWorkspace        - Retrieves the current work area in workspace  |
  967. |                                coordinates.                                  |
  968. |   viewPortOnWindow           - Retrieves the current work area in window     |
  969. |                                coordinates.                                  |
  970. |   detailsViewPortOnWorkspace - Retrieves either the right or left work       |
  971. |                                area of a split details view, in workspace    |
  972. |                                coordinates.                                  |
  973. |   detailsViewPortOnWindow    - Retrieves either the right or left work       |
  974. |                                area of a split details view, in windows      |
  975. |                                coordinates.                                  |
  976. ------------------------------------------------------------------------------*/
  977. IRectangle
  978.   viewPortOnWorkspace         ( ) const,
  979.   viewPortOnWindow            ( ) const,
  980.   detailsViewPortOnWorkspace  ( Boolean rightSide = false) const,
  981.   detailsViewPortOnWindow     ( Boolean rightSide = false) const;
  982.  
  983. /*------------------- Container Scrolling --------------------------------------
  984. | The following functions are used in scrolling the container:                 |
  985. |   scrollVertically          - Scrolls the container vertically.              |
  986. |   scrollHorizontally        - Scrolls the container horizontally.  If        |
  987. |                               rightSide is true and the container currently  |
  988. |                               is displaying a split details view, the right  |
  989. |                               pane will be scrolled.                         |
  990. |   scroll                    - Scrolls the container both horizontally and    |
  991. |                               vertically.  If horizontalPixels is non-zero   |
  992. |                               and the container is currently displaying a    |
  993. |                               split details view, rightSide determines which |
  994. |                               pane is scrolled horizontally.                 |
  995. |   scrollDetailsHorizontally - Scrolls either the right or left side of a     |
  996. |                               split details view horizontally.  If           |
  997. |                               rightSide is true, the right pane will be      |
  998. |                               scrolled.  If rightSide is false, the left     |
  999. |                               pane will be scrolled.                         |
  1000. |   scrollToObject            - Scrolls a particular object and column into    |
  1001. |                               the work area. If a column is specified, it    |
  1002. |                               will also be scrolled into the work area. If   |
  1003. |                               leftJustify is false, the column will be       |
  1004. |                               scrolled into the work area at the closest     |
  1005. |                               border.                                        |
  1006. ------------------------------------------------------------------------------*/
  1007. virtual IContainerControl
  1008.  &scrollVertically           ( long     pixels),
  1009.  &scrollHorizontally         ( long     pixels,
  1010.                                Boolean  rightSide = false),
  1011.  &scroll                     ( long     vericalPixels,
  1012.                                long     horizontalPixels,
  1013.                                Boolean  rightSide = false),
  1014.  &scrollDetailsHorizontally  ( long     horizontalPixels,
  1015.                                Boolean  rightSide = false),
  1016.  
  1017.  &scrollToObject             ( const IContainerObject* object),
  1018.  &scrollToObject             ( const IContainerObject* object,
  1019.                                const IContainerColumn* column,
  1020.                                Boolean                 leftJustify = true );
  1021.  
  1022.  
  1023. /*------------------- Tree View Functions --------------------------------------
  1024. | The following functions are used in the tree view:                           |
  1025. |   showTreeLine          - Shows the lines connecting parents to children's   |
  1026. |                           records.                                           |
  1027. |   hideTreeLine          - Does not show lines connecting parents to          |
  1028. |                           children's records.                                |
  1029. |   setTreeExpandIconSize - Changes the size of the expanded and collapsed bit |
  1030. |                           maps.                                              |
  1031. |   setTreeViewIndent     - Sets the distance that children will be offset     |
  1032. |                           horizontally from their parent.                    |
  1033. |   setTreeItemIcons      - Sets the icons to be used for a tree view.         |
  1034. |   collapseTree          - Collapses all nodes of a tree view.  This          |
  1035. |                           function does not work in OS/2 Version 2.0.        |
  1036. |   expandTree            - Expands all nodes of a tree view.  This function   |
  1037. |                           does not work in OS/2 Version 2.0.                 |
  1038. ------------------------------------------------------------------------------*/
  1039. virtual IContainerControl
  1040.  &showTreeLine            ( long   treeLinePixelWidth = -1),
  1041.  &hideTreeLine            ( ),
  1042.  &setTreeExpandIconSize   ( const  ISize&         sizeIcon),
  1043.  &setTreeViewIndent       ( long                  indentPixels = -1),
  1044.  &setTreeItemIcons        ( const IPointerHandle& expanded,
  1045.                             const IPointerHandle& collapsed),
  1046.  &setTreeItemIcons        ( const IResourceId&    expanded,
  1047.                             const IResourceId&    collapsed),
  1048.  &collapseTree            ( ),
  1049.  &expandTree              ( );
  1050.  
  1051. /*------------------- Details View Functions -----------------------------------
  1052. | The following functions are used in the details view:                        |
  1053. |   showSplitBar        - Adds the split bar to the details view work area.    |
  1054. |   hideSplitBar        - Removes the split bar from the details view work     |
  1055. |                         area.                                                |
  1056. |   splitBarOffset      - Returns the offset of the split bar, in pixels, from |
  1057. |                         the left side of the container window.               |
  1058. |   setDetailsViewSplit - Splits the details view by specifying the last       |
  1059. |                         column to be viewed in the left window.              |
  1060. |   isColumnRight       - Returns true if the given column is to the right     |
  1061. |                         of the split bar.                                    |
  1062. |   addColumn           - Adds a column to the container following the given   |
  1063. |                         column.                                              |
  1064. |   removeColumn        - Removes the given column from the container.         |
  1065. |   removeColumnAt      - Removes the column at a given cursor.                |
  1066. |   columnAt            - Retrieves the column at a given 0-based index or     |
  1067. |                         cursor.                                              |
  1068. |   detailsViewSplit    - Returns the last column before the split bar.        |
  1069. |   columnCount         - Returns the number of columns in the container.      |
  1070. ------------------------------------------------------------------------------*/
  1071. virtual IContainerControl
  1072.  &showSplitBar        ( Boolean Show=true),
  1073.  &hideSplitBar        ( ),
  1074.  &setDetailsViewSplit ( const IContainerColumn* lastColumnBeforeSplit,
  1075.                         unsigned long           pixelsFromLeft=50);
  1076.                 /* note: the 1st parameter is the last column  */
  1077.                 /* which will ever be scrolled in the left     */
  1078.                 /* frame. The 2nd parameter is the location    */
  1079.                 /* of the split bar in Pixels                  */
  1080. Boolean
  1081.   isColumnRight      ( const IContainerColumn* column) const;
  1082.  
  1083. virtual IContainerControl
  1084.  &addColumn          ( const IContainerColumn*          column,
  1085.                        const IContainerColumn*          afterColumn=0),
  1086.  &removeColumn       ( const IContainerColumn*          column),
  1087.  &removeColumnAt     ( IContainerControl::ColumnCursor& cursor);
  1088.  
  1089. IContainerColumn
  1090.  *columnAt           ( unsigned long       index) const,
  1091.  *columnAt           ( const ColumnCursor& cursor) const,
  1092.  *detailsViewSplit   ( ) const;
  1093.  
  1094. unsigned long
  1095.     columnCount      ( ) const,
  1096.     splitBarOffset   ( ) const;
  1097.  
  1098. /*------------------- Adding and Removing Objects ------------------------------
  1099. | The following functions are used to add and remove objects:                  |
  1100. |   addObject             - Adds an object to the container. In the tree view, |
  1101. |                           the parent defines the object's location.  When    |
  1102. |                           the parent is provided, the object is added as its |
  1103. |                           last immediate descendent.                         |
  1104. |   addObjectAfter        - Adds an object to be placed after a given object.  |
  1105. |                           If you specify 0 for the afterObject argument,     |
  1106. |                           the object will be added as the first object in    |
  1107. |                           the container.                                     |
  1108. |   removeObject          - Removes an object from this container or all       |
  1109. |                           containers.                                        |
  1110. |   removeObjectAt        - Removes the object at the cursor location.         |
  1111. |   removeSelectedObjects - Removes all selected objects from the container.   |
  1112. |   removeAllObjects      - Removes all objects from the container.            |
  1113. |   deleteSelectedObjects - Deletes the selected objects in this container. If |
  1114. |                           an object exists in other containers, it is        |
  1115. |                           removed from them as well before being deleted.    |
  1116. |   deleteAllObjects      - Deletes all objects in this container. If an       |
  1117. |                           object exists in other containers, it is removed   |
  1118. |                           from them as well before being deleted.            |
  1119. ------------------------------------------------------------------------------*/
  1120. virtual IContainerControl
  1121.  &addObject             ( const IContainerObject* newObject,
  1122.                                 IContainerObject* parentObject = 0),
  1123.  &addObjectAfter        ( const IContainerObject* newObject,
  1124.                           const IContainerObject* afterObject,
  1125.                                 IContainerObject* parentObject = 0),
  1126.   /* remove does not delete the object */
  1127.  &removeObject          ( IContainerObject* object,
  1128.                           Boolean fAllContainers = false),
  1129.  &removeObjectAt        ( IContainerControl::ObjectCursor& cursor),
  1130.  &removeObjectAt        ( IContainerControl::TextCursor& cursor),
  1131.  &removeSelectedObjects ( ),
  1132.  &removeAllObjects      ( ),
  1133.  &deleteSelectedObjects ( ),
  1134.  &deleteAllObjects      ( );
  1135.  
  1136. /*----------------- Moving/Copying Subtrees ------------------------------------
  1137. | The following functions are used to move and copy objects and descendents:   |
  1138. |   isMoveValid  - Checks if an object and its descendents can be moved to a   |
  1139. |                  new location.  This function checks the validity of a move  |
  1140. |                  to be performed by moveObjectTo().  This function will      |
  1141. |                  return false for the following reasons.                     |
  1142. |                    1) If moveObject = 0.                                     |
  1143. |                    2) If the source container doesn't contain moveObject.    |
  1144. |                    3) If afterObject is an invalid location.  If the target  |
  1145. |                       container doesn't contain a non-zero afterObject.      |
  1146. |                    4) If newParentObject is invalid.  If the target container|
  1147. |                       doesn't contain a non-zero newParentObject.            |
  1148. |                    5) If both afterObject and newParentObject are specified, |
  1149. |                       and newParentObject is not the parent of afterObject   |
  1150. |                       in the target container.                               |
  1151. |                    6) If the source and target containers are the same and   |
  1152. |                       moveObject is to be moved as a child of one of its     |
  1153. |                       descendents.                                           |
  1154. |                    7) If the source and target containers are different and  |
  1155. |                       moveObject or any of its descendents exist in the      |
  1156. |                       target container.                                      |
  1157. |   moveObjectTo - Moves an object and its descendents to a new location in    |
  1158. |                  the tree view.  An object and its descendents can be moved  |
  1159. |                  to a new container if the object and its descendents do not |
  1160. |                  exist there already.                                        |
  1161. |   copyObjectTo - Copies an object and its descendents to a new location in   |
  1162. |                  the tree view. The object must overload the objectCopy      |
  1163. |                  function. The copy of the object is returned.               |
  1164. ------------------------------------------------------------------------------*/
  1165. virtual Boolean
  1166.   isMoveValid    ( IContainerObject*  moveObject,
  1167.                    IContainerObject*  newParentObject = 0,
  1168.                    IContainerControl* newContainer = 0,
  1169.                    IContainerObject*  afterObject = 0);
  1170. virtual Boolean
  1171.   moveObjectTo   ( IContainerObject*  moveObject,
  1172.                    IContainerObject*  newParentObject = 0,
  1173.                    IContainerControl* newContainer = 0,
  1174.                    IContainerObject*  afterObject = 0,
  1175.                    const IPoint&      iconViewLocation = IPoint(0,0));
  1176. IContainerObject
  1177.  *copyObjectTo   ( IContainerObject*  copyObject,
  1178.                    IContainerObject*  parentObject = 0,
  1179.                    IContainerControl* newContainer = 0,
  1180.                    IContainerObject*  afterObject =0,
  1181.                    const IPoint&      iconViewLocation = IPoint(0,0));
  1182.  
  1183.  
  1184. /*-------------------- Retrieving Objects --------------------------------------
  1185. | The following functions are used to retrieve objects in the container:       |
  1186. |   objectAt               - Returns an object at an index or cursor position  |
  1187. |                            in the container.                                 |
  1188. |   parentObject           - Returns the parent object in the tree view.       |
  1189. |   descendentsOf          - Returns the set of all descendents of an object   |
  1190. |                            in the tree view.                                 |
  1191. |   immediateDescendentsOf - Returns the set of immediate descendents only of  |
  1192. |                            an object in the tree view.                       |
  1193. |   objectList             - Returns the set of all objects in the container.  |
  1194. |   objectCount            - Returns the number of objects in the container.   |
  1195. |   containsObject         - Returns true if the passed object is in the       |
  1196. |                            container.                                        |
  1197. |   cursoredObject         - Returns the object on which the cursor is         |
  1198. |                            located.                                          |
  1199. ------------------------------------------------------------------------------*/
  1200. virtual IContainerObject
  1201.  *objectAt           ( unsigned long                          index) const,
  1202.  *objectAt           ( const IContainerControl::ObjectCursor& cursor) const,
  1203.  *objectAt           ( const IContainerControl::TextCursor&   cursor) const,
  1204.  *parentObject       ( const IContainerObject*                childObject) const;
  1205.  
  1206.  /* Return a list of descendents of the passed object */
  1207. ICnrObjectSet
  1208.   descendentsOf           ( IContainerObject* parentObject) const,
  1209.   immediateDescendentsOf  ( IContainerObject* parentObject) const,
  1210.   objectList              ( ) const;
  1211.  
  1212.  
  1213. unsigned long
  1214.   objectCount             ( ) const;
  1215.  
  1216. Boolean
  1217.    containsObject( const IContainerObject* object) const;
  1218.  
  1219. IContainerObject
  1220.  *cursoredObject          ( ) const;
  1221.  
  1222. /*------------------ Setting Object Attributes ---------------------------------
  1223. | The following functions are used to set and remove the attributes of         |
  1224. | objects:                                                                     |
  1225. |   setSelected        - Gives an object selection emphasis.                   |
  1226. |   removeSelected     - Removes selection emphasis from an object.            |
  1227. |   setInUse           - Gives an object in-use emphasis.                      |
  1228. |   removeInUse        - Removes in-use emphasis from an object.               |
  1229. |   showSourceEmphasis - Draws source emphasis. If an object is specified,     |
  1230. |                        the emphasis is drawn around the object.  When this   |
  1231. |                        function is applied to an entire container, it turns  |
  1232. |                        source emphasis on the first time it is called, and   |
  1233. |                        turns source emphasis off the second time it is
  1234. |                        called.  When this function is applied to individual
  1235. |                        records, it only turns source emphasis on.                        |
  1236. |                        NOTE: On OS/2 Version 2.0, you cannot use this        |
  1237. |                              function to show source emphasis for an object  |
  1238. |                              if the container has the orderedTargetEmphasis  |
  1239. |                              attribute set.                                  |
  1240. |   hideSourceEmphasis - Removes source emphasis. If an object is specified,   |
  1241. |                        the emphasis is removed from the object.              |
  1242. |   setCursor          - Gives an object cursored emphasis.                    |
  1243. |   enableDataUpdate   - Enables direct editing of the text of an object.      |
  1244. |   disableDataUpdate  - Disables direct editing of the text of an object.     |
  1245. |   expand             - Expands the tree view to show the descendents of the  |
  1246. |                        parent object.                                        |
  1247. |   collapse           - Collapses the descendents of an object in the tree    |
  1248. |                        view.                                                 |
  1249. |                        Note: The parent is not actually being collapsed or   |
  1250. |                        expanded.                                             |
  1251. |   refresh            - Refreshes all objects in the container.               |
  1252. |   enableDrop         - Enables an object to be the target of a drag          |
  1253. |                        operation.                                            |
  1254. |   disableDrop        - Prevents an object from receiving a drop; no target   |
  1255. |                        emphasis is drawn.                                    |
  1256. |   showObject         - Shows an object that is currently invisible or        |
  1257. |                        filtered from the container.                          |
  1258. |   hideObject         - Makes an object invisible by filtering it out of the  |
  1259. |                        container.                                            |
  1260. ------------------------------------------------------------------------------*/
  1261. IContainerControl
  1262.  &setSelected           ( IContainerObject* object,
  1263.                            Boolean          select = true),
  1264.  &removeSelected        ( IContainerObject* object),
  1265.  &showSourceEmphasis    ( Boolean           source = true),
  1266.  &showSourceEmphasis    ( IContainerObject* object,
  1267.                           Boolean           source = true),
  1268.  &hideSourceEmphasis    ( ),
  1269.  &hideSourceEmphasis    ( IContainerObject* object),
  1270.  &setInUse              ( IContainerObject* object,
  1271.                           Boolean           inUse = true),
  1272.  &removeInUse           ( IContainerObject* object),
  1273.  &setCursor             ( IContainerObject* object),
  1274.  &enableDataUpdate      ( IContainerObject* object,
  1275.                           Boolean           enable=true),
  1276.  &disableDataUpdate     ( IContainerObject* object),
  1277.  &expand                ( IContainerObject* object),
  1278.  &collapse              ( IContainerObject* object),
  1279.  &refresh               ( IContainerObject* object),
  1280.  &enableDrop            ( IContainerObject* object,
  1281.                           Boolean           enable=true),
  1282.  &showObject            ( IContainerObject* object,
  1283.                           Boolean           visible=true),
  1284.  &hideObject            ( IContainerObject* object),
  1285.  &disableDrop           ( IContainerObject* object);
  1286.  
  1287. /*------------------ Querying Object Attributes --------------------------------
  1288. | The following functions are used to query the attributes of an object:       |
  1289. |   isTarget     - Queries whether the object is a target of direct            |
  1290. |                  manipulation.                                               |
  1291. |   isSelected   - Queries whether the object has selection emphasis.          |
  1292. |   isSource     - Queries whether the object has source emphasis.             |
  1293. |   isInUse      - Queries whether the object has in-use emphasis.             |
  1294. |   isCursored   - Queries whether the object has cursored emphasis.           |
  1295. |   isVisible    - Queries whether the object is currently visible.            |
  1296. |   isExpanded   - Queries whether the tree view node object is currently      |
  1297. |                  expanded.                                                   |
  1298. |   isCollapsed  - Queries whether the tree view node object is currently      |
  1299. |                  collapsed.                                                  |
  1300. |   isReadOnly   - Queries whether the object is read-only.                    |
  1301. |   isDropOnAble - Queries whether the object is set to receive a direct       |
  1302. |                  manipulation drop.                                          |
  1303. ------------------------------------------------------------------------------*/
  1304. Boolean
  1305.   isTarget         ( const IContainerObject* object) const,
  1306.   isSource         ( const IContainerObject* object) const,
  1307.   isSelected       ( const IContainerObject* object) const,
  1308.   isInUse          ( const IContainerObject* object) const,
  1309.   isCursored       ( const IContainerObject* object) const,
  1310.   isVisible        ( const IContainerObject* object) const,
  1311.   isExpanded       ( const IContainerObject* object) const,
  1312.   isCollapsed      ( const IContainerObject* object) const,
  1313.   isReadOnly       ( const IContainerObject* object) const,
  1314.   isDropOnAble     ( const IContainerObject* object) const;
  1315.  
  1316. /*------------------ Object Position -------------------------------------------
  1317. | The following functions are used to manipulate and query object position:    |
  1318. |   moveIconTo            - Moves the object to the specified workspace        |
  1319. |                           location.                                          |
  1320. |   iconRectangle         - Returns the icon rectangle and, optionally,        |
  1321. |                           includes text.  This rectangle is in container     |
  1322. |                           window coordinates.                                |
  1323. |   detailObjectRectangle - Returns the details view rectangle. If the column  |
  1324. |                           is specified, provides the cell in the details     |
  1325. |                           view.  This rectangle is in container window       |
  1326. |                           coordinates.                                       |
  1327. |   textRectangle         - Returns the text rectangle in window coordinates.  |
  1328. |   objectUnderPoint      - Retrieves the object under the point in window     |
  1329. |                           coordinates.                                       |
  1330. |   columnUnderPoint      - Retrieves the column under the point in window     |
  1331. |                           coordinates.                                       |
  1332. |   convertToWorkspace    - Converts a rectangle from container window         |
  1333. |                           coordinates to workspace coordinates.  This is     |
  1334. |                           valid only for the current view.                   |
  1335. ------------------------------------------------------------------------------*/
  1336. virtual IContainerControl
  1337.  &moveIconTo               ( IContainerObject* object,
  1338.                              const IPoint&     point);
  1339. IRectangle
  1340.   iconRectangle            ( const IContainerObject* object,
  1341.                              Boolean                 includeText = false) const,
  1342.   detailObjectRectangle    ( const IContainerObject* object,
  1343.                              Boolean                 rightWindow = false ) const,
  1344.   detailObjectRectangle    ( const IContainerObject* object,
  1345.                              const IContainerColumn* column) const,
  1346.   textRectangle            ( const IContainerObject* object) const,
  1347.   convertToWorkspace       ( const IRectangle&       windowRectangle,
  1348.                              Boolean                 rightWindow = false) const;
  1349.  
  1350. IContainerObject
  1351.  *objectUnderPoint         ( const IPoint& point) const;
  1352.  
  1353. IContainerColumn
  1354.  *columnUnderPoint         ( const IPoint& point) const;
  1355.  
  1356. /*------------------------ Sorting Objects -------------------------------------
  1357. | The following functions are used to provide sorting in the container:        |
  1358. |   sortByIconText  - Sorts the container by the icon's text.                  |
  1359. |   sort            - Sorts the container by a user-defined sort function      |
  1360. |                     (CompareFn).                                             |
  1361. |   nlsCompare      - Compares two strings consisting of a national character  |
  1362. |                     set.  This function is useful for implementing National  |
  1363. |                     Language Support.                                        |
  1364. ------------------------------------------------------------------------------*/
  1365. IContainerControl
  1366.  &sortByIconText    ( Boolean                             ascending = true),
  1367.  &sort              ( const IContainerControl::CompareFn& sortObject);
  1368.  
  1369. static long
  1370.   nlsCompare        ( const char* text1,
  1371.                       const char* text2) ;
  1372.  
  1373. /*------------------------ Filtering Objects -----------------------------------
  1374. | The following function is used to sort the container:                        |
  1375. |   filter           - Filters the container by calling the passed FilterFn's  |
  1376. |                      isMemberOf function. If a FilterFn is not passed,       |
  1377. |                      objects currently filtered from the container are       |
  1378. |                      restored to the container.                              |
  1379. ------------------------------------------------------------------------------*/
  1380. IContainerControl
  1381.  &filter            ( ),
  1382.  &filter            ( const IContainerControl::FilterFn& filterObject);
  1383.  
  1384. /*------------------------ Iterating Objects -----------------------------------
  1385. | The following function is used to apply behavior to the objects in the       |
  1386. | container:                                                                   |
  1387. |   allObjectsDo      - Calls the applyTo function on the passed iterator for  |
  1388. |                       all objects in the container. If includeDescendents    |
  1389. |                       is true, the tree view descendent objects will be      |
  1390. |                       called as well.  The iteration will be stopped when    |
  1391. |                       applyTo returns true or all the objects in the         |
  1392. |                       container have been processed.                         |
  1393. ------------------------------------------------------------------------------*/
  1394. IContainerControl
  1395.  &allObjectsDo      ( IContainerControl::Iterator& iteratorObject,
  1396.                       Boolean                       includeDescendents = false);
  1397.  
  1398. /*------------------------ Direct Editing --------------------------------------
  1399. | The following functions are used in direct editing in the container:         |
  1400. |   editContainerTitle - Opens an edit field on the container title.           |
  1401. |   editColumnTitle    - Opens an edit field on a column heading.              |
  1402. |   editObject         - Opens an edit field on an object.                     |
  1403. |   closeEdit          - Closes an open edit field.                            |
  1404. |   setEditMLE         - Stores a multiple-line entry (MLE) field being used   |
  1405. |                        for editing.                                          |
  1406. |   setEditColumn      - Stores the column over which editing is occurring.    |
  1407. |   setEditObject      - Stores the object over which editing is occurring.    |
  1408. |   currentEditMLE     - Retrieves the multiple-line entry (MLE) field being   |
  1409. |                        used for editing.                                     |
  1410. |   currentEditColumn  - Retrieves the column being edited.                    |
  1411. |   currentEditObject  - Retrieves the object being edited.                    |
  1412. ------------------------------------------------------------------------------*/
  1413. virtual IContainerControl
  1414.  &editContainerTitle         ( ),
  1415.  &editColumnTitle            ( IContainerColumn* column),
  1416.  &editObject                 ( IContainerObject* object,
  1417.                                IContainerColumn* column=0),
  1418.  &closeEdit                  ( ),
  1419.  &setEditMLE                 ( IMultiLineEdit*   editField),
  1420.  &setEditColumn              ( IContainerColumn* column),
  1421.  &setEditObject              ( IContainerObject* object);
  1422.  
  1423. IMultiLineEdit
  1424.  *currentEditMLE             ( );
  1425. IContainerColumn
  1426.  *currentEditColumn          ( );
  1427. IContainerObject
  1428.  *currentEditObject          ( );
  1429.  
  1430.  
  1431.  
  1432. /*------------------------ Miscellaneous ---------------------------------------
  1433. | enableCaching         - If an ICnrHandler has been created and added to the  |
  1434. |                         container, this function causes the dispatch of an   |
  1435. |                         ICnrQueryDeltaEvent to the handler when the          |
  1436. |                         container scrolls past the pre-defined delta value.  |
  1437. | disableCaching        - Stops the dispatch of ICnrQueryDeltaEvents to an     |
  1438. |                         ICnrHandler.                                         |
  1439. | enableDrawItem        - If an ICnrDrawHandler has been created and added to  |
  1440. |                         the container, this function causes the dispatch of  |
  1441. |                         an ICnrDrawItemEvent to the handler.                 |
  1442. | disableDrawItem       - Stops the dispatch of ICnrDrawItemEvents to an       |
  1443. |                         ICnrHandler.                                         |
  1444. | enableDrawBackground  - If an ICnrDrawHandler has been created and added to  |
  1445. |                         the container, this function causes the dispatch of  |
  1446. |                         an ICnrDrawBackgroundEvent to the handler.           |
  1447. | disableDrawBackground - Stops the dispatch of ICnrDrawBackgroundEvents to    |
  1448. |                         an ICnrHandler.                                      |
  1449. | containerFromHandle   - Retrieves a container from the list using the handle.|
  1450. | numberOfObjectChanges - Retrieves the containers count of object additions   |
  1451. |                         and removals.  This function is used by cursors to   |
  1452. |                         ensure invalidation occurs when the container is     |
  1453. |                         changed.                                             |
  1454. | numberOfColumnChanges - Retrieves the containers count of column additions   |
  1455. |                         and removals.  This function is used by cursors to   |
  1456. |                         ensure invalidation occurs when the container is     |
  1457. |                         changed.                                             |
  1458. ------------------------------------------------------------------------------*/
  1459. IContainerControl
  1460.  &enableCaching            ( unsigned long ulDeltaValue = 30),
  1461.  &disableCaching           ( ),
  1462.  &enableDrawItem           ( Boolean Enable=true),
  1463.  &disableDrawItem          ( ),
  1464.  &enableDrawBackground     ( Boolean Enable=true),
  1465.  &disableDrawBackground    ( );
  1466.  
  1467. static IContainerControl
  1468.  *containerFromHandle      ( const IWindowHandle& handle);
  1469.  
  1470. unsigned long
  1471.   numberOfObjectChanges    ( ) const,
  1472.   numberOfColumnChanges    ( ) const;
  1473.  
  1474. /*-------------------------------- Overrides -----------------------------------
  1475. | This class overrides the following inherited functions:                      |
  1476. |   isVisible - Overridden because of the addition of                          |
  1477. |               isVisible(IContainerObject).                                   |
  1478. |   refresh   - Overridden because of the addition of refresh().               |
  1479. ------------------------------------------------------------------------------*/
  1480. IContainerControl
  1481.   &refresh                ( Boolean           refreshChildren),
  1482.   &refresh                ( const IRectangle& invalidRectangle);
  1483.  
  1484. Boolean
  1485.   isVisible               ( ) const;
  1486.  
  1487. protected:
  1488. /*----------------------------- Implementation ---------------------------------
  1489. | The following functions are used in the implementation of the class:         |
  1490. |   setContainerAttributes - Sets the attributes into the container control.   |
  1491. |   containerInfo          - Refreshes your copy of the container's state      |
  1492. |                            data.                                             |
  1493. |   setEmphasis            - Sets an object to an emphasis attribute.          |
  1494. |   setAttributes          - Updates the attributes of an object.              |
  1495. |   setDefaultContainer    - Initializes a container to the default styles.    |
  1496. |   containerAttributes    - Returns the current container attribute mask.     |
  1497. |   attributes             - Returns an attribute mask for an object.          |
  1498. |   column                 - Returns a column matching the command criteria.   |
  1499. |   calcMinimumSize        - Returns a minimum size for the container.         |
  1500. |   hwndAllocation         - Returns the container used for object allocation. |
  1501. |   containerList          - Returns the list of containers in this            |
  1502. |                            application.                                      |
  1503. |   containerKey           - Returns the key used to control access when       |
  1504. |                            updating the container.  Acts as a semaphore to   |
  1505. |                            the container updates.                            |
  1506. |   baseRecordSize         - Returns the size of the RECORDCORE portion of the |
  1507. |                            objects stored in a container.                    |
  1508. ------------------------------------------------------------------------------*/
  1509.  
  1510. virtual void
  1511.   setContainerAttributes    ( unsigned long     attributeToTurnOff,
  1512.                               unsigned long     attributeToTurnOn),
  1513.   containerInfo             ( ) const,
  1514.   setEmphasis               ( IContainerObject* object,
  1515.                               unsigned long     emphasisAttribute,
  1516.                               Boolean           setOn=true),
  1517.   setAttributes             ( IContainerObject* object,
  1518.                               unsigned long attributeToTurnOn,
  1519.                               unsigned long attributeToTurnOff),
  1520.   setDefaultContainer       ( const Attribute& attribute);
  1521.  
  1522. unsigned long
  1523.   containerAttributes       ( ) const,
  1524.   attributes                ( const IContainerObject* object) const;
  1525.  
  1526. IContainerColumn
  1527.  *column                    ( IContainerColumn* column,
  1528.                               unsigned long     command,
  1529.                               Boolean           visible);
  1530.  
  1531. virtual unsigned long
  1532.   baseRecordSize            ( );
  1533.  
  1534. static IWindowHandle
  1535.   hwndAllocation            ( );
  1536. static ICnrControlList
  1537.  &containerList             ( );
  1538. static IPrivateResource
  1539.  &containerKey              ( );
  1540.  
  1541. virtual ISize
  1542.  calcMinimumSize            ( ) const;
  1543.  
  1544. IContainerControl           ( );
  1545.  
  1546.  
  1547.  
  1548. private:
  1549. /*--------------------------------- PRIVATE ----------------------------------*/
  1550. enum State { ok=1, noRefresh=2, invalid=4, autoDeleteObjects=8, autoDeleteColumns=16,
  1551.              needsRefresh=32};
  1552. friend class IContainerColumn;
  1553. friend class IContainerControl::ColumnCursor;
  1554. friend class IContainerControl::ObjectCursor;
  1555. friend class IContainerObject;
  1556. friend class ICnrEditHandler;
  1557. friend class ICnrDestroyHandler;
  1558. void
  1559.   addContainer        ( ),
  1560.   showView            ( unsigned long     viewFlags),
  1561.   collectDescendents  ( ICnrObjectSet&    containerSet,
  1562.                         IContainerObject* object) const,
  1563.   addDefaultHandler   ( ),
  1564.   removeDefaultHandler( );
  1565.  
  1566. IContainerObject
  1567.  *findFirst           ( unsigned long usView,
  1568.                         const char* text,
  1569.                         Boolean     isCaseSensitive = false,
  1570.                         Boolean     isFirstInRecord = false) const,
  1571.  *selectedObject      ( const IContainerObject* objectAfter,
  1572.                         unsigned long           ulEmphasis) const,
  1573.  *object              ( const IContainerObject* objectAfter,
  1574.                         unsigned long          command) const;
  1575.  
  1576.  
  1577. IRectangle
  1578.   viewport            ( unsigned long ulCoordinateSpace,
  1579.                         Boolean rightSplitWindow) const;
  1580.  
  1581. static ICnrDestroyHandler
  1582.  &destroyHandler         ( );
  1583. static void
  1584.   setAllocationContainer ( unsigned long handle);
  1585.  
  1586. void
  1587.   cleanUp();
  1588.  
  1589. ICnrInfo
  1590.  *pcnrinfoCl;
  1591.  
  1592. IContainerColumn
  1593.  *pcnrcolClSplitbar;
  1594.  
  1595. /* MLE Edit data */
  1596. IContainerColumn
  1597.  *pcnrcolClEdit;
  1598. IContainerObject
  1599.  *pcnrobjClEdit;
  1600. IMultiLineEdit
  1601.  *pmleClEdit;
  1602.  
  1603. Boolean
  1604.   fClInvalidate;
  1605. int
  1606.   lClSplitbar,
  1607.   flClState;
  1608. unsigned long
  1609.   ulClDragEvent;
  1610. IBitmapHandle
  1611.   hbmClIconViewBackground;
  1612. ISize
  1613.   sizIconViewBitmap;
  1614. unsigned long
  1615.   ulClObjectChanges;
  1616. unsigned long
  1617.   ulClColumnChanges;
  1618. static const Attribute
  1619.   miniView;
  1620. static Attribute
  1621.   currentDefaultAttribute;
  1622. static Style
  1623.   currentDefaultStyle;
  1624.  
  1625. };  /* end IContainerControl */
  1626.  
  1627.  
  1628.  
  1629. INESTEDBITFLAGCLASSFUNCS(Style, IContainerControl);
  1630.  
  1631. /*----------------------------------------------------------------------------*/
  1632. /* Resume compiler default packing and warning messages.                      */
  1633. /*----------------------------------------------------------------------------*/
  1634. #pragma pack()
  1635. #pragma info(restore)
  1636.  
  1637. /*--------------------------------- INLINES ----------------------------------*/
  1638. #ifndef I_NO_INLINES
  1639.   #include <icnrctl.inl>
  1640. #endif
  1641.  
  1642.  
  1643. #endif  /* _ICNRCTL_ */
  1644.