QTfrontend/util/DataManager.h
changeset 6937 7f77fa908a4e
parent 6931 86c951cd0f3f
child 6938 217ed62e872c
equal deleted inserted replaced
6936:8af2bf10ee62 6937:7f77fa908a4e
    28 #include <QDir>
    28 #include <QDir>
    29 #include <QFile>
    29 #include <QFile>
    30 
    30 
    31 #include <QStringList>
    31 #include <QStringList>
    32 
    32 
       
    33 #include "ThemeModel.h"
       
    34 
    33 class QDir;
    35 class QDir;
    34 class QFile;
    36 class QFile;
    35 class QStringList;
    37 class QStringList;
       
    38 class ThemeModel;
    36 
    39 
    37 /**
    40 /**
    38  * @brief Offers access to the data files of hedgewars.
    41  * @brief Offers access to the data files of hedgewars.
    39  *
    42  *
    40  * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
    43  * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
    88          * @param relativeDataFilePath relative path of data file write path.
    91          * @param relativeDataFilePath relative path of data file write path.
    89          * @return destination of path data file.
    92          * @return destination of path data file.
    90          */
    93          */
    91         QString findFileForWrite(const QString & relativeDataFilePath) const;
    94         QString findFileForWrite(const QString & relativeDataFilePath) const;
    92 
    95 
       
    96         /**
       
    97          * @brief Returns pointer to a model for the available themes.
       
    98          *
       
    99          * The model is kept up to date automatically.
       
   100          *
       
   101          * @return theme model pointer
       
   102          */
       
   103         ThemeModel * themeModel();
    93 
   104 
    94     public slots:
   105     public slots:
    95         /**
   106         /**
    96          * @brief Reloads data from storage.
   107          * @brief Reloads data from storage.
    97          */
   108          */
   114          *
   125          *
   115          * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
   126          * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
   116          */
   127          */
   117         DataManager();
   128         DataManager();
   118 
   129 
   119         QDir * defaultData; ///< directory of the installed data
   130         QDir * m_defaultData; ///< directory of the installed data
   120         QDir * userData;    ///< directory of custom data in the user's directory
   131         QDir * m_userData;    ///< directory of custom data in the user's directory
       
   132 
       
   133         ThemeModel * m_themeModel; ///< themes model instance
   121 };
   134 };
   122 
   135 
   123 #endif // HEDGEWARS_DATAMANAGER_H
   136 #endif // HEDGEWARS_DATAMANAGER_H