Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Fonctions  · 

QNPlugin Class Reference

The QNPlugin class provides the main factory for plugin objects. More...

This class is part of the Qt Netscape Extension.

#include <qnp.h>

List of all member functions.

Public Members

Static Public Members

Protected Members


Detailed Description

This class is defined in the Qt Netscape Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API.

The QNPlugin class provides the main factory for plugin objects.

This class is the heart of the plugin. One instance of this object is created when the plugin is first needed, by calling QNPlugin::create(), which must be implemented in your plugin code to return some derived class of QNPlugin. The one QNPlugin object creates all QNPInstance instances for a web browser running in a single process.

Additionally, if Qt is linked to the plugin as a dynamic library, only one instance of QApplication will exist across all plugins that have been made with Qt. So, your plugin should tread lightly on global settings. Do not, for example, use QApplication::setFont() - that will change the font in every widget of every Qt-based plugin currently loaded!


Member Function Documentation

QNPlugin::QNPlugin () [protected]

Creates a QNPlugin. This may only be used by the constructor of the class, derived from QNPlugin, that is returned by your plugin's implementation of the QNPlugin::create() function.

QNPlugin::~QNPlugin () [virtual]

Destroys the QNPlugin. This is called by the plugin binding code just before the plugin is about to be unloaded from memory. If newWindow() has been called, a QApplication will still exist at this time, but will be deleted shortly after, just before the plugin is deleted.

QNPlugin * QNPlugin::actual () [static]

Returns the plugin most recently returned by QNPlugin::create().

QNPlugin * QNPlugin::create () [static]

This function must be implemented by your plugin code. It should return a derived class of QNPlugin.

void * QNPlugin::getJavaClass () [virtual]

Override this function to return a reference to the Java class that represents the plugin. The default returns 0, indicating no class.

If you override this class, you must also override QNPlugin::unuseJavaClass().

The return value is actually a jref; we use void* so as to avoid burdening plugins which do not require Java.

See also getJavaEnv() and QNPInstance::getJavaPeer().

void * QNPlugin::getJavaEnv () const

Returns a pointer to the Java execution environment, or 0 if either Java is disabled or an error occurred.

The return value is actually a JRIEnv*; we use void* so as to avoid burdening plugins which do not require Java.

See also getJavaClass() and QNPInstance::getJavaPeer().

const char * QNPlugin::getMIMEDescription () const [pure virtual]

Override this function to return the MIME description of the data formats supported by your plugin. The format of this string is shown by the following example:

    const char* getMIMEDescription() const
    {
        return "image/x-png:png:PNG Image;"
               "image/png:png:PNG Image;"
               "image/x-portable-bitmap:pbm:PBM Image;"
               "image/x-portable-graymap:pgm:PGM Image;"
               "image/x-portable-pixmap:ppm:PPM Image;"
               "image/bmp:bmp:BMP Image;"
               "image/x-ms-bmp:bmp:BMP Image;"
               "image/x-xpixmap:xpm:XPM Image;"
               "image/xpm:xpm:XPM Image";
    }

const char * QNPlugin::getPluginDescriptionString () const [pure virtual]

Returns a pointer to the plain-text description of the plugin.

const char * QNPlugin::getPluginNameString () const [pure virtual]

Returns a pointer to the plain-text name of the plugin.

void QNPlugin::getVersionInfo ( int & plugin_major, int & plugin_minor, int & browser_major, int & browser_minor )

Populates *plugin_major and *plugin_minor with the version of the plugin API and populates *browser_major and *browser_minor with the version of the web browser.

QNPInstance * QNPlugin::newInstance () [pure virtual]

Override this function to return an appropriate derived class of QNPInstance.

void QNPlugin::unuseJavaClass () [virtual]

This function is called when the plugin is shutting down. The function should unuse the Java class returned earlier by getJavaClass().

This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 53
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Livre blanc de l'outillage de Qt Quick

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 3.3
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web