home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / FolderMenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.7 KB  |  88 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.    FolderMenu.h -- class for doing the dynamic bookmark menus
  20.    Created: Chris Toshok <toshok@netscape.com>, 21-Dec-1996.
  21.  */
  22.  
  23.  
  24.  
  25. #include "NotificationCenter.h"
  26. #include "Frame.h"
  27.  
  28. #ifndef _xfe_foldermenu_h
  29. #define _xfe_foldermenu_h
  30.  
  31. // This class can be used with a DYNA_CASCADEBUTTON or
  32. // DYNA_MENUITEMS.
  33.  
  34. class XFE_FolderMenu : public XFE_NotificationCenter
  35. {
  36. public:
  37.   virtual ~XFE_FolderMenu();
  38.  
  39.   // this function occupies the generateCallback slot in a menuspec.
  40.   static void generate(Widget, void *, XFE_Frame *);
  41.  
  42.   XFE_CALLBACK_DECL(foldersHaveChanged)
  43. private:
  44.   XFE_FolderMenu(CommandType cmd, 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.   // the command we do on activate.. either move or copy.
  56.   CommandType m_cmd;
  57.  
  58.   // this is the first slot we are using the code assumes that the 
  59.   // dynamic portion of the menu is at the end, so we can destroy from
  60.   // this index down.
  61.   int m_firstslot;
  62.  
  63.   // this function is substituted as the cascadingCallback once the
  64.   // object has been created, and is used from then on.
  65.   static void update_cb(Widget, XtPointer, XtPointer);
  66.  
  67.   // callback added in generate() that destroys this object when the cascade button
  68.   // is destroyed.
  69.   static void destroy_cb(Widget, XtPointer, XtPointer);
  70.  
  71.   static void free_cons_cb(Widget, XtPointer, XtPointer);
  72.  
  73.   static void activate_cb(Widget, XtPointer, XtPointer);
  74.  
  75.   static void fillin_menu(Widget, XtPointer, XtPointer);
  76.   void add_folder_menu_items(Widget, MSG_FolderInfo *, XP_Bool);
  77.  
  78.   // non-callback versions of the update callback
  79.   void update();
  80.  
  81.   // Stuff for "More..." support for insanely long menus
  82.   Widget getLastMoreMenu(Widget menu);
  83.   Widget createMoreButton(Widget menu);
  84.  
  85. };
  86.  
  87. #endif /* _xfe_foldermenu_h */
  88.