Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Attributes
CMultiDownloadProgressWindow Class Reference

#include <UDownloadDisplay.h>

List of all members.

Public Types

enum  { class_ID = FOUR_CHAR_CODE('MDPW') }

Public Member Functions

 CMultiDownloadProgressWindow ()
 CMultiDownloadProgressWindow (LStream *inStream)
virtual ~CMultiDownloadProgressWindow ()
virtual void AddDownloadView (CDownloadProgressView *aView)
virtual void RemoveDownloadView (CDownloadProgressView *aView)
virtual Boolean ConfirmClose ()

Protected Attributes

SInt32 mDownloadViewCount

Detailed Description

Definition at line 101 of file UDownloadDisplay.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
class_ID 

Definition at line 105 of file UDownloadDisplay.h.

{ class_ID = FOUR_CHAR_CODE('MDPW') };

Constructor & Destructor Documentation

Definition at line 133 of file UDownloadDisplay.cpp.

                                                           :
    mDownloadViewCount(0)
{
    StartBroadcasting();
}

Definition at line 139 of file UDownloadDisplay.cpp.

                                                                            :
    LWindow(inStream),
    mDownloadViewCount(0)
{
    StartBroadcasting();
}

Definition at line 146 of file UDownloadDisplay.cpp.

{
}

Member Function Documentation

Definition at line 150 of file UDownloadDisplay.cpp.

{
    const SInt16 kSeparatorHeight = 3;
    
    SDimension16 currSize;
    GetFrameSize(currSize);
    
    SDimension16 viewSize;
    aView->GetFrameSize(viewSize);
    ResizeWindowTo(currSize.width,  (viewSize.height * (mDownloadViewCount + 1)) - kSeparatorHeight);
    
    aView->PlaceInSuperFrameAt(0, viewSize.height * mDownloadViewCount++, false);
    aView->FinishCreate();
}

Here is the caller graph for this function:

Definition at line 192 of file UDownloadDisplay.cpp.

{
    Boolean canClose = true;
    SInt32 numActiveDownloads = 0;

    TArrayIterator<LPane*>  iterator(GetSubPanes());
    LPane   *subPane;
    while (iterator.Next(subPane)) {
        CDownloadProgressView *downloadView = dynamic_cast<CDownloadProgressView*>(subPane);
        if (downloadView && downloadView->IsActive())
            numActiveDownloads++;    
    }
    
    if (numActiveDownloads != 0) {
        short itemHit;
        AlertStdAlertParamRec pb;

        pb.movable = false;
        pb.helpButton = false;
        pb.filterProc = nil;
        pb.defaultText = (StringPtr) kAlertDefaultOKText;
        pb.cancelText = (StringPtr) kAlertDefaultCancelText;
        pb.otherText = nil;
        pb.defaultButton = kStdOkItemIndex;
        pb.cancelButton = kStdCancelItemIndex;
        pb.position = kWindowAlertPositionParentWindowScreen;

        LStr255 msgString(STRx_StdAlertStrings, str_ConfirmCloseDownloads);
        LStr255 explainString(STRx_StdAlertStrings, str_ConfirmCloseDownloadsExp);
        ::StandardAlert(kAlertStopAlert, msgString, explainString, &pb, &itemHit);
        if (itemHit != kAlertStdAlertOKButton)
            canClose = false;
    }
    return canClose;    
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 165 of file UDownloadDisplay.cpp.

{
    // We can't remove the last view, leaving an empty window frame
    if (mDownloadViewCount <= 1)
        return;
        
    SDimension16 removedPaneSize;
    aView->GetFrameSize(removedPaneSize);
    SPoint32 removedPaneLoc;
    aView->GetFrameLocation(removedPaneLoc);
    
    delete aView;
    RemoveSubPane(aView);
    mDownloadViewCount--;

    TArrayIterator<LPane*>  iterator(GetSubPanes());
    LPane   *subPane;
    while (iterator.Next(subPane)) {
        SPoint32 subPaneLoc;
        subPane->GetFrameLocation(subPaneLoc);
        if (subPaneLoc.v >= removedPaneLoc.v + removedPaneSize.height) {
            subPane->MoveBy(0, -removedPaneSize.height, true);
        }
    }
    ResizeWindowBy(0, -removedPaneSize.height);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 118 of file UDownloadDisplay.h.


The documentation for this class was generated from the following files: