home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / PersonalToolbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  109 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:        PersonalToolbar.h                                        */
  21. /* Description:    XFE_PersonalToolbar component header file.                */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27.  
  28. #ifndef _xfe_persoanl_toolbar_h_
  29. #define _xfe_persoanl_toolbar_h_
  30.  
  31. #include "Component.h"
  32. #include "BookmarkBase.h"
  33. #include "ToolboxItem.h"
  34.  
  35. class XFE_PersonalDrop;
  36. class XFE_Logo;
  37. class XFE_PopupMenu;
  38.  
  39. class XFE_PersonalToolbar : public XFE_ToolboxItem,
  40.                             public XFE_BookmarkBase
  41. {
  42. public:  
  43.     
  44.     XFE_PersonalToolbar        (MWContext *    bookmarkContext,
  45.                              XFE_Toolbox *    parent_toolbox,
  46.                              const char *    name,
  47.                              XFE_Frame *    frame);
  48.  
  49.     virtual ~XFE_PersonalToolbar();
  50.  
  51.     // Access methods
  52.     Widget            getToolBarWidget    ();
  53.  
  54.     void            setRaised            (XP_Bool);
  55.  
  56.     void            addEntry                (const char *    address,
  57.                                              const char *    title,
  58.                                              BM_Date        lastAccess);
  59.  
  60.     static void            setToolbarFolder        (BM_Entry *        entry,
  61.                                                  XP_Bool        notify);
  62.  
  63.     static BM_Entry *    getToolbarFolder        ();
  64.  
  65.     static char *        getToolbarFolderName    ();
  66.  
  67.     static XP_Bool        hasToolbarFolder        ();
  68.  
  69. protected:
  70.  
  71.     // Override AbstractToolbar methods
  72.     virtual void    update() {}
  73.  
  74.     // Override BookmarkBase methods
  75.     virtual void    configureXfeButton        (Widget,BM_Entry *);
  76.     virtual void    configureXfeCascade        (Widget,BM_Entry *);
  77.     virtual void    prepareToUpdateRoot        ();
  78.     virtual void    reallyUpdateRoot        ();
  79.     virtual void    updateAppearance        ();
  80.     virtual void    updateToolbarFolderName    ();
  81.  
  82. private:
  83.  
  84.     Widget                m_toolBar;            // The toolbar 
  85.     XFE_PersonalDrop *  m_dropSite;            // The proxy icon drop site
  86.     BM_Entry *            m_toolBarFolder;    // The toolbar folder
  87.  
  88.     void            destroyToolbarWidgets            ();
  89.  
  90.     void            addDefaultToolbarFolder            ();
  91.  
  92.     void            addDefaultPersonalEntries        (char *        configString,
  93.                                                      BM_Entry *    header);
  94.  
  95.     XP_Bool            isToolbarFolderValid            ();
  96.  
  97.     //
  98.     // Popup menu stuff
  99.     //
  100.     XFE_PopupMenu *            m_popup;            // The popup menu
  101.     static MenuSpec            m_popupMenuSpec[];    // The popup menu spec
  102.  
  103.     static void                popupCB    (Widget,XtPointer,XtPointer);
  104.     
  105.     void handlePopup        (Widget,XEvent *);
  106. };
  107.  
  108. #endif /* _xfe_persoanl_toolbar_h_ */
  109.