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

  1. #ifndef _ICNRCTL_
  2. #define _ICNRCTL_
  3. /*******************************************************************************
  4. * FILE NAME: icnrctl.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IContainerControl                                                        *
  9. *     IContainerControl::ObjectCursor                                          *
  10. *     IContainerControl::TextCursor                                            *
  11. *     IContainerControl::ColumnCursor                                          *
  12. *     IContainerControl::FilterFn                                              *
  13. *     IContainerControl::CompareFn                                             *
  14. *     IContainerControl::Iterator                                              *
  15. *                                                                              *
  16. * COPYRIGHT:                                                                   *
  17. *   IBM Open Class Library                                                     *
  18. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  19. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  20. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  21. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  22. *                                                                              *
  23. *******************************************************************************/
  24.  
  25. #include <icontrol.hpp>
  26. #include <icnrobj.hpp>
  27. #include <irect.hpp>
  28.  
  29. class IContainerControl;
  30. class IContainerColumn;
  31. class IResourceId;
  32. class IPrivateResource;
  33. class IMultiLineEdit;
  34. class IColor;
  35. class ICnrControlList;
  36. class ICnrObjectSet;
  37. class ICnrControlData;
  38. class ICnrObjCursorData;
  39. class ICnrTextCursorData;
  40. class ICnrColCursorData;
  41. struct ICnrInfo;
  42. class ICnrRecord;
  43. class ICnrSortPackage;
  44.  
  45. #pragma pack(4)
  46.  
  47.  
  48. class IContainerControl : public IControl {
  49. typedef IControl
  50.   Inherited;
  51.  
  52. public:
  53.  
  54. class Style;
  55. class Attribute;
  56.  
  57. /*-------------------------- Related Types -----------------------------------*/
  58. enum EnumerationOrder {
  59.   itemOrder,
  60.   zOrder
  61.   };
  62.  
  63. enum TitleAlignment {
  64.   left,
  65.   right,
  66.   centered
  67.   };
  68.  
  69. /*------------------------ Constructors --------------------------------------*/
  70.   IContainerControl ( unsigned long     id,
  71.                       IWindow*          parent,
  72.                       IWindow*          owner,
  73.                       const IRectangle& location  = IRectangle(),
  74.                       const Style&      style     = defaultStyle(),
  75.                       const Attribute&  attribute = defaultAttribute());
  76.   IContainerControl ( unsigned long id,
  77.                       IWindow*      parentDialog);
  78.  
  79.   IContainerControl ( const IWindowHandle& handle);
  80.  
  81.  
  82. virtual
  83.  ~IContainerControl ( );
  84.  
  85. /*-------------------------------- Styles ------------------------------------*/
  86. INESTEDBITFLAGCLASSDEF2( Style, IContainerControl, IWindow, IControl);
  87.  
  88. static const Style
  89.   IC_IMPORTU classDefaultStyle,
  90.   IC_IMPORTU readOnly,
  91.   IC_IMPORTU autoPosition,
  92.   IC_IMPORTU extendedSelection,
  93.   IC_IMPORTU singleSelection,
  94.   IC_IMPORTU multipleSelection,
  95.   IC_IMPORTU verifyPointers,
  96.   IC_IMPORTU noSharedObjects,
  97.   IC_IMPORTU pmCompatible;
  98.  
  99. static Style
  100.   defaultStyle      ( );
  101. static void
  102.   setDefaultStyle   ( const Style&    style );
  103.  
  104. virtual unsigned long
  105.   convertToGUIStyle ( const IBitFlag& style,
  106.                       Boolean         extendedOnly = false ) const;
  107.  
  108. Boolean
  109.   isPMCompatible    ( ) const;
  110.  
  111. /*-------------------------------- Attributes -------------------------------*/
  112. INESTEDBITFLAGCLASSDEF0( Attribute, IContainerControl);
  113.  
  114. static const Attribute
  115.   IC_IMPORTU textView,
  116.   IC_IMPORTU iconView,
  117.   IC_IMPORTU nameView,
  118.   IC_IMPORTU detailsView,
  119.   IC_IMPORTU treeView,
  120.   IC_IMPORTU flowedView,
  121.   IC_IMPORTU miniIcons,
  122.   IC_IMPORTU readOnlyTitle,
  123.   IC_IMPORTU titleSeparator,
  124.   IC_IMPORTU detailsViewTitles,
  125.   IC_IMPORTU visibleTitle,
  126.   IC_IMPORTU alignTitleCentered,
  127.   IC_IMPORTU alignTitleLeft,
  128.   IC_IMPORTU alignTitleRight,
  129.   IC_IMPORTU handleDrawItem,
  130.   IC_IMPORTU handleDrawBackground,
  131.   IC_IMPORTU orderedTargetEmphasis,
  132.   IC_IMPORTU mixedTargetEmphasis,
  133.   IC_IMPORTU visibleTreeLine,
  134.   IC_IMPORTU classDefaultAttribute;
  135.  
  136. static Attribute
  137.   defaultAttribute    ( );
  138. static void
  139.   setDefaultAttribute ( const  Attribute& attribute);
  140.  
  141.  
  142. /*------------------------ Comparison ----------------------------------------*/
  143. Boolean
  144.   operator==( const IContainerControl& container);
  145.  
  146. /*------------------------ Initialization ------------------------------------*/
  147. static void
  148.      initialize ( );
  149.  
  150.  
  151. class FilterFn : public IVBase {
  152. typedef IVBase
  153.   Inherited;
  154. public:
  155. /*------------------------ Constructors -----------------------------------*/
  156.   FilterFn ( );
  157.  
  158. virtual
  159.  ~FilterFn ( );
  160.  
  161. /*------------------------ Object Filtering -------------------------------*/
  162. virtual Boolean
  163.   isMemberOf  ( IContainerObject* object,
  164.                 IContainerControl* container) const = 0;
  165.  
  166. };  /* end FilterFn */
  167.  
  168.  
  169. class CompareFn : public IVBase {
  170. typedef IVBase
  171.   Inherited;
  172. public:
  173. /*------------------------ Constructors -----------------------------------*/
  174.   CompareFn  ( );
  175.  
  176. virtual
  177.  ~CompareFn  ( );
  178.  
  179. /*------------------------ Object Sorting ---------------------------------*/
  180. virtual int
  181.   isEqual     ( IContainerObject* object1,
  182.                 IContainerObject* object2,
  183.                 IContainerControl* container) const = 0;
  184.  
  185. };  /* end CompareFn */
  186.  
  187.  
  188. class ObjectCursor : public IVBase {
  189. typedef IVBase
  190.   Inherited;
  191. public:
  192. /*------------------------ Constructors -----------------------------------*/
  193.   ObjectCursor ( const IContainerControl&   container,
  194.                  IContainerObject::Emphasis emphasis    = IContainerObject::none,
  195.                  EnumerationOrder           enumeration = itemOrder);
  196.  
  197.   ObjectCursor ( const IContainerControl& container,
  198.                  const IContainerObject*  parentObject,
  199.                  Boolean                  allDescendents = false);
  200.  
  201. virtual
  202.  ~ObjectCursor ( );
  203.  
  204. /*------------------------ Cursor Movement --------------------------------*/
  205. virtual  Boolean
  206.   setToFirst    ( ),
  207.   setToNext     ( ),
  208.   setToLast     ( ),
  209.   setToPrevious ( );
  210.  
  211. /*------------------------ Object Retrieval -------------------------------*/
  212. virtual IContainerObject
  213.  *first       ( ),
  214.  *next        ( ),
  215.  *previous    ( ),
  216.  *last        ( ),
  217.  *current     ( ) const;
  218.  
  219. virtual ObjectCursor
  220.  &setCurrent  ( const IContainerObject* currentObject);
  221.  
  222. /*------------------------ Cursor Validation ------------------------------*/
  223. virtual  Boolean
  224.   isValid       ( ) const;
  225. virtual ObjectCursor
  226.  &invalidate    ( );
  227.  
  228. private:
  229.  
  230. friend class INativeContainerHandler;
  231.  
  232. IContainerObject
  233.  *object          ( const IContainerObject* objectAfter,
  234.                     unsigned long           command),
  235.  *selectedObject  ( const IContainerObject* objectAfter,
  236.                     unsigned long           emphasis),
  237.  *lastObject      ( const IContainerObject* objectAfter = 0),
  238.  *previousObject  ( const IContainerObject* objectBefore),
  239.  *nextObject      ( const IContainerObject* objectAfter),
  240.  *nextBranchObject( const IContainerObject* objectAfter);
  241.  
  242. enum State {
  243.   all=1,
  244.   child=2,
  245.   emphasis=4,
  246.   allSubTree=8
  247.   };
  248.  
  249.  
  250. IContainerObject
  251.  *pcnrobjClCurrent,
  252.  *pcnrobjClParent;
  253. unsigned long
  254.   ulClChanges;
  255. IContainerControl
  256.  *pcnrctlClOwner;
  257. unsigned long
  258.   flClEmphasis;
  259. unsigned long
  260.   flClEnumeration;
  261. unsigned long
  262.   flClState;
  263. unsigned long
  264.   currentIndex;
  265. ICnrObjCursorData
  266.   *objectCursorData;
  267. };  /* end ObjectCursor */
  268.  
  269.  
  270. class TextCursor : public IVBase {
  271. typedef IVBase
  272.   Inherited;
  273. public:
  274. /*------------------------ Constructors -----------------------------------*/
  275.   TextCursor ( const IContainerControl& container,
  276.                const char*              text,
  277.                Boolean                  isCaseSensitive = true,
  278.                Boolean                  isFirstInRecord = false,
  279.                Boolean                  isExactMatch = false );
  280.  
  281. virtual
  282.  ~TextCursor ( );
  283.  
  284. /*------------------------ Cursor Movement --------------------------------*/
  285. virtual  Boolean
  286.   setToFirst    ( ),
  287.   setToNext     ( ),
  288.   setToLast     ( ),
  289.   setToPrevious ( );
  290.  
  291. /*------------------------ Object Retrieval -------------------------------*/
  292. virtual IContainerObject
  293.   *first       ( ),
  294.   *next        ( ),
  295.   *previous    ( ),
  296.   *last        ( ),
  297.   *current     ( ) const;
  298.  
  299. virtual TextCursor
  300.  &setCurrent   ( const IContainerObject* currentObject);
  301.  
  302. /*------------------------ Cursor Validation ------------------------------*/
  303. virtual  Boolean
  304.   isValid      ( ) const;
  305. virtual TextCursor
  306.  &invalidate   ( );
  307.  
  308. private:
  309. IContainerObject
  310.  *find( unsigned long     view,
  311.         IContainerObject* objectAfter,
  312.         const char*       text,
  313.         Boolean           caseSensitive,
  314.         Boolean           firstInRecord);
  315. IContainerObject
  316.  *pcnrobjClCurrent,
  317.  *pcnrobjClParent;
  318. unsigned long
  319.   ulClView;
  320. unsigned long
  321.   ulClChanges;
  322. IContainerControl
  323.  *pcnrctlClOwner;
  324. IString
  325.   strClSearchString;
  326. Boolean
  327.   fClIsCaseSensitive,
  328.   fClIsFirstInRecord,
  329.   fClIsExactMatch;
  330. ICnrTextCursorData
  331.   *textCursorData;
  332. };  /* end TextCursor */
  333.  
  334.  
  335. class ColumnCursor : public IVBase {
  336. typedef IVBase
  337.   Inherited;
  338. public:
  339. /*------------------------ Constructors -----------------------------------*/
  340.   ColumnCursor  ( const IContainerControl& container,
  341.                   Boolean                  visibleOnly = false );
  342.  
  343. virtual
  344.  ~ColumnCursor  ( );
  345.  
  346. /*------------------------ Cursor Movement --------------------------------*/
  347. virtual  Boolean
  348.   setToFirst     ( ),
  349.   setToNext      ( ),
  350.   setToLast      ( ),
  351.   setToPrevious  ( );
  352.  
  353. /*------------------------ Column Retrieval -------------------------------*/
  354. virtual IContainerColumn
  355.  *first        ( ),
  356.  *next         ( ),
  357.  *previous     ( ),
  358.  *last         ( ),
  359.  *current      ( ) const;
  360.  
  361. virtual ColumnCursor
  362.  &setCurrent   ( const IContainerColumn* currentColumn);
  363.  
  364. /*------------------------ Cursor Validation ------------------------------*/
  365. virtual  Boolean
  366.   isValid     ( ) const;
  367. virtual ColumnCursor
  368.  &invalidate  ( );
  369.  
  370. private:
  371. IContainerColumn
  372.   *pcnrcolClCurrent;
  373. unsigned long
  374.   ulClChanges;
  375. IContainerControl
  376.   *pcnrctlClOwner;
  377. Boolean
  378.   fClVisible;
  379. ICnrColCursorData
  380.   *colCursorData;
  381. };  /* end ColumnCursor */
  382.  
  383.  
  384. class Iterator : public IVBase {
  385. typedef IVBase
  386.   Inherited;
  387. public:
  388. /*------------------------ Constructors ------------------------------------*/
  389.   Iterator    ( );
  390.  
  391. virtual
  392.  ~Iterator    ( );
  393.  
  394. /*------------------------ Filter Behavior --------------------------------*/
  395. virtual Boolean
  396.   applyTo     ( IContainerObject* object ) = 0;
  397.  
  398. };  /* end Iterator */
  399.  
  400.  
  401.  
  402. /*-------------------------------- Appearance --------------------------------*/
  403. virtual IContainerControl
  404.  &setTitle                 ( const char*        title),
  405.  &setTitle                 ( const IResourceId& resourceId),
  406.  &setTitleAlignment        ( TitleAlignment     alignment = centered),
  407.  &showTitle                ( Boolean            show = true),
  408.  &hideTitle                ( );
  409. virtual IContainerControl
  410.  &enableTitleUpdate        ( Boolean            enable = true),
  411.  &disableTitleUpdate       ( );
  412. virtual IContainerControl
  413.  &showTitleSeparator       ( Boolean            show = true),
  414.  &hideTitleSeparator       ( );
  415.  
  416. virtual IContainerControl
  417.  &showDetailsViewTitles    ( Boolean            show = true),
  418.  &hideDetailsViewTitles    ( );
  419.  
  420. virtual IContainerControl
  421.  &setLineSpacing           ( long               lineSpacing),
  422.  &setIconSize              ( const ISize&       iconSize);
  423.  
  424. virtual IContainerControl
  425.  &setSingleSelection       ( ),
  426.  &setMultipleSelection     ( ),
  427.  &setExtendedSelection     ( );
  428.  
  429. virtual IContainerControl
  430.  &setNormalTargetEmphasis  ( ),
  431.  &setOrderedTargetEmphasis ( ),
  432.  &setMixedTargetEmphasis   ( );
  433.  
  434. virtual IString
  435.    title                   ( ) const;
  436.  
  437. Boolean
  438.   areDetailsViewTitlesVisible  ( ) const,
  439.   hasNormalTargetEmphasis      ( ) const,
  440.   hasOrderedTargetEmphasis     ( ) const,
  441.   hasMixedTargetEmphasis       ( ) const,
  442.   isTitleVisible               ( ) const,
  443.   isTitleSeparatorVisible      ( ) const,
  444.   isTitleWriteable             ( ) const;
  445.  
  446. long
  447.   lineSpacing              ( ) const;
  448.  
  449. ISize
  450.   iconSize                 ( ) const;
  451.  
  452. IRectangle
  453.   titleRectangle           ( ) const;
  454.  
  455. Boolean
  456.   isSingleSelection        ( ) const,
  457.   isMultipleSelection      ( ) const,
  458.   isExtendedSelection      ( ) const;
  459.  
  460. /*-------------------------- Automatic Deletion Behavior --------------------*/
  461. virtual IContainerControl
  462.  &setDeleteObjectsOnClose  ( Boolean            destroy = true),
  463.  &setDeleteColumnsOnClose  ( Boolean            destroy = true);
  464.  
  465. Boolean
  466.   willDeleteObjectsOnClose ( ) const,
  467.   willDeleteColumnsOnClose ( ) const;
  468.  
  469.  
  470.  
  471. /*-------------------- Changing Views ----------------------------------------*/
  472. virtual IContainerControl
  473.  &showTextView             ( ),
  474.  &showFlowedTextView       ( ),
  475.  &showNameView             ( ),
  476.  &showFlowedNameView       ( ),
  477.  &showDetailsView          ( ),
  478.  &showTreeIconView         ( ),
  479.  &showTreeTextView         ( ),
  480.  &showTreeNameView         ( ),
  481.  &showIconView             ( );
  482. virtual IContainerControl
  483.  &arrangeIconView          ( );
  484. virtual IContainerControl
  485.  &showMiniIcons            ( Boolean  mini=true );
  486.  
  487. /*-------------- Determining the View ----------------------------------------*/
  488. Boolean
  489.   isTextView       ( Boolean textOnly=false ) const,
  490.   isNameView       ( Boolean nameOnly=false ) const,
  491.   isIconView       ( Boolean iconOnly=false ) const,
  492.   isDetailsView    ( ) const,
  493.   isTreeView       ( ) const,
  494.   isFlowedTextView ( ) const,
  495.   isFlowedNameView ( ) const,
  496.   isTreeIconView   ( ) const,
  497.   isTreeTextView   ( ) const,
  498.   isTreeNameView   ( ) const,
  499.   isFlowed         ( ) const;
  500.  
  501. Boolean
  502.   isShowingMiniIcons ( ) const;
  503.  
  504. /*-------------------- Container Refresh -------------------------------------*/
  505. virtual IContainerControl
  506.  &setRefreshOn           ( Boolean on = true),
  507.  &setRefreshOff          ( ),
  508.  &refresh                ( Boolean immediate=false );
  509.  
  510. static void
  511.   refreshAllContainers   ( Boolean immediate=false );
  512.  
  513. Boolean
  514.   isRefreshOn            ( ) const;
  515.  
  516. /*-------------- Querying the View Port Rectangle ----------------------------*/
  517. IRectangle
  518.   viewPortOnWorkspace         ( ) const,
  519.   viewPortOnWindow            ( ) const,
  520.   detailsViewPortOnWorkspace  ( Boolean rightSide = false) const,
  521.   detailsViewPortOnWindow     ( Boolean rightSide = false) const;
  522.  
  523. /*------------------- Container Scrolling ------------------------------------*/
  524. virtual IContainerControl
  525.  &scrollVertically           ( long     pixels),
  526.  &scrollHorizontally         ( long     pixels,
  527.                                Boolean  rightSide = false),
  528.  &scroll                     ( long     vericalPixels,
  529.                                long     horizontalPixels,
  530.                                Boolean  rightSide = false),
  531.  &scrollDetailsHorizontally  ( long     horizontalPixels,
  532.                                Boolean  rightSide = false),
  533.  
  534.  &scrollToObject             ( const IContainerObject* object),
  535.  &scrollToObject             ( const IContainerObject* object,
  536.                                const IContainerColumn* column,
  537.                                Boolean                 leftJustify = true );
  538.  
  539. /*------------------- Tree View Functions ------------------------------------*/
  540. virtual IContainerControl
  541.  &showTreeLine            ( long   treeLinePixelWidth = -1),
  542.  &hideTreeLine            ( ),
  543.  &setTreeExpandIconSize   ( const  ISize&         sizeIcon),
  544.  &setTreeViewIndent       ( long                  indentPixels = -1),
  545.  &setTreeItemIcons        ( const IPointerHandle& expanded,
  546.                             const IPointerHandle& collapsed),
  547.  &setTreeItemIcons        ( const IResourceId&    expanded,
  548.                             const IResourceId&    collapsed);
  549.  
  550. virtual IContainerControl
  551.  &collapseTree            ( ),
  552.  &expandTree              ( );
  553.  
  554. /*------------------- Details View Functions ---------------------------------*/
  555. virtual IContainerControl
  556.  &showSplitBar        ( Boolean showSplitBar=true),
  557.  &hideSplitBar        ( ),
  558.  &setDetailsViewSplit ( const IContainerColumn* lastColumnBeforeSplit,
  559.                         unsigned long           pixelsFromLeft=50);
  560. Boolean
  561.   isColumnRight      ( const IContainerColumn* column) const;
  562.  
  563. virtual IContainerControl
  564.  &addColumn          ( const IContainerColumn*          column,
  565.                        const IContainerColumn*          afterColumn=0),
  566.  &removeColumn       ( const IContainerColumn*          column),
  567.  &removeColumnAt     ( IContainerControl::ColumnCursor& cursor);
  568.  
  569. IContainerColumn
  570.  *columnAt           ( unsigned long       index) const,
  571.  *columnAt           ( const ColumnCursor& cursor) const;
  572.  
  573. IContainerColumn
  574.  *detailsViewSplit   ( ) const;
  575.  
  576. unsigned long
  577.     columnCount      ( ) const;
  578.  
  579. unsigned long
  580.     splitBarOffset   ( ) const;
  581.  
  582. IRectangle
  583.   detailsTitleRectangle  ( Boolean rightSide = false ) const;
  584.  
  585. /*------------------- Adding and Removing Objects ----------------------------*/
  586. virtual IContainerControl
  587.  &addObjects            ( ICnrAllocator&          allocator,
  588.                           IContainerObject*       parentObject = 0),
  589.  &addObjectsAfter       ( ICnrAllocator&          allocator,
  590.                           const IContainerObject* afterObject,
  591.                           IContainerObject*       parentObject = 0);
  592. virtual IContainerControl
  593.  &addObject             ( const IContainerObject* newObject,
  594.                           IContainerObject*       parentObject = 0),
  595.  &addObjectAfter        ( const IContainerObject* newObject,
  596.                           const IContainerObject* afterObject,
  597.                                 IContainerObject* parentObject = 0);
  598.  
  599. virtual IContainerControl
  600.  &removeObject          ( IContainerObject*                object,
  601.                           Boolean                          allContainers = false),
  602.  &removeObjectAt        ( IContainerControl::ObjectCursor& cursor),
  603.  &removeObjectAt        ( IContainerControl::TextCursor&   cursor),
  604.  &removeSelectedObjects ( ),
  605.  &removeAllObjects      ( ),
  606.  &deleteSelectedObjects ( ),
  607.  &deleteAllObjects      ( );
  608.  
  609. /*----------------- Moving and Copying Subtrees ------------------------------*/
  610. virtual Boolean
  611.   isMoveValid    ( IContainerObject*  moveObject,
  612.                    IContainerObject*  newParentObject = 0,
  613.                    IContainerControl* newContainer = 0,
  614.                    IContainerObject*  afterObject = 0);
  615. virtual Boolean
  616.   moveObjectTo   ( IContainerObject*  moveObject,
  617.                    IContainerObject*  newParentObject = 0,
  618.                    IContainerControl* newContainer = 0,
  619.                    IContainerObject*  afterObject = 0,
  620.                    const IPoint&      iconViewLocation = IPoint(0,0));
  621. virtual IContainerObject
  622.  *copyObjectTo   ( IContainerObject*  copyObject,
  623.                    IContainerObject*  parentObject = 0,
  624.                    IContainerControl* newContainer = 0,
  625.                    IContainerObject*  afterObject =0,
  626.                    const IPoint&      iconViewLocation = IPoint(0,0));
  627.  
  628.  
  629. /*-------------------- Retrieving Objects ------------------------------------*/
  630. virtual IContainerObject
  631.  *objectAt           ( unsigned long                          index) const,
  632.  *objectAt           ( const IContainerControl::ObjectCursor& cursor) const,
  633.  *objectAt           ( const IContainerControl::TextCursor&   cursor) const,
  634.  *parentObject       ( const IContainerObject*                childObject) const;
  635.  
  636.  
  637. ICnrObjectSet
  638.   descendentsOf           ( IContainerObject* parentObject) const,
  639.   immediateDescendentsOf  ( IContainerObject* parentObject) const,
  640.   objectList              ( ) const;
  641.  
  642.  
  643. unsigned long
  644.   objectCount             ( ) const;
  645.  
  646. Boolean
  647.    containsObject( const IContainerObject* object) const;
  648.  
  649. virtual IContainerObject
  650.  *cursoredObject          ( ) const;
  651.  
  652. /*------------------ Setting Object Attributes -------------------------------*/
  653. virtual IContainerControl
  654.  &setSelected           ( IContainerObject* object,
  655.                            Boolean          select = true),
  656.  &removeSelected        ( IContainerObject* object);
  657.  
  658. virtual IContainerControl
  659.  &showSourceEmphasis    ( Boolean           source = true),
  660.  &showSourceEmphasis    ( IContainerObject* object,
  661.                           Boolean           source = true),
  662.  &hideSourceEmphasis    ( ),
  663.  &hideSourceEmphasis    ( IContainerObject* object),
  664.  &setInUse              ( IContainerObject* object,
  665.                           Boolean           inUse = true),
  666.  &removeInUse           ( IContainerObject* object),
  667.  &setCursor             ( IContainerObject* object);
  668. virtual IContainerControl
  669.  &enableDataUpdate      ( IContainerObject* object,
  670.                           Boolean           enable=true),
  671.  &disableDataUpdate     ( IContainerObject* object),
  672.  &expand                ( IContainerObject* object),
  673.  &collapse              ( IContainerObject* object),
  674.  &refresh               ( IContainerObject* object,
  675.                           Boolean immediate=false);
  676. virtual IContainerControl
  677.  &enableDrop            ( IContainerObject* object,
  678.                           Boolean           enable=true);
  679.  
  680. virtual IContainerControl
  681.  &showObject            ( IContainerObject* object,
  682.                           Boolean           visible=true),
  683.  &hideObject            ( IContainerObject* object);
  684.  
  685. virtual IContainerControl
  686.  &disableDrop           ( IContainerObject* object);
  687.  
  688. /*------------------ Querying Object Attributes ------------------------------*/
  689. Boolean
  690.   isTarget         ( const IContainerObject* object) const,
  691.   isSource         ( const IContainerObject* object) const;
  692.  
  693. Boolean
  694.   isSelected       ( const IContainerObject* object) const;
  695.  
  696. Boolean
  697.   isInUse          ( const IContainerObject* object) const,
  698.   isCursored       ( const IContainerObject* object) const,
  699.   isVisible        ( const IContainerObject* object) const;
  700. Boolean
  701.   isExpanded       ( const IContainerObject* object) const,
  702.   isCollapsed      ( const IContainerObject* object) const,
  703.   isWriteable      ( const IContainerObject* object) const;
  704. Boolean
  705.   isDropOnAble     ( const IContainerObject* object) const;
  706.  
  707. /*------------------ Object Position -----------------------------------------*/
  708. virtual IContainerControl
  709.  &moveIconTo               ( IContainerObject* object,
  710.                              const IPoint&     point);
  711.  
  712. IRectangle
  713.   iconRectangle            ( const IContainerObject* object,
  714.                              Boolean                 includeText = false) const,
  715.   detailsObjectRectangle   ( const IContainerObject* object,
  716.                              Boolean                 rightWindow = false ) const,
  717.   detailsObjectRectangle   ( const IContainerObject* object,
  718.                              const IContainerColumn* column) const,
  719.   textRectangle            ( const IContainerObject* object) const,
  720.   convertToWorkspace       ( const IRectangle&       windowRectangle,
  721.                              Boolean                 rightWindow = false) const;
  722.  
  723. IContainerObject
  724.  *objectUnderPoint         ( const IPoint& point) const;
  725.  
  726. IContainerColumn
  727.  *columnUnderPoint         ( const IPoint& point) const;
  728.  
  729. /*------------------------ Sorting Objects -----------------------------------*/
  730. virtual IContainerControl
  731.  &sortByIconText    ( Boolean                             ascending = true),
  732.  &sort              ( const IContainerControl::CompareFn& sortObject);
  733.  
  734. static long
  735.   nlsCompare        ( const char* text1,
  736.                       const char* text2) ;
  737.  
  738. /*------------------------ Filtering Objects ---------------------------------*/
  739. virtual IContainerControl
  740.  &filter            ( ),
  741.  &filter            ( const IContainerControl::FilterFn& filterObject);
  742.  
  743. /*------------------------ Iterating Objects ---------------------------------*/
  744. virtual IContainerControl
  745.  &allObjectsDo      ( IContainerControl::Iterator& iteratorObject,
  746.                       Boolean                      includeDescendents = false);
  747.  
  748. /*------------------------ Direct Editing ------------------------------------*/
  749. virtual IContainerControl
  750.  &editContainerTitle         ( );
  751. virtual IContainerControl
  752.  &editColumnTitle            ( IContainerColumn* column),
  753.  &editObject                 ( IContainerObject* object,
  754.                                IContainerColumn* column=0),
  755.  &closeEdit                  ( );
  756. virtual IContainerControl
  757.  &setEditMLE                 ( IMultiLineEdit*   editField);
  758. virtual IContainerControl
  759.  &setEditColumn              ( IContainerColumn* column),
  760.  &setEditObject              ( IContainerObject* object);
  761.  
  762. IMultiLineEdit
  763.  *currentEditMLE             ( )  const;
  764. IContainerColumn
  765.  *currentEditColumn          ( )  const;
  766. IContainerObject
  767.  *currentEditObject          ( )  const;
  768.  
  769.  
  770. /*------------------------ Miscellaneous -------------------------------------*/
  771. virtual IContainerControl
  772.  &enableCaching            ( unsigned long deltaValue = 30),
  773.  &disableCaching           ( ),
  774.  &enableDrawItem           ( Boolean enable=true),
  775.  &disableDrawItem          ( ),
  776.  &enableDrawBackground     ( Boolean enable=true),
  777.  &disableDrawBackground    ( );
  778.  
  779. Boolean
  780.   isCachingEnabled         ( ) const,
  781.   isDrawItemEnabled        ( ) const,
  782.   isDrawBackgroundEnabled  ( ) const;
  783.  
  784. static IContainerControl
  785.  *containerFromHandle      ( const IWindowHandle& handle);
  786.  
  787. unsigned long
  788.   numberOfObjectChanges    ( ) const,
  789.   numberOfColumnChanges    ( ) const;
  790.  
  791. /*-------------------------------- Overrides ---------------------------------*/
  792. virtual IContainerControl
  793.  &refresh ( const IRectangle& invalidRectangle,
  794.             Boolean           immediate ),
  795.  &refresh ( IWindow::RefreshType type );
  796.  
  797. virtual Boolean
  798.   isVisible               ( ) const;
  799.  
  800. virtual IColor
  801.   foregroundColor              ( ) const,
  802.   backgroundColor              ( ) const;
  803.  
  804. virtual IContainerControl
  805.  &resetForegroundColor         ( ),
  806.  &resetBackgroundColor         ( );
  807.  
  808. virtual IContainerControl
  809.   &setForegroundColor    ( const IColor &color );
  810.  
  811. virtual IContainerControl
  812.   &setBackgroundColor    ( const IColor &color );
  813.  
  814.  
  815. /*----------------------- Notification Members -------------------------------*/
  816. static INotificationId const
  817.   IC_IMPORTU addId,
  818.   IC_IMPORTU removeId,
  819.   IC_IMPORTU selectId,
  820.   IC_IMPORTU enterId,
  821.   IC_IMPORTU titleId,
  822.   IC_IMPORTU titleVisibleId,
  823.   IC_IMPORTU detailsViewTitlesId;
  824.  
  825. virtual IContainerControl
  826.  &enableNotification ( Boolean enable=true );
  827.  
  828.  
  829. protected:
  830. /*----------------------------- Implementation -------------------------------*/
  831. virtual void
  832.   setContainerAttributes    ( unsigned long     attributeToTurnOff,
  833.                               unsigned long     attributeToTurnOn),
  834.   setEmphasis               ( IContainerObject* object,
  835.                               unsigned long     emphasisAttribute,
  836.                               Boolean           setOn=true),
  837.   setAttributes             ( IContainerObject* object,
  838.                               unsigned long     attributeToTurnOn,
  839.                               unsigned long     attributeToTurnOff);
  840.  
  841. unsigned long
  842.   containerAttributes       ( ) const,
  843.   attributes                ( const IContainerObject* object) const;
  844.  
  845. IContainerColumn
  846.  *column                    ( IContainerColumn* column,
  847.                               unsigned long     command,
  848.                               Boolean           visible);
  849.  
  850. virtual unsigned long
  851.   baseRecordSize            ( );
  852.  
  853. static IWindowHandle
  854.   hwndAllocation            ( );
  855. static ICnrControlList
  856.  &containerList             ( );
  857. static IPrivateResource
  858.  &containerKey              ( );
  859.  
  860. virtual ISize
  861.  calcMinimumSize            ( ) const;
  862.  
  863. IContainerControl           ( );
  864.  
  865.  
  866. /*------------------------- Drag and Drop ------------------------------------*/
  867. virtual Boolean
  868.   isDragStarting      ( IEvent& event );
  869.  
  870. private:
  871. /*------------------------------- Hidden Functions ---------------------------*/
  872. IContainerControl     ( const IContainerControl& container );
  873. IContainerControl
  874.  &operator=           ( const IContainerControl& container );
  875.  
  876. /*--------------------------------- Private ----------------------------------*/
  877. enum State {
  878.   ok=1,
  879.   noRefresh=2,
  880.   invalid=4,
  881.   autoDeleteObjects=8,
  882.   autoDeleteColumns=16,
  883.   needsRefresh=32
  884.   };
  885.  
  886. friend class IContainerColumn;
  887. friend class IContainerControl::ColumnCursor;
  888. friend class IContainerControl::ObjectCursor;
  889. friend class IContainerObject;
  890. friend class ICnrEditHandler;
  891. friend class ICnrDestroyHandler;
  892. friend class ICnrControlData;
  893. friend class ICnrObjPrivateData;
  894. friend class ICnrAllocator;
  895. friend class INativeContainerHandler;
  896. friend class IDetailsEditHandler;
  897. friend class IMessageHandler;
  898. friend class IColumnSet;
  899.  
  900. friend long __stdcall IContainerControl__compare(
  901.                                            const IMiniCnrRecord* pcnrrec1,
  902.                                            const IMiniCnrRecord* pcnrrec2,
  903.                                            ICnrSortPackage*      pSortPackage);
  904.  
  905. friend Boolean __stdcall pfnCleanUpObjects(ICnrRecord* pRecord,
  906.                                            void* thisCnr);
  907.  
  908. void
  909.   addContainer        ( ),
  910.   showView            ( unsigned long     viewFlags),
  911.   collectDescendents  ( ICnrObjectSet&    containerSet,
  912.                         IContainerObject* object) const,
  913.   addDefaultHandler   ( ),
  914.   removeDefaultHandler( );
  915.  
  916. IContainerObject
  917.  *findFirst           ( unsigned long view,
  918.                         const char*   text,
  919.                         Boolean       isCaseSensitive = false,
  920.                         Boolean       isFirstInRecord = false ) const,
  921.  *selectedObject      ( const IContainerObject* objectAfter,
  922.                         unsigned long           emphasis ) const,
  923.  *object              ( const IContainerObject* objectAfter,
  924.                         unsigned long           command ) const;
  925.  
  926.  
  927. IRectangle
  928.   viewport            ( unsigned long coordinateSpace,
  929.                         Boolean       rightSplitWindow) const;
  930.  
  931. static ICnrDestroyHandler
  932.  &destroyHandler         ( );
  933. static void
  934.   setAllocationContainer ( unsigned long handle);
  935.  
  936. void
  937.   cleanUp();
  938.  
  939. long
  940.   removeRecords(void* prec, unsigned short number, unsigned short cmd);
  941.  
  942. void
  943.      containerInfo       ( ICnrInfo* pCnrInfo ) const,
  944.      setContainerInfo    ( ICnrInfo* pCnrInfo, unsigned long flags ),
  945.      setDefaultContainer ( const Attribute& attribute );
  946.  
  947. IString
  948.   strContainerTitle;
  949.  
  950. IContainerColumn
  951.  *pcnrcolClSplitbar;
  952.  
  953. IContainerColumn
  954.  *pcnrcolClEdit;
  955. IContainerObject
  956.  *pcnrobjClEdit;
  957. IMultiLineEdit
  958.  *pmleClEdit;
  959.  
  960. Boolean
  961.   fClInvalidate;
  962. int
  963.   lClSplitbar,
  964.   flClState;
  965. unsigned long
  966.   ulClDragEvent;
  967. IBitmapHandle
  968.   hbmClIconViewBackground;
  969. unsigned long
  970.   ulClObjectChanges;
  971. unsigned long
  972.   ulClColumnChanges;
  973.  
  974. static Attribute
  975.   currentDefaultAttribute;
  976. static Style
  977.   currentDefaultStyle;
  978.  
  979. ICnrControlData
  980.  *ppd;
  981.  
  982. static int ListViewFindItem(const IWindowHandle& handle,
  983.                             int start, void* lvFindInfo);
  984. };  /* end IContainerControl */
  985.  
  986.  
  987.  
  988. INESTEDBITFLAGCLASSFUNCS(Style, IContainerControl);
  989.  
  990. #pragma pack()
  991.  
  992.   #include <icnrctl.inl>
  993.  
  994.  
  995. #endif  /* _ICNRCTL_ */
  996.