Back to index

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD OnStartBinding (nsIPluginStreamInfo *pluginInfo)
NS_IMETHOD OnDataAvailable (nsIPluginStreamInfo *pluginInfo, nsIInputStream *input, PRUint32 length)
NS_IMETHOD OnFileAvailable (nsIPluginStreamInfo *pluginInfo, const char *fileName)
NS_IMETHOD OnStopBinding (nsIPluginStreamInfo *pluginInfo, nsresult status)
NS_IMETHOD OnNotify (const char *url, nsresult status)
NS_IMETHOD GetStreamType (nsPluginStreamType *result)
 EventsPluginStreamListener (EventsPluginInstance *inst_, const char *url)
virtual ~EventsPluginStreamListener (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
EventsPluginInstanceinst

Detailed Description

Definition at line 222 of file npevents.cpp.


Constructor & Destructor Documentation

Definition at line 593 of file npevents.cpp.

              : fMessageName(msgName), inst(inst_) {
#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener: EventsPluginStreamListener for %s\n", fMessageName);
#endif
}

Definition at line 601 of file npevents.cpp.

                                                            {
}

Member Function Documentation

Definition at line 673 of file npevents.cpp.

                                                                              {
#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener::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.

Definition at line 617 of file npevents.cpp.

                     {

#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener::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 639 of file npevents.cpp.

                          {

#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener::OnFileAvailable\n");
#endif 

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

Definition at line 665 of file npevents.cpp.

                                                                         {
#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener::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..

Definition at line 609 of file npevents.cpp.

                                                                            {
#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener::OnStartBinding\n");
       printf("EventsPluginStreamListener: Opening plugin stream for %s\n", fMessageName);
#endif 
       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.

Definition at line 652 of file npevents.cpp.

                {

#ifdef EVENTSPLUGIN_DEBUG
       printf("EventsPluginStreamListener::OnStopBinding\n");
#endif 

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

Member Data Documentation

Definition at line 258 of file npevents.cpp.

Definition at line 259 of file npevents.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: