home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / central / CBookmarksAttachment.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  72 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. //    Handle creating and maintaining the top-level bookmarks menu. It pulls the info
  20. //    out of the RDF container the user designates as their "quickfile menu" and listens
  21. //    to the messages from RDF to update it.
  22.  
  23. #pragma once
  24.  
  25. #ifndef CBOOKMARKSATTACHMENT_H_
  26. #define CBOOKMARKSATTACHMENT_H_
  27.  
  28. #include "CRDFNotificationHandler.h"
  29.  
  30. #include "PascalString.h"
  31. #include <LAttachment.h>
  32. #include <LMenu.h>
  33. #include <LArray.h>
  34.  
  35. /***********************************************************************************
  36.  * CBookmarksAttachment
  37.  * Processes bookmark menu commands -- should be attached to application
  38.  ***********************************************************************************/
  39. class CBookmarksAttachment: public LAttachment, public CRDFNotificationHandler
  40. {
  41. public:
  42.     // ÑÑ constructors
  43.                         CBookmarksAttachment();
  44.     // ÑÑ╩events
  45.     virtual void        ExecuteSelf( MessageT inMessage, void* ioParam );
  46.  
  47. //    static void            AddToBookmarks( BM_Entry* newBookmark );
  48.     static void            AddToBookmarks( const char* url, const CStr255& title );
  49.  
  50.     static LMenu*        GetMenu();
  51.     static void            InvalidateMenu() { sInvalidMenu = true; }
  52.     static void            UpdateMenu();
  53.  
  54.     static void            RemoveMenus();
  55.     static void            InstallMenus();
  56.     
  57.     void                InitQuickfileView ( ) ;
  58.  
  59. protected:
  60.     static void            FillMenuFromList( HT_Resource top, LMenu* newMenu, int& nextMenuID, int whichItem );
  61.  
  62.     virtual    void        HandleNotification( HT_Notification    notifyStruct, HT_Resource node, HT_Event event);
  63.  
  64.     static LMenu*        sMenu;
  65.     static Boolean        sInvalidMenu;
  66.     static LArray        sMenusList;
  67.     static HT_View        sQuickfileView;        // called quickfile because of HT API
  68.  
  69. };
  70.  
  71. #endif
  72.