⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qnpinstance.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QNPInstance 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQNPInstance \- A QObject that is a Web-browser plugin [Qt NSPlugin Extension].SH SYNOPSIS.br.PP\fC#include <qnp.h>\fR.PPInherits QObject..PP.SS "Public Members".in +1c.ti -1c.BI "\fB~QNPInstance\fR () ".br.ti -1c.BI "int \fBargc\fR () const".br.ti -1c.BI "const char* \fBargn\fR ( int ) const".br.ti -1c.BI "const char* \fBargv\fR ( int ) const".br.ti -1c.BI "enum \fBReason\fR { ReasonDone = 0, ReasonBreak = 1, ReasonError = 2, ReasonUnknown = -1 }".br.ti -1c.BI "const char* \fBarg\fR ( const char * name ) const".br.ti -1c.BI "enum \fBInstanceMode\fR { Embed=1, Full=2, Background=3 }".br.ti -1c.BI "InstanceMode \fBmode\fR () const".br.ti -1c.BI "const char* \fBuserAgent\fR () const".br.ti -1c.BI "virtual QNPWidget* \fBnewWindow\fR () ".br.ti -1c.BI "QNPWidget* \fBwidget\fR () ".br.ti -1c.BI "enum \fBStreamMode\fR { Normal=1, Seek=2, AsFile=3, AsFileOnly=4 }".br.ti -1c.BI "virtual bool \fBnewStreamCreated\fR ( QNPStream *, StreamMode & smode ) ".br.ti -1c.BI "virtual int \fBwriteReady\fR ( QNPStream * ) ".br.ti -1c.BI "virtual int \fBwrite\fR ( QNPStream *, int " "offset" ", int " "len" ", void * buffer ) ".br.ti -1c.BI "virtual void \fBstreamDestroyed\fR ( QNPStream * ) ".br.ti -1c.BI "void \fBstatus\fR ( const char * msg ) ".br.ti -1c.BI "void \fBgetURLNotify\fR ( const char * " "url" ", const char * " "window" "=0, void * " "data" "=0 ) ".br.ti -1c.BI "void \fBgetURL\fR ( const char * " "url" ", const char * " "window" "=0 ) ".br.ti -1c.BI "void \fBpostURL\fR ( const char * " "url" ", const char * " "window" ", uint " "len" ", const char * " "buf" ", bool file ) ".br.ti -1c.BI "QNPStream* \fBnewStream\fR ( const char * " "mimetype" ", const char * " "window" ", bool " "as_file" "=FALSE ) ".br.ti -1c.BI "virtual void \fBstreamAsFile\fR ( QNPStream *, const char * fname ) ".br.ti -1c.BI "void* \fBgetJavaPeer\fR () const".br.ti -1c.BI "virtual void \fBnotifyURL\fR ( const char * " "url" ", Reason " "r" ", void * notifyData ) ".br.ti -1c.BI "virtual bool \fBprintFullPage\fR () ".br.ti -1c.BI "virtual void \fBprint\fR ( QPainter * ) ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "\fBQNPInstance\fR () ".br.in -1c.SH DESCRIPTIONThis class is defined in the \fBQt NSPlugin Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main Qt API..PPa QObject that is a Web-browser plugin.PPDeriving from QNPInstance creates an object that represents a single <EMBED> tag in an HTML document..PPThe QNPInstance is responsible for creating an appropriate window if required (not all plugins have windows), and for interacting with the input/output facilities intrinsic to plugins..PPNote that there is \fIabsolutely no garrantee\fR as to the order in which functions are called. Sometimes the browser will call setWindow() first, at other times, newStreamCreated() will be called first (assuming the <EMBED> tag has a SRC parameter)..PP\fINo GUI functionality\fR of Qt may be used until the first call to setWindow(). This includes any use of QPaintDevice (ie. QPixmap, QWidget, and all subclasses), QApplication, anything related to QPainter (QBrush, etc.), fonts, QMovie, QToolTip, etc. Useful classes which specifically \fIcan\fR be used are QImage, QFile, and QBuffer..PPBy structuring your plugin so that the task of the QNPInstance is to gather data, while the task of the QNPWidget is to provide a graphical interface to that data, this restriction can be easily accommodated..PPExamples:.(lqtimage/qtimage.cpp grapher/grapher.cpp trivial/trivial.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QNPInstance::QNPInstance () \fC[protected]\fR"Creates a QNPInstance. Can only be called from within a derived class created within QNPlugin::newInstance()..SH "QNPInstance::~QNPInstance ()"Called when the plugin instance is about to disappear..SH "const char* QNPInstance::arg ( const char * name ) const"Returns the value of the named arguments, or 0 if no argument with that name appears in the <EMBED> tag of this instance. If the argument appears, but has no value assigned, the empty string is returned. In summary:.TP\fB<EMBED ...>\fR - arg("FOO") == 0.TP\fB<EMBED FOO ...>\fR - arg("FOO") == "".TP\fB<EMBED FOO=BAR ...>\fR - arg("FOO") == "BAR".SH "int QNPInstance::argc () const"Returns the number of arguments to the instance. Note that you should not normally rely on the ordering of arguments, and also note that the SGML specification does not permit multiple arguments with the same name..PPSee also arg()..SH "const char* QNPInstance::argn ( int i ) const"Returns the name of the \fIi\fRth argument. See notes of argc()..SH "const char* QNPInstance::argv ( int i ) const"Returns the value of the \fIi\fRth argument. See notes of argc()..SH "void* QNPInstance::getJavaPeer () const"Returns the Java object associated with the plug-in instance, an object of the plug-in's Java class, or 0 if the plug-in does not have a Java class, Java is disabled, or an error occurred ..PPThe return value is actually a \fCjref\fR we use \fCvoid*\fR so as to avoid burdening plugins which do not require Java..PPSee also QNPlugin::getJavaClass(), QNPlugin::getJavaEnv() and getJavaPeer()..SH "void QNPInstance::getURL ( const char * url, const char * window=0 )"Requests that the given URL be retrieved and sent to the named window. See Netscape's JavaScript documentation for an explanation of window names..PPExamples:.(lgrapher/grapher.cpp.)l.SH "void QNPInstance::getURLNotify ( const char * url, const char * window=0, void * data=0 )"Print the instance full-page. By default, this returns FALSE, causing the browser to call the (embedded) print() function instead. Requests that the given URL be retrieved and sent to the named window. See Netscape's JavaScript documentation for an explanation of window names..PPSee also: Netscape: NPN_GetURLNotify method.SH "QNPStream* QNPInstance::newStream ( const char * mimetype, const char * window, bool as_file=FALSE )"Requests the creation of a new data stream \fIfrom\fR the plug-in. This function is not tested. It is an interface to the NPN_NewStream function of the Netscape Plugin API..SH "bool QNPInstance::newStreamCreated ( QNPStream *, StreamMode & smode ) \fC[virtual]\fR"This function is called when a new stream has been created. The instance should return TRUE if it accepts the processing of the stream. If the instance requires the stream as a file, it should set \fIsmode\fR to AsFileOnly, in which case the data will be delivered some time later to the streamAsFile() function. Otherwise, the data will be delivered in chunks to the write() function which must consume at least as much data as was returned by the most recent call to writeReady()..PPNote that the AsFileOnly method is not supported by Netscape 2.0 and MS-Explorer 3.0..SH "QNPWidget* QNPInstance::newWindow () \fC[virtual]\fR"Called at most once, at some time after the QNPInstance is created. If the plugin requires a window, this function should return a derived class of QNPWidget that provides the required interface..SH "void QNPInstance::notifyURL ( const char *, Reason, void * ) \fC[virtual]\fR"Called whenever an url is notified after call to NPN_GetURLNotify.PPThis function is not tested. It is an encapsulation of the NPP_URLNotify function of the Netscape Plugin API..PPSee also: Netscape: NPP_URLNotify method.SH "void QNPInstance::postURL ( const char * url, const char * window, uint len, const char * buf, bool file )"This function is not tested. It is an interface to the NPN_PostURL function of the Netscape Plugin API..SH "void QNPInstance::print ( QPainter * ) \fC[virtual]\fR"Print the instance embedded in a page..PPThis function is not tested. It is an encapsulation of the NPP_Print function of the Netscape Plugin API..SH "bool QNPInstance::printFullPage () \fC[virtual]\fR"This function is not tested. It is an encapsulation of the NPP_Print function of the Netscape Plugin API..SH "void QNPInstance::status ( const char * msg )"Sets the status message in the browser containing this instance..SH "void QNPInstance::streamAsFile ( QNPStream *, const char * ) \fC[virtual]\fR"Called when a stream is delivered as a single file rather than as chunks. This may be simpler for a plugin to deal with, but precludes any incremental behavior..PPSee also newStreamCreated(), newStream(), Note, that, the, AsFileOnly, method, is, not, supported, by, Netscape, 2.0, MS-Explorer and 3.0..SH "void QNPInstance::streamDestroyed ( QNPStream * ) \fC[virtual]\fR"Called when a stream is destroyed. At this this, the stream may be complete() and okay(). If it is not okay(), then an error has occurred. If it is okay(), but not complete(), then the user has cancelled the transmission - do not give an error message in this case..SH "const char* QNPInstance::userAgent () const"Returns the user agent (browser name) containing this instance..SH "QNPWidget* QNPInstance::widget ()"Returns the plugin window created at newWindow(), if any..PPExamples:.(lgrapher/grapher.cpp.)l.SH "int QNPInstance::write ( QNPStream *, int offset, int len, void * buffer ) \fC[virtual]\fR"Called when incoming data is available for processing by the instance. The instance \fImust\fR consume at least the amount that it returned in the most recent call to writeReady(), but it may consume up to the amount given by \fIlen. buffer\fR is the data available for consumption. The \fIoffset\fR argument is merely an informational value indicating the total amount of data that has been consumed in prior calls..PPThis function should return the amount of data actually consumed..SH "int QNPInstance::writeReady ( QNPStream * ) \fC[virtual]\fR"Called to inquire the minimum amount of data the instance is willing to receive from the given stream..PPThe default returns a very large value..SH "SEE ALSO".BR http://doc.trolltech.com/qnpinstance.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -