src/hbcore/utils/hbwidgetloader.cpp
changeset 5 627c4a0fd0e7
parent 1 f7ac710697a9
child 7 923ff622b8b9
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
    20 **
    20 **
    21 ** If you have questions regarding the use of this file, please contact
    21 ** If you have questions regarding the use of this file, please contact
    22 ** Nokia at developer.feedback@nokia.com.
    22 ** Nokia at developer.feedback@nokia.com.
    23 **
    23 **
    24 ****************************************************************************/
    24 ****************************************************************************/
       
    25 #ifndef HB_BIN_CSS
       
    26 #define HB_USETHEMESERVER
       
    27 #endif
    25 
    28 
    26 #include "hbwidgetloader_p.h"
    29 #include "hbwidgetloader_p.h"
    27 #include "hbwidgetloadersyntax_p.h"
    30 #include "hbwidgetloadersyntax_p.h"
    28 #include "hbwidgetloaderactions_p.h"
    31 #include "hbwidgetloaderactions_p.h"
    29 
    32 
    30 #include "hbinstance.h"
    33 #include "hbinstance.h"
    31 #include "hbtheme_p.h"
    34 #include "hbtheme_p.h"
       
    35 #ifdef HB_USETHEMESERVER
    32 #include "hbthemeclient_p.h"
    36 #include "hbthemeclient_p.h"
       
    37 #endif
    33 
    38 
    34 #include <QtDebug>
    39 #include <QtDebug>
    35 #include <QFile>
    40 #include <QFile>
    36 #include <QStringList>
    41 #include <QStringList>
    37 #include <hbwidget.h>
    42 #include <hbwidget.h>
    61 // This reduces the check QFile::exists() at client side as well as the server side.
    66 // This reduces the check QFile::exists() at client side as well as the server side.
    62 // also no unnecessary IPC calls.
    67 // also no unnecessary IPC calls.
    63 Q_GLOBAL_STATIC(QStringList, filesNotPresent)
    68 Q_GLOBAL_STATIC(QStringList, filesNotPresent)
    64 
    69 
    65 // Layout caching
    70 // Layout caching
    66 static HbWidgetLoader::LayoutDefinition *staticCacheLayout = NULL;
    71 static HbWidgetLoader::LayoutDefinition *staticCacheLayout = 0;
    67 static QString staticCacheFileName = QString();
    72 static QString staticCacheFileName;
    68 static QString staticCacheName = QString();
    73 static QString staticCacheName;
    69 static QString staticCacheSection = QString();
    74 static QString staticCacheSection;
    70 static QDateTime staticCacheModified = QDateTime();
    75 static QDateTime staticCacheModified;
    71 
    76 
    72 class HbWidgetLoaderPrivate
    77 class HbWidgetLoaderPrivate
    73 {
    78 {
    74     Q_DECLARE_PUBLIC(HbWidgetLoader)    
    79     Q_DECLARE_PUBLIC(HbWidgetLoader)    
    75         
    80         
   235     delete mSyntax;
   240     delete mSyntax;
   236     delete mMemActions;
   241     delete mMemActions;
   237     delete mActions;
   242     delete mActions;
   238 }
   243 }
   239 
   244 
       
   245 #ifdef HB_BIN_CSS
       
   246 void HbWidgetLoaderPrivate::setWidget( HbWidget* widget )
       
   247 {
       
   248     Q_UNUSED(widget)
       
   249 }
       
   250 #else
   240 /*!
   251 /*!
   241     \internal
   252     \internal
   242 */
   253 */
   243 void HbWidgetLoaderPrivate::setWidget( HbWidget* widget )
   254 void HbWidgetLoaderPrivate::setWidget( HbWidget* widget )
   244 {
   255 {
   245     mActions->reset();       
   256     mActions->reset();       
   246     mActions->mWidget = widget;
   257     mActions->mWidget = widget;
   247     mActions->mCurrentProfile = HbDeviceProfile::profile(widget);
   258     mActions->mCurrentProfile = HbDeviceProfile::profile(widget);
   248 }
   259 }
       
   260 #endif
   249 
   261 
   250 /*!
   262 /*!
   251     \internal
   263     \internal
   252 */
   264 */
   253 bool HbWidgetLoaderPrivate::getSharedLayoutDefinition(
   265 bool HbWidgetLoaderPrivate::getSharedLayoutDefinition(
   278         filesNotPresent()->append(fileName);
   290         filesNotPresent()->append(fileName);
   279         return false;
   291         return false;
   280     }
   292     }
   281 
   293 
   282     // get the shared layout definition address.
   294     // get the shared layout definition address.
       
   295 #ifdef HB_USETHEMESERVER
   283     layoutDef = HbThemeClient::global()->getSharedLayoutDefs(fileName, name, section);
   296     layoutDef = HbThemeClient::global()->getSharedLayoutDefs(fileName, name, section);
   284     if (layoutDef) {
   297     if (layoutDef) {
   285         clientLayoutDefsCache()->insert(key, layoutDef);
   298         clientLayoutDefsCache()->insert(key, layoutDef);
   286     }
   299     }
       
   300 #endif
   287     return true;
   301     return true;
   288 }
   302 }
   289 
   303 
   290 /*!
   304 /*!
   291     \internal
   305     \internal