home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / FolderDropdown.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  85 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.    FolderDropdown.h --- a combo box for selecting folders/newsgroups
  20.    Created: Chris Toshok <toshok@netscape.com>, 6-Mar-97
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_folderdropdown_h
  26. #define _xfe_folderdropdown_h
  27.  
  28. #include "Component.h"
  29. #include "MNView.h"
  30. #include "DtWidgets/ComboBox.h"
  31.  
  32. class XFE_FolderDropdown : public XFE_Component
  33. {
  34. public:
  35.     XFE_FolderDropdown(XFE_Component *toplevel_component,
  36.                        Widget parent,
  37.                        XP_Bool allowServerSelection = TRUE,
  38.                        XP_Bool showNewsgroups = TRUE,
  39.                        XP_Bool boldWithNew = FALSE);
  40.  
  41.     virtual ~XFE_FolderDropdown();
  42.  
  43.     MSG_FolderInfo *getSelectedFolder();
  44.     void selectFolder(MSG_FolderInfo *, Boolean notify = False);
  45.     void selectFolder(char *name);
  46.     void setPopupServer(XP_Bool p);
  47.  
  48.     void resyncDropdown();
  49.  
  50.     static const char *folderSelected;
  51.  
  52. protected:
  53. private:
  54.     XmString makeListItemFromLine(MSG_FolderLine* line);
  55.  
  56.     void buildList(MSG_FolderInfo *info, int *position);
  57.  
  58.     void syncFolderList();
  59.     void syncCombo();
  60.  
  61.     static void folderSelect_cb(Widget, XtPointer, XtPointer);
  62.     static void folderMenuPost_cb(Widget, XtPointer, XtPointer);
  63.     
  64.     XFE_CALLBACK_DECL(rebuildFolderDropdown)
  65.     XFE_CALLBACK_DECL(boldFolderInfo)
  66.  
  67.     void folderMenuPost();
  68.     void folderSelect(int row);
  69.  
  70.     XP_Bool m_foldersHaveChanged;
  71.     XP_Bool m_allowServerSelection;
  72.     XP_Bool m_popupServer;
  73.     XP_Bool m_showNewsgroups;
  74.     XP_Bool m_boldWithNew;
  75.  
  76.     int m_lastSelectedPosition;
  77.  
  78.     int m_numinfos;
  79.     MSG_FolderInfo **m_infos;
  80.  
  81.     int m_numNewsHosts;
  82. };
  83.  
  84. #endif /* _xfe_folderdropdown_h */
  85.