Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes
SimplePluginStreamListener Class Reference
Inheritance diagram for SimplePluginStreamListener:
Inheritance graph
[legend]
Collaboration diagram for SimplePluginStreamListener:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD OnStartBinding (nsIPluginStreamInfo *pluginInfo)
 Notify the observer that the URL has started to load.
NS_IMETHOD OnDataAvailable (nsIPluginStreamInfo *pluginInfo, nsIInputStream *input, PRUint32 length)
 Notify the client that data is available in the input stream.
NS_IMETHOD OnFileAvailable (nsIPluginStreamInfo *pluginInfo, const char *fileName)
NS_IMETHOD OnStopBinding (nsIPluginStreamInfo *pluginInfo, nsresult status)
 Notify the observer that the URL has finished loading.
NS_IMETHOD OnNotify (const char *url, nsresult status)
NS_IMETHOD GetStreamType (nsPluginStreamType *result)
 SimplePluginStreamListener (SimplePluginInstance *inst, const char *url)
virtual ~SimplePluginStreamListener (void)
void onStartBinding (in nsIPluginStreamInfo aPluginInfo)
 Notify the observer that the URL has started to load.
void onDataAvailable (in nsIPluginStreamInfo aPluginInfo, in nsIInputStream aInputStream, in unsigned long aLength)
 Notify the client that data is available in the input stream.
void onFileAvailable (in nsIPluginStreamInfo aPluginInfo, in string aFileName)
 Notify the client that data is available in the file.
void onStopBinding (in nsIPluginStreamInfo aPluginInfo, in nsresult aStatus)
 Notify the observer that the URL has finished loading.

Public Attributes

readonly attribute
nsPluginStreamType 
streamType
 Gets the type of the stream.

Protected Attributes

const char * fMessageName

Detailed Description

Definition at line 309 of file npsimple.cpp.


Constructor & Destructor Documentation

Definition at line 826 of file npsimple.cpp.

    : fMessageName(msgName)
{
    char msg[256];
    sprintf(msg, "### Creating SimplePluginStreamListener for %s\n", fMessageName);
}

Definition at line 834 of file npsimple.cpp.

{
    char msg[256];
    sprintf(msg, "### Destroying SimplePluginStreamListener for %s\n", fMessageName);
}

Member Function Documentation

Definition at line 915 of file npsimple.cpp.

{
#ifdef NS_DEBUG
    printf("SimplePluginStreamListener::GetStreamType\n");
#endif

    *result = nsPluginStreamType_Normal;
    return NS_OK;
}
void nsIPluginStreamListener::onDataAvailable ( in nsIPluginStreamInfo  aPluginInfo,
in nsIInputStream  aInputStream,
in unsigned long  aLength 
) [inherited]

Notify the client that data is available in the input stream.

This method is called whenver data is written into the input stream by the networking library...

Parameters:
aPluginInfo- plugin stream info
aInputStream- the input stream containing the data. This stream can be either a blocking or non-blocking stream.
aLength- the amount of data that was just pushed into the stream.
Returns:
- the return value is currently ignored.

Notify the client that data is available in the input stream.

This method is called whenver data is written into the input stream by the networking library...

Parameters:
aIStreamThe input stream containing the data. This stream can be either a blocking or non-blocking stream.
lengthThe amount of data that was just pushed into the stream.
Returns:
The return value is currently ignored.

Definition at line 858 of file npsimple.cpp.

{
#ifdef NS_DEBUG
    printf("SimplePluginStreamListener::OnDataAvailable\n");
#endif

    char* buffer = new char[length];
    if (buffer) {
        PRUint32 amountRead = 0;
        nsresult rslt = input->Read(buffer, length, &amountRead);
        if (rslt == NS_OK) {
            char msg[256];
            sprintf(msg, "### Received %d bytes for %s\n", length, fMessageName);
        }
        delete buffer;
    }
    return NS_OK;
}
void nsIPluginStreamListener::onFileAvailable ( in nsIPluginStreamInfo  aPluginInfo,
in string  aFileName 
) [inherited]

Notify the client that data is available in the file.

Parameters:
aPluginInfo- plugin stream info
aFileName- the name of the file containing the data
Returns:
- the return value is currently ignored.

Definition at line 880 of file npsimple.cpp.

{
#ifdef NS_DEBUG
    printf("SimplePluginStreamListener::OnFileAvailable\n");
#endif

    char msg[256];
    sprintf(msg, "### File available for %s: %s\n", fMessageName, fileName);
    return NS_OK;
}

Definition at line 905 of file npsimple.cpp.

{
#ifdef NS_DEBUG
    printf("SimplePluginStreamListener::OnNotify\n");
#endif

    return NS_OK;
}

Notify the observer that the URL has started to load.

This method is called only once, at the beginning of a URL load.

Parameters:
aPluginInfo- plugin stream info
Returns:
- the return value is currently ignored, in the future it may be used to cancel the URL load..

Notify the observer that the URL has started to load.

This method is called only once, at the beginning of a URL load.

Returns:
The return value is currently ignored. In the future it may be used to cancel the URL load..

Definition at line 846 of file npsimple.cpp.

{
#ifdef NS_DEBUG
    printf("SimplePluginStreamListener::OnStartBinding\n");
#endif

    char msg[256];
    sprintf(msg, "### Opening plugin stream for %s\n", fMessageName);
    return NS_OK;
}
void nsIPluginStreamListener::onStopBinding ( in nsIPluginStreamInfo  aPluginInfo,
in nsresult  aStatus 
) [inherited]

Notify the observer that the URL has finished loading.

This method is called once when the networking library has finished processing the URL transaction initiatied via the nsINetService::Open(...) call.

This method is called regardless of whether the URL loaded successfully.

Parameters:
aPluginInfo- plugin stream info
aStatus- reason why the stream has been terminated
Returns:
- the return value is currently ignored.

Notify the observer that the URL has finished loading.

This method is called once when the networking library has finished processing the URL transaction initiatied via the nsINetService::Open(...) call.

This method is called regardless of whether the URL loaded successfully.

Parameters:
statusStatus code for the URL load.
msgA text string describing the error.
Returns:
The return value is currently ignored.

Definition at line 893 of file npsimple.cpp.

{
#ifdef NS_DEBUG
    printf("SimplePluginStreamListener::OnStopBinding\n");
#endif

    char msg[256];
    sprintf(msg, "### Closing plugin stream for %s\n", fMessageName);
    return NS_OK;
}

Member Data Documentation

Definition at line 372 of file npsimple.cpp.

Gets the type of the stream.

Parameters:
aStreamType- the type of the stream

Definition at line 118 of file nsIPluginStreamListener.idl.


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