Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
22 andreas 1
/*
2
 * Copyright (C) 2021 by Andreas Theofilu <andreas@theosys.at>
3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
#ifndef TTPINIT_H
19
#define TTPINIT_H
20
 
21
#include <string>
120 andreas 22
#include <functional>
22 andreas 23
 
24
class TTPInit
25
{
26
    public:
27
        TTPInit(const std::string& path);
51 andreas 28
        TTPInit();
22 andreas 29
 
51 andreas 30
        void setPath(const std::string& p) { mPath = p; }
31
        bool createDirectoryStructure();
115 andreas 32
        bool loadSurfaceFromController(bool force=false);
51 andreas 33
 
120 andreas 34
        int progressCallback(off64_t xfer);
35
        void regCallbackProcessEvents(std::function<void ()> pe) { _processEvents = pe; }
36
 
22 andreas 37
    private:
120 andreas 38
        std::function<void ()> _processEvents{nullptr};
39
 
22 andreas 40
        bool createPanelConfigs();
117 andreas 41
        bool createSystemConfigs();
50 andreas 42
        bool _makeDir(const std::string& dir);
113 andreas 43
        bool copyFile(const std::string& fname);
43 andreas 44
#ifdef __ANDROID__
45
        bool askPermissions();
46
#endif
22 andreas 47
        std::string mPath;
48
};
49
 
50
#endif // TTPINIT_H