home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / URLBar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.5 KB  |  131 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.    URLBar.h -- The text field chrome above an HTMLView, used in
  20.                BrowserFrames.
  21.    Created: Chris Toshok <toshok@netscape.com>, 1-Nov-96.
  22.    */
  23.  
  24.  
  25. #ifndef _xfe_urlbar_h
  26. #define _xfe_urlbar_h
  27.  
  28. #include "structs.h"
  29. #include "icons.h"
  30. #include "LocationDrag.h"
  31. #include "ToolbarDrop.h"
  32. #include "Button.h"
  33. #include "ToolboxItem.h"
  34.  
  35. #define URLBAR_POPUP
  36. #ifdef URLBAR_POPUP
  37. #include "PopupMenu.h"
  38. #endif
  39.  
  40. class XFE_Logo;
  41.  
  42. class XFE_URLBar : public XFE_ToolboxItem
  43. {
  44. public:
  45.  
  46.     XFE_URLBar(XFE_Frame *        parent_frame,
  47.                XFE_Toolbox *    parent_toolbox,
  48.                History_entry *    first_entry = NULL);
  49.     
  50.     virtual ~XFE_URLBar();
  51.  
  52.     
  53.     void recordURL(URL_Struct *url);  // add the url to the drop down.
  54.     void setURLString(URL_Struct *url); // set the text's value to the url.
  55.     
  56.     static const char *navigateToURL;  // callback invoked when the user 
  57.     // selects (or types) a new url
  58.     
  59.     Widget        getBookMarkButton    ();
  60.     Widget        getProxyIcon        ();
  61.     Widget        getUrlLabel            ();
  62.     Widget        getFormWidget        ();
  63.  
  64.     // Quickfile menu spec
  65.     static MenuSpec quickfile_menu_spec[];
  66.  
  67. protected:
  68.  
  69.     virtual void        update() {}
  70.  
  71. private:
  72.  
  73.     XmString            m_editedLabelString;
  74.     XmString            m_uneditedLabelString;
  75.     XmString            m_netsiteLabelString;
  76.     
  77.     XFE_Frame *            m_parentFrame;
  78.  
  79.     XFE_Button  *        m_bookmarkButton;
  80.     XFE_Button  *        m_locationProxyIcon;
  81.     Widget                m_locationLabel;
  82.     Widget                m_urlComboBox;
  83.  
  84.     XP_Bool                m_labelBeingFrobbed;
  85.  
  86.     XFE_LocationDrag *    m_proxyIconDragSite;
  87.     XFE_QuickfileDrop *    m_bookmarkDropSite;
  88.  
  89. #ifdef URLBAR_POPUP
  90.     XFE_PopupMenu *m_popup;
  91.     static MenuSpec ccp_popup_spec[];
  92.  
  93.     void doPopup(XEvent *event);
  94.  
  95.     // Callbacks and event handlers
  96.     static void comboBoxButtonPressEH (Widget,XtPointer,XEvent *,Boolean *);
  97. #endif
  98.  
  99.     XP_Bool readUserHistory();
  100.     XP_Bool saveUserHistory();
  101.     
  102.     void frob_label(XP_Bool edited_p, XP_Bool netsite_p);
  103.     
  104.     void url_text(XtPointer);
  105.     static void url_text_cb(Widget, XtPointer, XtPointer);
  106.     
  107.     void url_text_modify();
  108.     static void url_text_modify_cb(Widget, XtPointer, XtPointer);
  109.     
  110.     void url_text_selection(XtPointer);
  111.     static void url_text_selection_cb(Widget, XtPointer, XtPointer);
  112.  
  113.     static void source_drop_func(fe_dnd_Source *src, fe_dnd_Message msg, void *closure);
  114.     
  115.     void        createBookmarkButton        (Widget);
  116.     void        createProxyIcon                (Widget);
  117.     void        createUrlComboBox            (Widget,History_entry *);
  118.  
  119.     // URL label resource tricks
  120.     static XtResource        _urlLabelResources[];
  121.  
  122.     // Tear off support for the bookmark cascade
  123.     static void    bookmarkCascadeTearCB        (Widget, XtPointer, XtPointer);
  124.     void        handleBookmarkCascadeTear    (XP_Bool torn);
  125.  
  126.     static void    frameTitleChangedCB            (Widget, XtPointer, XtPointer);
  127.     void        handleFrameTitleChanged        (String title);
  128. };
  129.  
  130. #endif /* _xfe_urlbar_h */
  131.