![]() |
Carousel
|
The abstract IComponent class defines contract for the components deployed in the application. More...
#include <IComponent.h>
Inherits QObject.
Inherited by BaseComponent.
Public Types | |
enum | Availability { Enabled, Disabled, Unavailable } |
Signals | |
void | availabilityChanged (IComponent::Availability) |
Public Member Functions | |
virtual Availability | availability () const =0 |
virtual const ComponentDefinition * | definition () const =0 |
template<typename TExtension > | |
TExtension * | extension () |
template<typename TExtension > | |
const TExtension * | extension () const |
virtual void * | getExtension (const QString &byTypeId) const =0 |
virtual bool | isCompatible (const IComponent *withOther) const =0 |
virtual const QString & | name () const =0 |
virtual void | setAvailability (Availability newMode)=0 |
virtual void | shutdown (IServiceLocator *serviceLocator)=0 |
virtual bool | started () const =0 |
virtual bool | startup (IServiceLocator *serviceLocator)=0 |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Properties | |
Availability | availability |
const ComponentDefinition | definition |
QString | name |
bool | started |
![]() | |
objectName | |
Additional Inherited Members | |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
The abstract IComponent class defines contract for the components deployed in the application.
It is a base unit of the carousel, that can contain UI and/or logic features, provides or exposes some services for the other components. The instances of the IComponent class could be registered statically in code or discovered by other way - e.g., loaded from the specified pathes by DirectoryComponentProvider. Regardless of how you register new components, they will be passed to the IComponentManager after bootloading sequence and will be started.
The IComponent also stores its extensions, that could be handled by other components pr by carousel core (like IInteractiveExtension).
See ComponentDefinition interface, if your component will have a dependencies from the other application components.
Consider deriving from the BaseComponent class instead of implement this interface directly.
Component availability states.
|
pure virtual |
Gets the value specified whether this component is enabled, disabled, or unavailable. When the availability is enabled, the component is checked in the Components dialog.
Implemented in BaseComponent.
|
pure virtual |
Gets the component definition that can specify component dependencies and also describes the component.
Note, that component takes ownership for its defition.
Implemented in BaseComponent.
TExtension * IComponent::extension | ( | ) |
Finds a registered in derived class extension by its type, if any. If extension with such type was not registered, returns nullptr.
const TExtension * IComponent::extension | ( | ) | const |
Finds a registered in derived class extension by its type, if any. If extension with such type was not registered, returns nullptr.
|
pure virtual |
When overridden in derived classes finds pointer associated with specified type id in inner objects dictionary.
Implemented in BaseComponent, and ProxyComponent.
|
pure virtual |
The name of the component. This name should be unique and used for the resolving component dependencies.
It is a shortcut for the definition()->name().
Implemented in BaseComponent.
|
pure virtual |
Returns true if component version is compatible with all parent component versions, e.g. if they are equal. Otherwise, returns false.
Implemented in BaseComponent.
|
pure virtual |
Sets the value specified whether this component is enabled or disabled. The checked state of the component is saved in the user settings.
Implemented in BaseComponent.
|
pure virtual |
Shuts down the component. Implement this method to perform some action when the component gets unloaded.
Implemented in BaseComponent.
|
pure virtual |
Gets the value determined whether component is already started or not.
Implemented in BaseComponent.
|
pure virtual |
When all components are registered, each component started up with given initialization data.
serviceLocator | is a reference to the services pool. It is needed to register/locate to common services and other components' services. |
Implemented in BaseComponent.
|
signal |
This signal is emited when extension's availability changed.
|
readwrite |
Gets or sets the value specified whether this component is enabled, disabled, or unavailable. When the availability is enabled, the component is checked in the Components dialog.