diff -r 2e2dc3d30ca8 -r 341166945d65 homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp --- a/homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp Thu Jun 24 13:11:40 2010 +0100 +++ b/homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp Fri Jun 25 19:19:22 2010 +0300 @@ -23,16 +23,26 @@ #include "caservice.h" #include "caquery.h" +/*! + \class HsWidgetComponent + \ingroup group_hsdomainmodel + \brief Widget component represent a widget package. + + Widget component is accessed through a HsWidgetComponentRegistry. All widget instances from same type + are refering to one HsWidgetComponent and can listen component state changes + +*/ + /*! - + Destructor */ HsWidgetComponent::~HsWidgetComponent() { } /*! - + Widget component installation path */ QString HsWidgetComponent::rootPath() const { @@ -40,14 +50,16 @@ } /*! - + Widget unique identifier */ QString HsWidgetComponent::uri() const { return mUri; } - +/*! + Returns true if widget is available thus it's root path exists +*/ bool HsWidgetComponent::isAvailable() const { bool ret(true); @@ -57,23 +69,58 @@ return ret; } /*! + \fn HsWidgetComponent::aboutToUninstall() + This signal is emitted before component is uninstalled. + System may delete widget instances and release all resources + related to component. Component installation will fail, if installer + can't remove and install some file if someone has handle to it. + +*/ + +/*! + \fn HsWidgetComponent::uninstalled() + + This signal is emitted after component is uninstalled from device. +*/ + +/*! + \fn HsWidgetComponent::updated() + + This signal is emitted when component is updated. +*/ + +/*! + \fn HsWidgetComponent::unavailable() + + This signal is emitted when component comes unavailable i.e media is removed. +*/ + +/*! + \fn HsWidgetComponent::available() + + This signal is emitted when component comes available i.e media is attached. +*/ + + +/*! + Constructor */ HsWidgetComponent::HsWidgetComponent(const QString &uri, QObject *parent) : QObject(parent), mUri(uri), mState(Available) { - resolveRootPath(); + resolveRootPathAndTranslationFilename(); installTranslator(); } /*! - + Resolves component's root path and translation file name if any */ -void HsWidgetComponent::resolveRootPath() +void HsWidgetComponent::resolveRootPathAndTranslationFilename() { CaQuery query; query.setEntryTypeNames(QStringList(widgetTypeName())); @@ -87,11 +134,13 @@ mRootPath = entry->attribute(widgetPathAttributeName()); if (mRootPath.isEmpty() || !QDir(mRootPath).exists()) { mState = Unavailable; + } else { + mTranslationFilename = entry->attribute(translationFilename()); } } /*! - + Search component's translation dile and installs translator to application */ void HsWidgetComponent::installTranslator() { @@ -111,29 +160,32 @@ // if it is not in installed,then check z drive possiblePaths << "z:/resource/qt/translations"; #endif - + for(int i=0; i