Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | Static Public Member Functions | List of all members
ComponentDefinition Class Reference

This class describes the component meta information. More...

#include <ComponentDefinition.h>

Public Member Functions

 ComponentDefinition ()
 
 ComponentDefinition (const QString &componentName, bool isBuiltIn)
 
void addParent (ParentDefinition *parent)
 
IComponent * component () const
 
const QString & componentLocation () const
 
const QString & componentName () const
 
const QString & definitionLocation () const
 
const QString & description () const
 
bool isBuiltIn () const
 
bool isCompatible (const IComponent *parent) const
 
bool isCompatible (const QString &name, const Version *version) const
 
bool isCompatible (const ParentDefinitions &parents) const
 
const ParentDefinitions & parents () const
 
const QString & productName () const
 
const QString & provider () const
 
void setComponent (IComponent *component)
 
void setComponentLocation (const QString &componentLocation)
 
void setComponentName (const QString &name)
 
void setDefinitionLocation (const QString &definitionLocation)
 
void setDescription (const QString &description)
 
void setProductName (const QString &productName)
 
void setProvider (const QString &provider)
 
void setShortComponentName (const QString &name)
 
void setVersion (int major_version, int minor_version, int build_version=0, int revision_version=0)
 
void setVersion (Version *version)
 
const QString & shortComponentName () const
 
const Version * version () const
 

Static Public Member Functions

static QString defaultProvider ()
 

Detailed Description

This class describes the component meta information.

This class is used in the Components dialog to provide to user information about the component.

This class also specified that the current component has dependencies on another ones - on its 'parents'.

Constructor & Destructor Documentation

ComponentDefinition::ComponentDefinition ( )

Initializes a new instance of the ComponentDefinition class.

ComponentDefinition::ComponentDefinition ( const QString &  componentName,
bool  isBuiltIn 
)

Initializes a new instance of the ComponentDefinition class using specified component name and built-in flag which determines whether component registered statically in code (build-in) or dynamically (on start-time or run-time).

Member Function Documentation

static QString ComponentDefinition::defaultProvider ( )
static

Returns default component provider, which is Unknown.

void ComponentDefinition::addParent ( ParentDefinition *  parent)

Adds a parent component definition as a dependency for defined component.

IComponent* ComponentDefinition::component ( ) const

Returns a defined component.

const QString& ComponentDefinition::componentLocation ( ) const

Returns a component location (for loaded components). It might be absolute or relative path.

Returns empty string for explicitly loaded components (static components).

const QString& ComponentDefinition::shortComponentName ( ) const

Returns a component short name.

const QString& ComponentDefinition::componentName ( ) const

Returns a component name.

const QString& ComponentDefinition::definitionLocation ( ) const

Returns a definition location (for loaded components). It might be absolute or relative path.

Returns empty string for explicitly loaded components (static components).

const QString& ComponentDefinition::description ( ) const

Gets a detailed description text that is displayed for this component in the About this component box in the Components dialog.

bool ComponentDefinition::isBuiltIn ( ) const

Gets a flag which determines whether component registered statically in code (build-in) or dynamically (on start-time or run-time).

bool ComponentDefinition::isCompatible ( const IComponent *  parent) const

Returns true if component version is compatible with all parent component versions, e.g. if they are equal. Otherwise, returns false.

bool ComponentDefinition::isCompatible ( const QString &  name,
const Version *  version 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

bool ComponentDefinition::isCompatible ( const ParentDefinitions &  parents) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const ParentDefinitions& ComponentDefinition::parents ( ) const

Gets a list of parent (dependent) components names.

const QString& ComponentDefinition::productName ( ) const

Gets a the name that is displayed for this component in the Components dialog.

const QString& ComponentDefinition::provider ( ) const

Gets a the name of component's provider, the person or company, who creates this component.

Unknown is by default.

const Version* ComponentDefinition::version ( ) const

Gets the version of a component.

void ComponentDefinition::setComponent ( IComponent *  component)

Sets a component.

Note
it does not have ownership for the component neither change description for the component.
void ComponentDefinition::setComponentName ( const QString &  name)

Sets the component name. The name should be unique in the application bounadaries, because components with the same name could not be added to the IComponentManager.

void ComponentDefinition::setShortComponentName ( const QString &  name)

Sets the component short name. This name will be shown to the user in the components dialog.

void ComponentDefinition::setDescription ( const QString &  description)

Sets the component description.

void ComponentDefinition::setProductName ( const QString &  productName)

Sets the product name.

void ComponentDefinition::setProvider ( const QString &  provider)

Sets the provider name.

void ComponentDefinition::setComponentLocation ( const QString &  componentLocation)

Sets the component file location.

void ComponentDefinition::setDefinitionLocation ( const QString &  definitionLocation)

Sets the definition file location.

void ComponentDefinition::setVersion ( int  major_version,
int  minor_version,
int  build_version = 0,
int  revision_version = 0 
)

Sets the version of a component.

void ComponentDefinition::setVersion ( Version *  version)

Sets the version of a component. It takes ownership for the version pointer.