home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / EditRecentMenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  90 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.  
  20. #include "structs.h"
  21. #include "xp_core.h"
  22. #include "ntypes.h"
  23. #include <Xm/Xm.h>
  24.  
  25. #ifndef _xfe_edit_recent_menu_h_
  26. #define _xfe_edit_recent_menu_h_
  27.  
  28.  
  29. class XFE_Frame;
  30.  
  31. // This class can be used with a DYNA_CASCADEBUTTON or DYNA_MENUITEMS.
  32. class XFE_EditRecentMenu
  33. {
  34. public:
  35.  
  36.     virtual ~XFE_EditRecentMenu();
  37.  
  38.     // this function occupies the generateCallback slot in a menuspec.
  39.     static void generate(Widget            cascade,
  40.                          XtPointer        data,
  41.                          XFE_Frame *    frame);
  42.  
  43. private:
  44.     
  45.     XFE_EditRecentMenu(XFE_Frame *    frame,
  46.                        Widget        cascade,
  47.                        XP_Bool    openPage);
  48.  
  49.     // the toplevel component -- the thing we dispatch our events to.
  50.     XFE_Frame *        _frame;
  51.  
  52.     // the cascade button we're tied to.
  53.     Widget            _cascade;
  54.  
  55.     // the row column we're in.
  56.     Widget            _submenu;
  57.  
  58.     // do we need an "Open Page..." menu item at the top of the submenu?...
  59.     XP_Bool            _openPage;
  60.  
  61.     // the number of menu items in the current submenu...
  62.     int32            _itemCount;
  63.     
  64.     // Cascade callbacks
  65.     static void cascadingCB            (Widget, XtPointer, XtPointer);
  66.     static void cascadeDestroyCB    (Widget, XtPointer, XtPointer);
  67.  
  68.     // Menu item callbacks
  69.     static void itemActivateCB        (Widget, XtPointer, XtPointer);
  70.     static void itemArmCB            (Widget, XtPointer, XtPointer);
  71.     static void itemDisarmCB        (Widget, XtPointer, XtPointer);
  72.     static void itemDestroyCB        (Widget, XtPointer, XtPointer);
  73.  
  74.     void            cascading            ();
  75.  
  76.     void            itemActivate        (char*    pUrl);
  77.     void            itemArm                (char*    pUrl);
  78.     void            itemDisarm            ();
  79.  
  80.     void            destroyItems        ();
  81.  
  82.     void            fillSubmenu            ();
  83.  
  84.     void            addItem                (int    position,
  85.                                          char*  name,
  86.                                          char*    pUrl);
  87. };
  88.  
  89. #endif /* _xfe_edit_recent_menu_h_ */
  90.