home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / gui / CDownloadProgressWindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  91 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. #pragma once
  20.  
  21. #include "CWindowMediator.h"
  22. #include "CNSContext.h"
  23. #include "CSaveWindowStatus.h"
  24. #include <LListener.h>
  25.  
  26. class CProgressBar;
  27. class COffscreenCaption;
  28.  
  29. const ResIDT    WIND_DownloadProgress        =        1011;
  30. const PaneIDT     PaneID_ProgressCancelButton =        'cncl';
  31. const PaneIDT    PaneID_ProgressMessage        =        'pgms';
  32. const PaneIDT    PaneID_ProgressComment        =        'pgcm';
  33. const PaneIDT    PaneID_ProgressBar            =        'pgbr';
  34.  
  35. class CDownloadProgressWindow : 
  36.             public CMediatedWindow,
  37.             public LListener,
  38.             public CSaveWindowStatus
  39. {
  40.     private:
  41.         typedef CMediatedWindow Inherited;
  42.     public:
  43.         enum { class_ID = 'PgWd' };
  44.         
  45.                                     CDownloadProgressWindow(LStream* inStream);
  46.         virtual                        ~CDownloadProgressWindow();
  47.  
  48.         virtual    void                AttemptClose();
  49.         virtual    void                DoClose();
  50.         virtual ResIDT                GetStatusResID() const;         // client must provide!
  51.         virtual UInt16                GetValidStatusVersion() const;     // client must provide!
  52.         
  53.         virtual    void                SetWindowContext(CNSContext* inContext);
  54.         virtual    CNSContext*            GetWindowContext(void);
  55.     
  56.         virtual Boolean                HandleKeyPress(
  57.                                             const EventRecord&    inKeyEvent);
  58.  
  59.         virtual void                FindCommandStatus(
  60.                                             CommandT            inCommand,
  61.                                             Boolean                &outEnabled,
  62.                                             Boolean                &outUsesMark,
  63.                                             Char16                &outMark,
  64.                                             Str255                outName);
  65.  
  66.         virtual Boolean                ObeyCommand(
  67.                                             CommandT            inCommand,
  68.                                             void                *ioParam = nil);
  69.  
  70.         virtual    void                ListenToMessage(
  71.                                             MessageT            inMessage,
  72.                                             void*                ioParam);
  73.     
  74.     protected:
  75.     
  76.         virtual void                FinishCreateSelf(void);
  77.  
  78.         virtual    void                NoteProgressBegin(const CContextProgress& inProgress);
  79.         virtual    void                NoteProgressUpdate(const CContextProgress& inProgress);
  80.         virtual    void                NoteProgressEnd(const CContextProgress& inProgress);
  81.  
  82.         CNSContext*                    mContext;
  83.         CProgressBar*                mBar;
  84.         COffscreenCaption*            mMessage;
  85.         COffscreenCaption*            mComment;        
  86.         Boolean                        mClosing;
  87.         unsigned long                mMessageLastTicks;
  88.         unsigned long                mPercentLastTicks;
  89. };
  90.  
  91.