home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / MNListView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.4 KB  |  95 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.    MNListView.h - Mail/News panes that are displayed using an outliner.
  20.    Created: Chris Toshok <toshok@netscape.com>, 25-Aug-96.
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_mnlistview_h
  26. #define _xfe_mnlistview_h
  27.  
  28. #include "MNView.h"
  29. #include "Command.h"
  30. #include "msgcom.h"
  31. #include "Outlinable.h"
  32.  
  33. /* This class implements one of the methods of XFE_Outlinable,
  34.    getOutliner().  It leaves all the others abstract. */
  35. class XFE_MNListView : public XFE_MNView, public XFE_Outlinable
  36. {
  37. public:
  38.   XFE_MNListView(XFE_Component *toplevel_component, XFE_View *parent_view, MWContext *context, MSG_Pane *p);
  39.   virtual ~XFE_MNListView();
  40.  
  41.   static const char *changeFocus;
  42.  
  43.   // We're nice to our subclasses :)
  44.   virtual Boolean handlesCommand(CommandType cmd, void *calldata = NULL,
  45.                                    XFE_CommandInfo* i = NULL);
  46.   virtual Boolean isCommandEnabled(CommandType cmd, void *calldata = NULL,
  47.                                    XFE_CommandInfo* i = NULL);
  48.   virtual Boolean isCommandSelected(CommandType cmd, void *calldata = NULL,
  49.                                    XFE_CommandInfo* i = NULL);
  50.   virtual void doCommand(CommandType cmd, void *calldata = NULL,
  51.                                    XFE_CommandInfo* i = NULL);
  52.   virtual char *commandToString(CommandType cmd, void *calldata = NULL,
  53.                                    XFE_CommandInfo* i = NULL);
  54.   
  55.   // The Outlinable interface.
  56.   virtual void *ConvFromIndex(int index) = 0;
  57.   virtual int ConvToIndex(void *item) = 0;
  58.   virtual char *getColumnName(int column) = 0;
  59.   virtual char *getColumnHeaderText(int column) = 0;
  60.   virtual fe_icon *getColumnHeaderIcon(int column) = 0;
  61.   virtual EOutlinerTextStyle getColumnHeaderStyle(int column) = 0;
  62.   virtual void *acquireLineData(int line) = 0;
  63.   virtual void getTreeInfo(XP_Bool *expandable, XP_Bool *is_expanded, int *depth, 
  64.                OutlinerAncestorInfo **ancestor) = 0;
  65.   virtual EOutlinerTextStyle getColumnStyle(int column) = 0;
  66.   virtual char *getColumnText(int column) = 0;
  67.   virtual fe_icon *getColumnIcon(int column) = 0;
  68.  
  69.   virtual void Buttonfunc(const OutlineButtonFuncData *data) = 0;
  70.   virtual void Flippyfunc(const OutlineFlippyFuncData *data) = 0;
  71.  
  72.   virtual void releaseLineData() = 0;
  73.  
  74.   // we implement this one for all subclasses.
  75.   virtual XFE_Outliner *getOutliner();
  76.   // Get tooltipString & docString; 
  77.   // returned string shall be freed by the callee
  78.   // row < 0 indicates heading row; otherwise it is a content row
  79.   // (starting from 0)
  80.   //
  81.   virtual char *getCellTipString(int /* row */, int /* column */) {return NULL;}
  82.   virtual char *getCellDocString(int /* row */, int /* column */) {return NULL;}
  83.  
  84.   void setInFocus(XP_Bool infocus);
  85.   XP_Bool isFocus();
  86.  
  87. protected:
  88.  
  89.   XFE_Outliner *m_outliner;
  90. };
  91.  
  92.  
  93. #endif /* _xfe_mnview_h */
  94.  
  95.