Home · All Classes · Main Classes · Deprecated
Signals | Public Member Functions | Protected Member Functions

MApplicationExtensionArea Class Reference

Inheritance diagram for MApplicationExtensionArea:
Inheritance graph
[legend]
Collaboration diagram for MApplicationExtensionArea:
Collaboration graph
[legend]

List of all members.

Signals

void extensionInstantiated (MApplicationExtensionInterface *extension)
void extensionRemoved (MApplicationExtensionInterface *extension)

Public Member Functions

 MApplicationExtensionArea (const QString &interface, QGraphicsItem *parent=NULL)
virtual ~MApplicationExtensionArea ()
void setInProcessFilter (const QRegExp &inProcessFilter)
void setOutOfProcessFilter (const QRegExp &outOfProcessFilter)
void setOrder (const QStringList &order)
bool init ()
QList
< MApplicationExtensionInterface * > 
extensions ()

Protected Member Functions

 MApplicationExtensionArea (MApplicationExtensionAreaPrivate *dd, MApplicationExtensionAreaModel *model, QGraphicsItem *parent, const QString &interface)

Detailed Description

MApplicationExtensionArea is a widget which can be populated with application extensions. MApplicationExtensionArea can be placed on any view that wants to have application extension support.

The MApplicationExtensionArea will load application extensions which implement the specified interface.

See also:
Application extension development How-To

Definition at line 39 of file extensions/applicationextension/mapplicationextensionarea.h.


Constructor & Destructor Documentation

MApplicationExtensionArea::MApplicationExtensionArea ( const QString interface,
QGraphicsItem parent = NULL 
) [explicit]

Constructs an application extension area. The area is not initialized until init() has been called.

Parameters:
interface the name of the interface the application extensions must implement in order to be loaded to this application extension area
parent optional parent graphics item

Definition at line 59 of file mapplicationextensionarea.cpp.

                                                                                                    :
    MExtensionArea(new MApplicationExtensionAreaPrivate(), new MApplicationExtensionAreaModel, parent)
{
    Q_D(MApplicationExtensionArea);
    d->q_ptr = this;
    d->init(interface);
}

MApplicationExtensionArea::~MApplicationExtensionArea (  )  [virtual]

Destroys the application extension area.

Definition at line 100 of file mapplicationextensionarea.cpp.

{
}

MApplicationExtensionArea::MApplicationExtensionArea ( MApplicationExtensionAreaPrivate *  dd,
MApplicationExtensionAreaModel model,
QGraphicsItem parent,
const QString interface 
) [protected]

Protected constructor to be called by derived classes to set up the private implementation hierarchy.

Definition at line 81 of file mapplicationextensionarea.cpp.

                                                                                                                                                                                 :
    MExtensionArea(dd, model, parent)
{
    Q_D(MApplicationExtensionArea);
    d->init(interface);
}


Member Function Documentation

void MApplicationExtensionArea::extensionInstantiated ( MApplicationExtensionInterface extension  )  [signal]

Signal sent when an extension has been instantiated.

Parameters:
extension the extension that was instantiated
void MApplicationExtensionArea::extensionRemoved ( MApplicationExtensionInterface extension  )  [signal]

Signal sent when an extension has been removed.

Parameters:
extension the extension that was removed
QList< MApplicationExtensionInterface * > MApplicationExtensionArea::extensions (  ) 

Returns a list of in process extensions loaded by this manager

Returns:
List of application extension interface pointers. Receving party should appropriately cast them.

Definition at line 128 of file mapplicationextensionarea.cpp.

{
    Q_D(MApplicationExtensionArea);
    return d->extensions();
}

bool MApplicationExtensionArea::init (  ) 

Initializes the application extension area. All setters introduced by this class must be called before the area is initialized, and the signals must be connected, because calling init() will result in the extensions being created. Initialization will fail if no interface name has been provided or if the area has already been initialized.

Returns:
false if the initialization fails, true otherwise

Definition at line 122 of file mapplicationextensionarea.cpp.

{
    Q_D(MApplicationExtensionArea);
    return d->extensionManager->init();
}

void MApplicationExtensionArea::setInProcessFilter ( const QRegExp inProcessFilter  ) 

Sets a filter for allowing only certain extensions to be ran in the same process as the extension area. The filter is a regular expression which is matched against the .desktop file names of the extensions. By default all extensions are allowed to be loaded in-process. For example, use QRegExp("$^") to allow no extensions, QRegExp("/test(1|A).desktop$") to allow extensions test1.desktop and testA.desktop and QRegExp() to allow all extensions.

Must be called before init(). Calling this after init() has no effect.

Parameters:
inProcessFilter a regular expression for defining which extension are allowed in-process

Definition at line 104 of file mapplicationextensionarea.cpp.

{
    Q_D(MApplicationExtensionArea);
    d->extensionManager->setInProcessFilter(inProcessFilter);
}

void MApplicationExtensionArea::setOrder ( const QStringList order  ) 

Defines the order in which extensions are placed if they are found. Each extension is placed in the position in which it appears for the first time in the list. An empty string can be used to mark the place for unnamed extensions. Must be called before init(). Calling this after init() has no effect.

Parameters:
order a list of extension .desktop file names for defining the order in which certain extensions appear

Definition at line 116 of file mapplicationextensionarea.cpp.

{
    Q_D(MApplicationExtensionArea);
    d->extensionManager->setOrder(order);
}

void MApplicationExtensionArea::setOutOfProcessFilter ( const QRegExp outOfProcessFilter  ) 

Sets a filter for allowing only certain extensions to be ran in separate processes. The filter is a regular expression which is matched against the .desktop file names of the extensions. By default all extensions are allowed to be loaded in separate processes. For example, use QRegExp("$^") to allow no extensions, QRegExp("/test(1|A).desktop$") to allow extensions test1.desktop and testA.desktop and QRegExp() to allow all extensions.

Must be called before init(). Calling this after init() has no effect.

Parameters:
outOfProcessFilter a regular expression for defining which extension are allowed out-of-process

Definition at line 110 of file mapplicationextensionarea.cpp.

{
    Q_D(MApplicationExtensionArea);
    d->extensionManager->setOutOfProcessFilter(outOfProcessFilter);
}


Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:24 (PDT)
Doxygen 1.7.1
MeeGo Touch