home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / oclsrc15.zip / OCL / Include / OContainerBase.hpp < prev    next >
C/C++ Source or Header  |  1996-07-15  |  6KB  |  140 lines

  1. // OCL - OS/2 Class Library
  2. // (c) Cubus 1995
  3. // All Rights Reserved
  4. // OContainerBase.hpp
  5.  
  6. /*
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Neither the name Cubus nor the name Team OCL may be used to
  13.  *    endorse or promote products derived from this software
  14.  *    without specific prior written permission.
  15.  * 3. See OCL.INF for a detailed copyright notice.
  16.  *
  17.  *              THIS SOFTWARE IS PROVIDED ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  */
  29.  
  30. // $Header: E:/Projects/OCL/Include/rcs/OContainerBase.hpp 1.12 1996/01/16 10:12:17 B.STEIN Release B.STEIN $
  31.  
  32. #ifndef OCONTAINERBASE_INCLUDED
  33.   #define OCONTAINERBASE_INCLUDED
  34.  
  35.  
  36. #ifndef OFRAME_INCLUDED
  37.   #include <oframe.hpp>
  38. #endif
  39.  
  40. #ifndef OSTRING_INCLUDED
  41.   #include <OString.hpp>
  42. #endif
  43.  
  44.  
  45. typedef class OContainerBase *pOContainerBase;
  46.  
  47. class __CPP_EXPORT__ OContainerBase
  48.   : public OWindow
  49. {
  50.  public:
  51.  
  52.    CNRINFO              cnri;
  53.  
  54.    OContainerBase      (const ULONG id,             // id of the container (must be unique!)
  55.                         const HWND Parent,          // becomes parent AND owner of the container
  56.                         const ULONG cnrStyle,       // container style
  57.                         const ULONG initViewStyle); // default view style
  58.  
  59.    OContainerBase      (const ULONG id,             // id of the container (must be unique!)
  60.                         const OFrame& Parent,       // becomes parent AND owner of the container
  61.                         const ULONG cnrStyle,       // container style
  62.                         const ULONG initViewStyle); // default view style
  63.  
  64.    OContainerBase      (const ULONG id,             // id of the container (must be unique!)
  65.                         const pOFrame Parent,       // becomes parent AND owner of the container
  66.                         const ULONG cnrStyle,       // container style
  67.                         const ULONG initViewStyle); // default view style
  68.  
  69.    virtual
  70.       ~OContainerBase  ();
  71.  
  72.    virtual
  73.       PSZ isOfType     () const;
  74.  
  75.    virtual BOOL
  76.      setupDetails      () = 0,           // sets up details view colums
  77.      setupItems        () = 0;           // inserts all records
  78.  
  79.    OContainerBase&
  80.      createContainer   ();               // creates the container and calls setupDetails()
  81.                                          // and setupItems()
  82.  
  83.    OWindow&
  84.      inherit           (const HWND       hwndDlg);
  85.  
  86.    BOOL
  87.      insertDetailInfo  (PFIELDINFO       info, 
  88.                         PFIELDINFOINSERT insert) const,
  89.      insertRecord      (PVOID            rootRecord,
  90.                         PRECORDINSERT    insert) const,
  91.      freeDetails       (),               // frees details fieldinfo
  92.      freeItems         (),               // removes all items
  93.      freeContainer     (),               // calls freeDetails() and freeItems()
  94.      freeDetailInfo    (PFIELDINFO       rootRecord, ULONG count) const,
  95.      freeRecord        (PVOID            rootRecord, ULONG count) const,
  96.      eraseRecord       (PVOID            record) const,
  97.      removeDetailInfo  (PFIELDINFO       rootRecord,
  98.                         ULONG            count,
  99.                         ULONG            flag = CMA_FREE | CMA_INVALIDATE) const,
  100.      removeRecord      (PVOID            rootRecord,
  101.                         ULONG            count, 
  102.                         ULONG            flag = CMA_FREE | CMA_INVALIDATE) const,
  103.      queryCnrInfo      () const,
  104.      setView           (ULONG            viewStyle),
  105.      setTitle          (PSZ              title),
  106.      setCnrInfo        (ULONG            attributeFlag = CMA_FLWINDOWATTR) const,
  107.      setEmphasis       (PVOID            record,
  108.                         ULONG            emphasis = CRA_SELECTED,
  109.                         BOOL             set = TRUE) const,
  110.      arrangeRecords    () const,
  111.      collapseTree      (PVOID            rootRecord = NULL) const,
  112.      expandTree        (PVOID            rootRecord = NULL) const,
  113.      openEdit          (PCNREDITDATA     editData) const,
  114.      closeEdit         () const,
  115.      invalidateDetails () const,
  116.      invalidateRecord  (PVOID            rootRecord = NULL,
  117.                         ULONG            flag = CMA_REPOSITION,
  118.                         ULONG            count = 0) const,   // invalidate all
  119.      filter            (PFN              function, 
  120.                         PVOID            storage) const;     // not yet implemented
  121.  
  122.    PRECORDCORE
  123.      _allocRecords     (ULONG            additional, ULONG records) const,
  124.      _queryRecord      (PVOID            rootRecord,
  125.                         ULONG            flag   = CMA_FIRST,
  126.                         ULONG            order  = CMA_ITEMORDER) const,
  127.      _queryEmphasis    (PVOID            record = (PVOID)CMA_FIRST,
  128.                         ULONG            flag   = CRA_SELECTED) const;
  129.  
  130.    PFIELDINFO
  131.      allocDetailFields (ULONG            fields) const,
  132.      queryDetailInfo   (PFIELDINFO       rootRecord,
  133.                         ULONG            flag = CMA_FIRST) const;
  134. };
  135.  
  136.  
  137. #endif // OCONTAINERBASE_INCLUDED
  138.  
  139. // end of source
  140.