home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / Dashboard.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.9 KB  |  179 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.    Dashboard.h -- The chrome along the bottom of a frame.
  20.    Created: Chris Toshok <toshok@netscape.com>, 11-Oct-1996
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_dashboard_h
  26. #define _xfe_dashboard_h
  27.  
  28. #include "xp_core.h"
  29. #include "Frame.h"
  30. #include "Component.h"
  31.  
  32. #ifdef MOZ_TASKBAR
  33. class XFE_TaskBar;
  34. class XFE_PopupMenu;
  35. #endif
  36.  
  37.  
  38. class XFE_Dashboard : public XFE_Component 
  39. {
  40. public:
  41.     
  42.     XFE_Dashboard(XFE_Component *    toplevel_component,
  43.                   Widget            parent,
  44.                   XFE_Frame *       frame,
  45.                   XP_Bool            have_taskbar = True);
  46.     
  47.     virtual ~XFE_Dashboard();
  48.  
  49.     // Status methods
  50.     void setStatusText            (const char * text);
  51.  
  52.     // Progress methods
  53.     void setProgressBarText        (const char * text);
  54.     void setProgressBarPercent    (int percent);
  55.  
  56.     void startCylon            ();
  57.     void stopCylon            ();
  58.     void tickCylon            ();
  59.     
  60. #ifdef MOZ_TASKBAR
  61.     // Task Bar dockingness functions
  62.     static void        dockTaskBar                ();
  63.     static void        toggleTaskBar            ();
  64.     static void        unDockTaskBar            ();
  65.     static XP_Bool    isTaskBarDocked            ();
  66.     static XP_Bool    floatingTaskBarIsAlive    ();
  67.     static void        startFloatingTaskBar    (XFE_Frame * parentFrame);
  68.     static void        stopFloatingTaskBar        ();
  69.     static void        showFloatingTaskBar        (XFE_Frame * parentFrame);
  70.  
  71.     // Access floating taskbar
  72.     static XFE_TaskBar *        getFloatingTaskBar    ();
  73.  
  74.     // Access taskbar
  75.     XFE_TaskBar *                getTaskBar            ();
  76.  
  77.     // Update state and prefs
  78.     static void        setFloatingTaskBarPosition        (int32 x,int32 y);
  79.     static void        setFloatingTaskBarHorizontal    (XP_Bool horizpntal);
  80.     static void        setFloatingTaskBarOnTop            (XP_Bool ontop);
  81.  
  82.     // Invoked when the taskbar is docked
  83.     static const char *taskBarDockedCallback;
  84.  
  85.     // Invoked when the taskbar is undocked
  86.     static const char *taskBarUndockedCallback;
  87. #endif
  88.  
  89.     // Security icon methods
  90.     void        setShowSecurityIcon        (XP_Bool state);
  91.     void        setShowSignedIcon        (XP_Bool state);
  92.     void        setShowStatusBar        (XP_Bool state);
  93.     void        setShowProgressBar        (XP_Bool state);
  94.     XP_Bool        isSecurityIconShown        ();
  95.     XP_Bool        isSignedIconShown        ();
  96.  
  97.     XP_Bool        processTraversal        (XmTraversalDirection direction);
  98.  
  99. private:
  100.  
  101.     XFE_Frame   *            m_parentFrame;
  102.  
  103.     Widget                    m_statusBar;
  104.     Widget                    m_progressBar;
  105.     Widget                    m_securityBar;
  106.  
  107.     XFE_Button *            m_securityIcon;
  108.     XFE_Button *            m_signedIcon;
  109.  
  110.     XP_Bool                    m_securityRegistered;
  111.  
  112.  
  113. #ifdef MOZ_TASKBAR
  114.  
  115.     static XFE_PopupMenu *    m_floatingPopup;
  116.     static MenuSpec            m_floatingPopupMenuSpec[];
  117.  
  118.     XFE_TaskBar *            m_dockedTaskBar;
  119.     
  120.     static Widget            m_floatingShell;
  121.     static XFE_TaskBar *    m_floatingTaskBar;
  122.     static XP_Bool            m_floatingDocked;
  123.  
  124.     static time_t            m_floatingLastRaisedTime;
  125.     static int                m_floatingTimesRaisedPerSecond;
  126.  
  127.     // Callbacks and event handlers
  128.  
  129.     static void floatingButtonEH        (Widget,XtPointer,XEvent *,Boolean *);
  130.     static void floatingConfigureEH        (Widget,XtPointer,XEvent *,Boolean *);
  131.     static void floatingMappingCB        (Widget,XtPointer,XtPointer);
  132.     static void floatingActionCB        (Widget,XtPointer,XtPointer);
  133.  
  134.     void            createDockedTaskBar    ();
  135. #endif
  136.  
  137.     void            addSecurityIcon        ();
  138.     void            addSignedIcon        ();
  139.     void            configureSecurityBar();
  140.  
  141.     void            createProgressBar    ();
  142.     void            createStatusBar        ();
  143.     void            createSecurityBar    ();
  144.  
  145.     // callback handler for the commandArmedCallback in XFE_MenuBar.
  146.     // -- command is in calldata
  147.     XFE_CALLBACK_DECL(showCommandStringNotice)
  148.         
  149.     // callback handler for the commandDisarmedCallback in XFE_MenuBar.
  150.     // -- command is in calldata
  151.     XFE_CALLBACK_DECL(eraseCommandStringNotice)
  152.         
  153.     // update the status bar in this frame.
  154.     XFE_CALLBACK_DECL(setStatusTextNotice)
  155.  
  156.     // Start the cylon
  157.     XFE_CALLBACK_DECL(startCylonNotice)
  158.  
  159.     // Stop the cylon
  160.     XFE_CALLBACK_DECL(stopCylonNotice)
  161.  
  162.     // Tick the cylon
  163.     XFE_CALLBACK_DECL(tickCylonNotice)
  164.  
  165.     // Progress bar notices
  166.     XFE_CALLBACK_DECL(progressBarUpdatePercentNotice)
  167.     XFE_CALLBACK_DECL(progressBarUpdateTextNotice)
  168.  
  169.     XFE_CALLBACK_DECL(doSecurityCommand)
  170.  
  171.     // update a specific command in the toolbar.
  172.     XFE_CALLBACK_DECL(update)
  173.  
  174. #ifdef MOZ_TASKBAR
  175.     static void        raiseFloatingShell    ();
  176. #endif
  177. };
  178. #endif /* _xfe_dashboard_h */
  179.