home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / apioutln.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.2 KB  |  214 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. #ifndef __APIOUTLN_H
  19. #define __APIOUTLN_H
  20.  
  21. #ifndef __APIAPI_H
  22.     #include "apiapi.h"
  23. #endif
  24. #ifndef __NSGUIDS_H
  25.     #include "nsguids.h"
  26. #endif
  27.  
  28. #define    APICLASS_OUTLINERPARENT      "OutlinerParent"
  29. #define APICLASS_OUTLINER            "Outliner"
  30.  
  31. typedef enum {
  32.     ColumnFixed,
  33.     ColumnVariable
  34. } Column_t;
  35.  
  36. typedef enum {
  37.     CropNone = 0,
  38.     CropCenter,
  39.     CropRight,
  40.     CropLeft
  41. } CropType_t;
  42.  
  43. typedef enum {
  44.     AlignLeft,
  45.     AlignRight,
  46.     AlignCenter
  47. } AlignType_t;
  48.  
  49. #define OUTLINER_RETURN         1
  50. #define OUTLINER_LBUTTONDOWN    2
  51. #define OUTLINER_LBUTTONUP        3
  52. #define OUTLINER_RBUTTONDOWN    4
  53. #define OUTLINER_RBUTTON        4    // For compatibility
  54. #define OUTLINER_RBUTTONUP        5
  55. #define OUTLINER_LBUTTONDBLCLK  6
  56. #define OUTLINER_KEYDOWN        7
  57. #define OUTLINER_PROPERTIES     8
  58. #define OUTLINER_TIMER          9
  59. #define OUTLINER_SET            10
  60.  
  61. class COutliner;        // temporary hack
  62.  
  63. class IOutliner {
  64. public:
  65.     virtual void EnableTips (
  66.         BOOL = TRUE
  67.         ) = 0;
  68.  
  69.     virtual BOOL GetTipsEnabled (
  70.         void 
  71.         ) = 0;
  72.  
  73.     virtual void SetCSID ( 
  74.         int csid 
  75.         ) = 0;
  76.  
  77.     virtual int GetCSID (
  78.         void 
  79.         ) = 0;
  80.  
  81.     virtual int AddColumn ( 
  82.         LPCTSTR header, 
  83.         UINT idCol, 
  84.         int iMinCol, 
  85.         int iMaxCol = 10000, 
  86.         Column_t cType = ColumnFixed, 
  87.         int iPercent = 50,
  88.         BOOL bIsButton = TRUE, 
  89.         CropType_t ct = CropRight, 
  90.         AlignType_t at = AlignLeft 
  91.         ) = 0;
  92.  
  93.     virtual int GetColumnSize ( 
  94.         UINT idCol 
  95.         ) = 0;
  96.  
  97.     virtual void SetColumnSize ( 
  98.         UINT idCol, 
  99.         int iSize 
  100.         ) = 0;
  101.  
  102.     virtual int GetColumnPercent ( 
  103.         UINT idCol 
  104.         ) = 0;
  105.  
  106.     virtual void SetColumnPercent ( 
  107.         UINT idCol, 
  108.         int iPercent 
  109.         ) = 0;
  110.  
  111.     virtual int GetColumnPos( 
  112.         UINT idCol 
  113.         ) = 0;
  114.  
  115.     virtual void SetColumnPos( 
  116.         UINT idCol, 
  117.         int iColumn 
  118.         ) = 0;
  119.  
  120.     virtual void SetColumnName ( 
  121.         UINT idCol, 
  122.         LPCTSTR pName 
  123.         ) = 0;
  124.  
  125.     virtual LPCTSTR GetColumnName ( 
  126.         UINT idCol 
  127.         ) = 0;
  128.  
  129.     virtual void SetImageColumn( 
  130.         UINT idCol 
  131.         ) = 0;
  132.  
  133.     virtual void SetHasPipes( 
  134.         BOOL bPipes 
  135.         ) = 0;
  136.  
  137.     virtual void SetVisibleColumns( 
  138.         UINT iVisCol 
  139.         ) = 0;
  140.  
  141.     virtual UINT GetVisibleColumns(
  142.         void
  143.         ) = 0;
  144.     
  145.     virtual void SelectItem ( 
  146.         int iSel, 
  147.         int mode = OUTLINER_SET, 
  148.         UINT flags = 0 
  149.         ) = 0;
  150.  
  151.     virtual BOOL DeleteItem ( 
  152.         int iLine 
  153.         ) = 0;
  154.  
  155.     virtual void ScrollIntoView( 
  156.         int iVisibleLine 
  157.         ) = 0;
  158.  
  159.     virtual int GetFocusLine(
  160.         void 
  161.         ) = 0;
  162.  
  163.     virtual void SetTotalLines( 
  164.         int 
  165.         ) = 0;
  166.  
  167.     virtual int GetTotalLines(
  168.         void 
  169.         ) = 0;
  170. };
  171.  
  172. typedef IOutliner * LPIOUTLINER;
  173. #define ApiOutliner(v,unk) APIPTRDEF(IID_IOutliner,IOutliner,v,unk)
  174.  
  175. class IOutlinerParent {
  176. public:
  177.     virtual void EnableBorder ( 
  178.         BOOL = TRUE
  179.         ) = 0;
  180.  
  181.     virtual void EnableHeaders ( 
  182.         BOOL = TRUE
  183.         ) = 0;
  184.  
  185.     virtual void SetOutliner ( 
  186.         COutliner * pIOutliner 
  187.         ) = 0;
  188.  
  189.     virtual COutliner * GetOutliner ( 
  190.         void 
  191.         ) = 0;
  192.  
  193.     virtual void CreateColumns ( 
  194.         void 
  195.         ) = 0;
  196.  
  197.     virtual BOOL ColumnCommand ( 
  198.         int idColumn 
  199.         ) = 0;
  200.  
  201.     virtual BOOL RenderData ( 
  202.         int idColumn, 
  203.         CRect & rect, 
  204.         CDC & dc, 
  205.         LPCTSTR lpsz = NULL 
  206.         ) = 0;
  207. };
  208.  
  209. typedef IOutlinerParent * LPIOUTLINERPARENT;
  210. #define ApiOutlinerParent(v,unk) APIPTRDEF(IID_IOutlinerParent,IOutlinerParent,v,unk)
  211.  
  212. #endif
  213.  
  214.