home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / AttachmentMenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  79 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.    AttachmentMenu.h -- class for doing the dynamic attachment menus.
  20.    Created: Chris Toshok <toshok@netscape.com>, 3-Jan-1997.
  21.  */
  22.  
  23.  
  24.  
  25. #include "NotificationCenter.h"
  26. #include "Frame.h"
  27.  
  28. #ifndef _xfe_attachmentmenu_h
  29. #define _xfe_attachmentmenu_h
  30.  
  31. // This class can be used with a DYNA_CASCADEBUTTON or
  32. // DYNA_MENUITEMS.
  33.  
  34. class XFE_AttachmentMenu : public XFE_NotificationCenter
  35. {
  36. public:
  37.   virtual ~XFE_AttachmentMenu();
  38.  
  39.   // this function occupies the generateCallback slot in a menuspec.
  40.   static void generate(Widget, void *, XFE_Frame *);
  41.  
  42.   XFE_CALLBACK_DECL(attachmentsHaveChanged)
  43. private:
  44.   XFE_AttachmentMenu(Widget, XFE_Frame *);
  45.  
  46.   // the toplevel component -- the thing we dispatch our events to.
  47.   XFE_Frame *m_parentFrame;
  48.  
  49.   // the cascade button we're tied to.
  50.   Widget m_cascade;
  51.  
  52.   // the row column we're in.
  53.   Widget m_submenu;
  54.  
  55.   const MSG_AttachmentData *m_attachmentData;
  56.  
  57.   // this is the first slot we are using the code assumes that the 
  58.   // dynamic portion of the menu is at the end, so we can destroy from
  59.   // this index down.
  60.   int m_firstslot;
  61.  
  62.   // this function is substituted as the cascadingCallback once the
  63.   // object has been created, and is used from then on.
  64.   static void update_cb(Widget, XtPointer, XtPointer);
  65.  
  66.   // callback added in generate() that destroys this object when the cascade button
  67.   // is destroyed.
  68.   static void destroy_cb(Widget, XtPointer, XtPointer);
  69.  
  70.   static void activate_cb(Widget, XtPointer, XtPointer);
  71.  
  72.   void add_attachment_menu_items(Widget);
  73.  
  74.   // non-callback versions of the update callback
  75.   void update();
  76. };
  77.  
  78. #endif /* _xfe_attachmentmenu_h */
  79.