home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / BackForwardMenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.9 KB  |  100 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. /* Name:        BackForwardMenu.h                                        */
  21. /* Description:    XFE_BackForwardMenu component header file.                */
  22. /*                These are the menu items that appear at the end of the    */
  23. /*                                                                        */
  24. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  25.  
  26.  
  27. /* Date:        Sun Mar  2 01:34:13 PST 1997                            */
  28. /*                                                                        */
  29. /*----------------------------------------------------------------------*/
  30.  
  31. #include "structs.h"
  32. #include "xp_core.h"
  33. #include "ntypes.h"
  34. #include <Xm/Xm.h>
  35.  
  36. #ifndef _xfe_back_forward_menu_h_
  37. #define _xfe_back_forward_menu_h_
  38.  
  39.  
  40. class XFE_Frame;
  41.  
  42. // This class can be used with a DYNA_CASCADEBUTTON or DYNA_MENUITEMS.
  43. class XFE_BackForwardMenu
  44. {
  45. public:
  46.  
  47.     virtual ~XFE_BackForwardMenu();
  48.  
  49.     // this function occupies the generateCallback slot in a menuspec.
  50.     static void generate(Widget            cascade,
  51.                          XtPointer        data,
  52.                          XFE_Frame *    frame);
  53.  
  54. private:
  55.     
  56.     XFE_BackForwardMenu(XFE_Frame *    frame,
  57.                         Widget        cascade,
  58.                         int            forward);
  59.  
  60.     // the toplevel component -- the thing we dispatch our events to.
  61.     XFE_Frame *        _frame;
  62.  
  63.     // the cascade button we're tied to.
  64.     Widget            _cascade;
  65.  
  66.     // the row column we're in.
  67.     Widget            _submenu;
  68.     
  69.     // True = Forward, False = Backward
  70.     XP_Bool            _forward;
  71.     
  72.     // Cascade callbacks
  73.     static void cascadingCB            (Widget, XtPointer, XtPointer);
  74.     static void cascadeDestroyCB    (Widget, XtPointer, XtPointer);
  75.  
  76.     // Menu item callbacks
  77.     static void itemActivateCB        (Widget, XtPointer, XtPointer);
  78.     static void itemArmCB            (Widget, XtPointer, XtPointer);
  79.     static void itemDisarmCB        (Widget, XtPointer, XtPointer);
  80.     static void itemDestroyCB        (Widget, XtPointer, XtPointer);
  81.  
  82.     void            cascading            ();
  83.  
  84.     void            itemActivate        (History_entry *    entry);
  85.     void            itemArm                (History_entry *    entry);
  86.     void            itemDisarm            ();
  87.  
  88.     void            destroyItems        ();
  89.  
  90.     void            addItems            (XP_List *            list,
  91.                                          XP_Bool            forward);
  92.  
  93.     void            fillSubmenu            (XP_Bool forward);
  94.  
  95.     void            addItem                (int                position,
  96.                                          History_entry *    entry);
  97. };
  98.  
  99. #endif /* _xfe_back_forward_menu_h_ */
  100.