home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / ABMListView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.4 KB  |  149 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.    ABSearchDlg.h -- class definition for XFE_ABSearchDlg
  20.    Created: Tao Cheng <tao@netscape.com>, 11-nov-96
  21.  */
  22.  
  23. #ifndef _ABMLISTVIEW_H_
  24. #define _ABMLISTVIEW_H_
  25.  
  26. #include "MNView.h"
  27. #include "Outliner.h"
  28. #include "Outlinable.h"
  29.  
  30. #include "addrbook.h"
  31.  
  32. class XFE_AddrBookView;
  33.  
  34. class XFE_ABMListView  : public XFE_MNView, public XFE_Outlinable 
  35. {
  36. public:
  37.   XFE_ABMListView(XFE_Component *toplevel_component, 
  38.           Widget         parent,
  39.           DIR_Server    *dir, 
  40.           ABook         *pABook,
  41.           XFE_View        *parent_view,
  42.           MWContext     *context,
  43.           MSG_Master*    master);
  44.   ~XFE_ABMListView();
  45.  
  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();
  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_TYPE = 0,
  87.     OUTLINER_COLUMN_NAME,
  88.     OUTLINER_COLUMN_NICKNAME,
  89.     OUTLINER_COLUMN_EMAIL,
  90.     OUTLINER_COLUMN_COMPANY,
  91.     OUTLINER_COLUMN_LOCALITY,
  92.     OUTLINER_COLUMN_LAST
  93.   };
  94.  
  95.   MLPane* getMListPane() { return m_mListPane;}
  96.  
  97.   /* return listID
  98.    */
  99.   ABID setValues(ABID m_listID);
  100.   void remove();
  101.   int  apply(char *pNickName, char *pFullName, char *pInfo);
  102.  
  103.   // icons for the outliner
  104.   static fe_icon m_personIcon;
  105.   static fe_icon m_listIcon;
  106.   static void entryTTYActivateCallback(Widget, XtPointer, XtPointer);
  107.   static void entryTTYValChgCallback(Widget, XtPointer, XtPointer);
  108.  
  109.   //
  110.   void tableTraverse(Widget w,
  111.                      XEvent *event,
  112.                      String *params,
  113.                      Cardinal *nparam);
  114.  
  115. protected:
  116.  
  117.   XFE_Outliner *m_outliner;
  118.  
  119.   //
  120.   MSG_Master   *m_master;
  121.   XP_List      *m_directories;
  122.   DIR_Server   *m_dir;
  123.   MLPane       *m_mListPane;
  124.   ABook        *m_AddrBook; 
  125.   ABPane       *m_abPane;
  126.   ABID          m_listID;
  127.   ABID          m_entryID; /* entryID for current line */
  128.   ABID          m_memberID;
  129.  
  130.   virtual void entryTTYValChgCB(Widget, XtPointer);
  131.   virtual void entryTTYActivateCB(Widget, XtPointer);
  132.  
  133.   // internal drop callback for addressbook drops
  134.   static void AddressDropCb(Widget,void*,fe_dnd_Event,fe_dnd_Source*,XEvent*);
  135.   void addressDropCb(fe_dnd_Source*);
  136.   void processAddressBookDrop(XFE_Outliner*,DIR_Server *abDir,ABook *abBook,
  137.                               AddressPane*);
  138.  
  139. private:
  140.   char          m_preStr[128];
  141.   uint32        m_count; 
  142.  
  143.   Widget        m_textF;
  144.  
  145.   void doBackSpace(XEvent *event);
  146. };
  147.  
  148. #endif /*  _ABMLISTVIEW_H_ */
  149.