home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / EditHdrDialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  81 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.   EditHdrDialog.h -- add or remove arbitrary mail headers.
  20.   Created: Akkana Peck <akkana@netscape.com>, 19-Nov-97.
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_edithdrdialog_h
  26. #define _xfe_edithdrdialog_h
  27.  
  28. #include "xp_core.h"
  29. #include "ntypes.h"
  30.  
  31. #include "Dialog.h"
  32.  
  33. class XFE_Frame;
  34.  
  35. /* changes the delete response to UNMAP so we can keep the
  36.    dialog around after it's popped down, and returns True
  37.    if Ok was pressed, and False otherwise (either cancel or
  38.    the WM close button was pressed. 
  39.  
  40.    This method calls fe_eventLoop so we can return with the
  41.    user's response from here. 
  42.  
  43.    Since we UNMAP instead of DESTROY, you need to delete the
  44.    instance after you're through with it.
  45.   */
  46. class XFE_EditHdrDialog: public XFE_Dialog
  47. {
  48. public:
  49.     XFE_EditHdrDialog(Widget parent, char* name, MWContext* context);
  50.  
  51.     virtual ~XFE_EditHdrDialog();
  52.  
  53.     // returns the header that was selected, or NULL for CANCEL.
  54.     // The string returned from this routine should be freed with XtFree();
  55.     char* post();
  56.   
  57. private:
  58.     MWContext* m_contextData;
  59.  
  60.     XP_Bool m_doneWithLoop;
  61.     XP_Bool m_retVal;
  62.  
  63.     Widget m_list;
  64.     Widget m_editButton;
  65.     Widget m_deleteButton;
  66.  
  67.     char* promptHeader(char*);
  68.  
  69.     void ok();
  70.     void cancel();
  71.     void button(Widget);
  72.     void selection(XmListCallbackStruct*);
  73.  
  74.     static void ok_cb(Widget, XtPointer, XtPointer);
  75.     static void cancel_cb(Widget, XtPointer, XtPointer);
  76.     static void butn_cb(Widget, XtPointer, XtPointer);
  77.     static void select_cb(Widget, XtPointer, XtPointer);
  78. };
  79.  
  80. #endif /* _xfe_edithdrdialog_h */
  81.