home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / ABAddresseeView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.6 KB  |  126 lines

  1. /* -*- Mode: C++; tab-width: 8; 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.    ABAddresseeView.h -- class definition for XFE_ABAddressingDlg
  20.    Created: Tao Cheng <tao@netscape.com>, 20-nov-96
  21.  */
  22.  
  23. #ifndef _ABADDRESSEEVIEW_H_
  24. #define _ABADDRESSEEVIEW_H_
  25.  
  26. #include "View.h"
  27. #include "Outliner.h"
  28. #include "Outlinable.h"
  29.  
  30. #include "addrbk.h"
  31.  
  32. class XFE_AddresseeView: public XFE_View, public XFE_Outlinable
  33. {
  34.  
  35. public:
  36.  
  37.   XFE_AddresseeView(XFE_Component *toplevel_component, 
  38.             Widget         parent,
  39.             XFE_View      *parent_view, 
  40.             MWContext     *context);
  41.   ~XFE_AddresseeView();
  42.  
  43.   // callbacks
  44.   static void removeCallback(Widget, XtPointer, XtPointer);
  45.   static void selectCallback(Widget, XtPointer, XtPointer);
  46.  
  47.  // The Outlinable interface.
  48.   virtual void    *ConvFromIndex(int index);
  49.   virtual int      ConvToIndex(void *item);
  50.   //
  51.   virtual char    *getColumnName(int column);
  52.   //
  53.   virtual char    *getColumnHeaderText(int column);
  54.   virtual fe_icon *getColumnHeaderIcon(int column);
  55.   virtual EOutlinerTextStyle 
  56.                    getColumnHeaderStyle(int column);
  57.   virtual EOutlinerTextStyle 
  58.                    getColumnStyle(int column);
  59.   virtual char    *getColumnText(int column);
  60.   virtual fe_icon *getColumnIcon(int column);
  61.   //
  62.   virtual void     getTreeInfo(XP_Bool *expandable, 
  63.                    XP_Bool *is_expanded, 
  64.                    int *depth, 
  65.                    OutlinerAncestorInfo **ancestor);
  66.   //
  67.   virtual void     Buttonfunc(const OutlineButtonFuncData *data);
  68.   virtual void     Flippyfunc(const OutlineFlippyFuncData *data);
  69.   //
  70.   virtual void     releaseLineData();
  71.   //
  72.   // we implement this one for all subclasses.
  73.   //
  74.   virtual void         *acquireLineData(int line);
  75.   virtual XFE_Outliner *getOutliner() { return m_outliner;}
  76.  
  77.   // Get tooltipString & docString; 
  78.   // returned string shall be freed by the callee
  79.   // row < 0 indicates heading row; otherwise it is a content row
  80.   // (starting from 0)
  81.   //
  82.   virtual char *getCellTipString(int /* row */, int /* column */);
  83.   virtual char *getCellDocString(int /* row */, int /* column */);
  84.  
  85.   // columns for the Outliner
  86.   enum {OUTLINER_COLUMN_STATUS = 0,
  87.     OUTLINER_COLUMN_NAME,
  88.     OUTLINER_COLUMN_LAST
  89.   };
  90.  
  91.   //
  92.   void addEntry(StatusID_t* pair);
  93.   StatusID_t** getPairs(int& count) { 
  94.     count = m_numPairs; return m_pairs; }
  95.  
  96.   int getNEntries() { return m_numPairs;}
  97.  
  98.   void setOKBtn(Widget w);
  99.  
  100.   // icons for the outliner
  101.   static fe_icon m_personIcon;
  102.   static fe_icon m_listIcon;
  103.  
  104. protected:
  105.  
  106.   XFE_CALLBACK_DECL(updateCommands)
  107.   Widget        m_okBtn;
  108.  
  109.   // callbacks
  110.   virtual void removeCB(Widget w, XtPointer callData);
  111.   virtual void selectCB(Widget w, XtPointer callData);
  112.  
  113.   //
  114.   XFE_Outliner *m_outliner;
  115.  
  116. private:
  117.   //
  118.   Widget        m_removeBtn;
  119.  
  120.   StatusID_t   *m_pair;  
  121.   StatusID_t  **m_pairs;
  122.   int           m_numPairs;
  123. };
  124.  
  125. #endif /* _ABADDRESSEEVIEW_H_ */
  126.