home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / SubTabView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.6 KB  |  112 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.    SubTabView.h -- 4.x subscribe ui tabs.
  20.    Created: Chris Toshok <toshok@netscape.com>, 18-Oct-1996.
  21.    */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_subtabview_h
  26. #define _xfe_subtabview_h
  27.  
  28. #include "MNListView.h"
  29. #include "Outlinable.h"
  30. #include "Command.h"
  31.  
  32. class XFE_SubTabView : public XFE_MNListView
  33. {
  34. public:
  35.     XFE_SubTabView(XFE_Component *toplevel_component, Widget parent,
  36.                    XFE_View *parent_view, MWContext *context,
  37.                    int tab_string_id, MSG_Pane *p = NULL);
  38.     virtual ~XFE_SubTabView();
  39.  
  40.     virtual Boolean isCommandEnabled(CommandType command, void *cd = NULL,
  41.                                    XFE_CommandInfo* i = NULL);
  42.     virtual Boolean handlesCommand(CommandType command, void *calldata = NULL,
  43.                                    XFE_CommandInfo* i = NULL);
  44.     virtual void doCommand(CommandType command, void *calldata = NULL,
  45.                                    XFE_CommandInfo* i = NULL);
  46.  
  47.     /* Outlinable interface methods */
  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 getColumnHeaderStyle(int column);
  56.     virtual void *acquireLineData(int line);
  57.     virtual void getTreeInfo(XP_Bool *expandable, XP_Bool *is_expanded, int *depth,
  58.                              OutlinerAncestorInfo **ancestor);
  59.     virtual EOutlinerTextStyle getColumnStyle(int column);
  60.     virtual char *getColumnText(int column);
  61.     virtual fe_icon *getColumnIcon(int column);
  62.     virtual void releaseLineData();
  63.  
  64.     virtual void Buttonfunc(const OutlineButtonFuncData *data);
  65.     virtual void Flippyfunc(const OutlineFlippyFuncData *data);
  66.  
  67.     virtual void updateButtons();
  68.  
  69.     virtual int getButtonsMaxWidth();
  70.     virtual void setButtonsWidth(int width);
  71.  
  72.     // these gets called whenever a tab is activated
  73.     void syncServerCombo(); 
  74.     virtual void defaultFocus(); /* override this to set the focus of something when the user
  75.                                     clicks on this tab. */
  76.     // this gets called when the server list needs to be updated.
  77.     static void syncServerList();
  78.  
  79. protected:
  80.     Widget m_form; // the form that makes up the body of the tab.
  81.     Widget m_serverCombo; // the combobox that lists the servers.
  82.  
  83.     static const int OUTLINER_COLUMN_NAME;
  84.     static const int OUTLINER_COLUMN_SUBSCRIBE;
  85.     static const int OUTLINER_COLUMN_POSTINGS;
  86.  
  87.     void init_outliner_icons(Widget outliner);
  88.  
  89.     void initializeServerCombo(Widget parent);
  90.   
  91.     virtual void serverSelected();
  92.  
  93.     void server_select(int pos);
  94.     static void server_select_cb(Widget, XtPointer, XtPointer);
  95.  
  96.     static void button_callback(Widget, XtPointer, XtPointer);
  97.  
  98.     // icons for the outliner.
  99.     static fe_icon subscribedIcon;
  100.  
  101. private:
  102.     // for the server combo box stuff
  103.     static int m_numhosts;
  104.     static MSG_Host **m_hosts;
  105.  
  106.     // for the outlinable stuff
  107.     OutlinerAncestorInfo *m_ancestorInfo;
  108.     MSG_GroupNameLine m_groupLine;
  109. };
  110.  
  111. #endif /* _xfe_subtabview_h */
  112.