Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
QGeckoPlugin Class Reference

Implements an interface for the Qt-Designer plugin. More...

#include <plugin.h>

List of all members.

Public Member Functions

 QGeckoPlugin ()
QStringList keys () const
QWidget * create (const QString &key, QWidget *parent=0, const char *name=0)
QString group (const QString &key) const
QIconSet iconSet (const QString &key) const
QString includeFile (const QString &key) const
QString toolTip (const QString &key) const
QString whatsThis (const QString &key) const
bool isContainer (const QString &) const

Detailed Description

Implements an interface for the Qt-Designer plugin.

Definition at line 49 of file plugin.h.


Constructor & Destructor Documentation

Definition at line 49 of file plugin.cpp.

{
}

Member Function Documentation

QWidget * QGeckoPlugin::create ( const QString &  key,
QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 60 of file plugin.cpp.

{
    if (key=="QGeckoEmbed") {
        //nicer would be to use the QLibrary, but it uses only
        //the RTLD_LAZY flag and we need the RTLD_GLOBAL
        //to successfully load the rest of mozilla libs
        void *handle1 = dlopen("libxpcom.so", RTLD_NOW|RTLD_GLOBAL);
        void *handle2 = dlopen("libqgeckoembed.so", RTLD_NOW|RTLD_GLOBAL);
        if (!handle1 || !handle2) {
            QLabel *l = new QLabel(parent, name);
            l->setText("<html><body>"
                       "Unable to initialize Mozilla.<br>"
                       "Try to set <b>MOZILLA_FIVE_HOME</b> and "
#ifdef Q_WS_WIN
                       "<b>PATH</b>"
#else
                       "<b>LD_LIBRARY_PATH</b>"
#endif
                       " variables before starting the Qt Designer."
                       "</body></html>");
            return l;
        }
        else {
            //this is a workaround for mozilla bug:
            //call to NS_InitEmbedding works only once
            static bool initialized = FALSE;
            if (!initialized) {
                QGeckoEmbed::
                initialize(QDir::
                           convertSeparators(QDir::home().absPath()+
                                             "/.qgeckoembed-qtdesigner"),
                           "QtDesigner");
                //QGeckoGlobals::pushStartup()
                static QGeckoEmbed *sentinel;
                sentinel = new QGeckoEmbed(NULL, "sentinel");
                initialized = TRUE;
            }
            QGeckoEmbed *me = new QGeckoEmbed(parent, name);
            me->loadURL("about:");
            return me;
        }
    }
    else {
        return NULL;
    }

}

Here is the call graph for this function:

QString QGeckoPlugin::group ( const QString &  key) const

Definition at line 118 of file plugin.cpp.

{
    return
        key=="QGeckoEmbed"?
        "Display (Mozilla)":
        QString::null;
}
QIconSet QGeckoPlugin::iconSet ( const QString &  key) const

Definition at line 126 of file plugin.cpp.

{
    return QIconSet(QPixmap(mozilla_pixmap));
}
QString QGeckoPlugin::includeFile ( const QString &  key) const

Definition at line 110 of file plugin.cpp.

{
    return
        key=="QGeckoEmbed"?
        "qgeckoembed.h":
        QString::null;
}
bool QGeckoPlugin::isContainer ( const QString &  ) const

Definition at line 148 of file plugin.cpp.

{
    return FALSE;
}
QStringList QGeckoPlugin::keys ( ) const

Definition at line 53 of file plugin.cpp.

{
    QStringList list;
    list << "QGeckoEmbed";
    return list;
}

Here is the call graph for this function:

QString QGeckoPlugin::toolTip ( const QString &  key) const

Definition at line 131 of file plugin.cpp.

{
    return
        key=="QGeckoEmbed"?
        "Mozilla Browser Control":
        QString::null;
}
QString QGeckoPlugin::whatsThis ( const QString &  key) const

Definition at line 139 of file plugin.cpp.

{
    return
        key=="QGeckoEmbed"?
        "A widget with Mozilla Web Browser":
        QString::null;
}

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