Settings.h 1.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*****************************************************************************
 * Media Library
 *****************************************************************************
 * Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
 *
 * Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef SETTINGS_H
#define SETTINGS_H

#include "Types.h"
27
#include <cstdint>
28

29 30 31
namespace medialibrary
{

32 33 34 35 36 37
namespace sqlite
{
class Connection;
}


38 39 40
class Settings
{
public:
41 42
    Settings( MediaLibrary* ml );
    bool load();
43 44 45 46 47
    /**
     * @brief dbModelVersion returns the current database model version.
     *
     * This can be different from the \ref DbModelVersion when upgrading the model
     */
48 49 50 51
    uint32_t dbModelVersion() const;
    bool save();
    void setDbModelVersion( uint32_t dbModelVersion );

52
    static void createTable( sqlite::Connection* dbConn );
53

54 55
    static const uint32_t DbModelVersion;

56
private:
57
    MediaLibrary* m_ml;
58 59 60 61 62 63

    uint32_t m_dbModelVersion;

    bool m_changed;
};

64 65
}

66
#endif // SETTINGS_H