src/hbcore/cssparser/hblayeredstyleloader_p.h
changeset 5 627c4a0fd0e7
parent 3 11d3954df52a
child 21 4633027730f5
child 34 ed14f46c0e55
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
    63     static HbLayeredStyleLoader *getStack(Concern con);
    63     static HbLayeredStyleLoader *getStack(Concern con);
    64     inline static bool sharingNeeded(LayerPriority layerPriority){
    64     inline static bool sharingNeeded(LayerPriority layerPriority){
    65         return (layerPriority >= Priority_AppTheme && layerPriority <=  Priority_Application )? false : true;
    65         return (layerPriority >= Priority_AppTheme && layerPriority <=  Priority_Application )? false : true;
    66     }
    66     }
    67 
    67 
    68     int load(const QString &fileName, LayerPriority priority, bool enableBinarySupport =false);
    68     int load(const QString &fileName, LayerPriority priority);
    69     int load(QIODevice *device, LayerPriority priority);
    69     int load(QIODevice *device, LayerPriority priority);
    70     QVector<int> loadAll(const QStringList &files, LayerPriority priority);
    70     QVector<int> loadAll(const QStringList &files, LayerPriority priority);
    71     QVector<int> loadDir(const QString &dirPath, QDir::SortFlags sort, LayerPriority priority);
    71     QVector<int> loadDir(const QString &dirPath, QDir::SortFlags sort, LayerPriority priority);
    72 
    72 
    73     bool unload(int handle, LayerPriority priority);
    73     bool unload(int handle, LayerPriority priority);
    86     void variableRuleSets(QHash<QString, HbCss::Declaration> *variables) const;
    86     void variableRuleSets(QHash<QString, HbCss::Declaration> *variables) const;
    87 
    87 
    88 protected:
    88 protected:
    89     void updateLayersListIfRequired(LayerPriority priority);
    89     void updateLayersListIfRequired(LayerPriority priority);
    90     QList<LayerPriority> mUsedLayers;
    90     QList<LayerPriority> mUsedLayers;
    91     
       
    92 private:
       
    93     bool loadBinary(const QString& fileName,HbCss::StyleSheet *styleSheet);
       
    94     bool saveBinary(const QString& fileName,HbCss::StyleSheet *styleSheet);
       
    95     void saveDeclarations(QDataStream & stream,HbVector<HbCss::Declaration>* decls );
       
    96     HbVector<HbCss::Declaration> loadDeclarations(QDataStream & stream );
       
    97     void saveStyleRules(QDataStream &stream, const HbVector<HbCss::StyleRule> *rules);
       
    98     void loadStyleRules(QDataStream &stream, HbVector<HbCss::StyleRule> &rules);
       
    99     bool isBinaryFile(const QString& fileName);
       
   100     QString getBinaryFileName(const QString& fileName);
       
   101 
    91 
   102 private:
    92 private:
   103     PriorityLayerMap mStyleLayers;
    93     PriorityLayerMap mStyleLayers;
   104     Concern mConcern;
    94     Concern mConcern;
   105     mutable QHash<QString, HbCss::Declaration> mDefaultVariables;
    95     mutable QHash<QString, HbCss::Declaration> mDefaultVariables;