1 /* 2 Copyright © 2019 by The qTox Project Contributors 3 4 This file is part of qTox, a Qt-based graphical interface for Tox. 5 6 qTox is libre software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 qTox is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with qTox. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef PATHS_H 21 #define PATHS_H 22 23 #include <QString> 24 #include <QStringList> 25 26 class Paths 27 { 28 public: 29 enum class Portable { 30 Auto, /** Auto detect if portable or non-portable */ 31 Portable, /** Force portable mode */ 32 NonPortable /** Force non-portable mode */ 33 }; 34 35 static Paths* makePaths(Portable mode = Portable::Auto); 36 37 bool isPortable() const; 38 QString getGlobalSettingsPath() const; 39 QString getProfilesDir() const; 40 QString getToxSaveDir() const; 41 QString getAvatarsDir() const; 42 QString getTransfersDir() const; 43 QStringList getThemeDirs() const; 44 QString getScreenshotsDir() const; 45 46 private: 47 Paths(const QString &basePath, bool portable); 48 49 private: 50 QString basePath{}; 51 bool portable = false; 52 }; 53 54 #endif // PATHS_H 55