home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / Tables / LFlexTableGeometry.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.6 KB  |  100 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.     
  21.     Created 3/25/96 - Tim Craycroft
  22.  
  23.  
  24.     This class works with an LTableView and an LTableHeader.
  25.     All rows have the same height. Column positions and widths
  26.     are determined by the header view.
  27. */
  28.  
  29.  
  30. #pragma once
  31.  
  32. #include <UTableHelpers.h>
  33. #include <LTableView.h>
  34.  
  35. #include "LTableHeader.h"
  36.  
  37.  
  38. class    LFlexTableGeometry : public LTableGeometry 
  39. {
  40. public:
  41.                         LFlexTableGeometry(
  42.                                 LTableView        *inTableView,
  43.                                 LTableHeader    *inTableHeader);
  44.     
  45.     virtual void        GetImageCellBounds(
  46.                                 const STableCell    &inCell,
  47.                                 Int32                &outLeft,
  48.                                 Int32                &outTop,
  49.                                 Int32                &outRight,
  50.                                 Int32                &outBottom) const;
  51.                                 
  52.     virtual TableIndexT    GetRowHitBy(
  53.                                 const SPoint32    &inImagePt) const;
  54.                                 
  55.     virtual TableIndexT    GetColHitBy(
  56.                                 const SPoint32    &inImagePt) const;
  57.                                 
  58.     virtual void        GetTableDimensions(
  59.                                 Uint32        &outWidth,
  60.                                 Uint32        &outHeight) const;
  61.     
  62.     // All rows have the same height
  63.     virtual Uint16        GetRowHeight(
  64.                                 TableIndexT    inRow) const;
  65.     
  66.     // Sets row height for ALL rows                            
  67.     virtual void        SetRowHeight(
  68.                                 Uint16        inHeight,
  69.                                 TableIndexT    inFromRow,
  70.                                 TableIndexT    inToRow);
  71.                                 
  72.     virtual Uint16        GetColWidth(
  73.                                 TableIndexT    inCol) const;
  74.                                 
  75.     
  76.     // DO NOT CALL.  Column widths are controlled by table headewr
  77.     virtual void        SetColWidth(
  78.                                 Uint16        inWidth,
  79.                                 TableIndexT inFromCol,
  80.                                 TableIndexT    inToCol);
  81.                                 
  82.  
  83.     virtual void        InsertRows(
  84.                                 Uint32        inHowMany,
  85.                                 TableIndexT    inAfterRow );
  86.     virtual void        RemoveRows(
  87.                                 Uint32        inHowMany,
  88.                                 TableIndexT    inFromRow);
  89.                                 
  90. protected:
  91.     UInt32            CountRows() const;
  92.     
  93.     LTableHeader*    mTableHeader;
  94.     UInt16            mRowHeight;
  95.     UInt32            mRowCount;                    
  96. };
  97.  
  98.  
  99.  
  100.