| 1 | /***************************************************************************** |
| 2 | ** QNapi |
| 3 | ** Copyright (C) 2008-2017 Piotr KrzemiĆski <[email protected]> |
| 4 | ** |
| 5 | ** This program is free software; you can redistribute it and/or modify |
| 6 | ** it under the terms of the GNU General Public License as published by |
| 7 | ** the Free Software Foundation; either version 2 of the License, or |
| 8 | ** (at your option) any later version. |
| 9 | ** |
| 10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | ** |
| 13 | *****************************************************************************/ |
| 14 | |
| 15 | #ifndef LIBQNAPI_H |
| 16 | #define LIBQNAPI_H |
| 17 | |
| 18 | #include "config/configreader.h" |
| 19 | #include "config/configwriter.h" |
| 20 | #include "config/qnapiconfig.h" |
| 21 | #include "config/staticconfig.h" |
| 22 | |
| 23 | #include "engines/subtitledownloadenginesregistry.h" |
| 24 | |
| 25 | #include "movieinfo/movieinfoprovider.h" |
| 26 | |
| 27 | #include "subconvert/subtitleconverter.h" |
| 28 | #include "subconvert/subtitleformatsregistry.h" |
| 29 | |
| 30 | #include "utils/p7zipdecoder.h" |
| 31 | |
| 32 | #include "subtitlematcher.h" |
| 33 | #include "subtitlepostprocessor.h" |
| 34 | |
| 35 | #include <QSharedPointer> |
| 36 | #include <QString> |
| 37 | |
| 38 | class LibQNapi { |
| 39 | public: |
| 40 | LibQNapi(); |
| 41 | |
| 42 | static QString appExecutableFilePath; |
| 43 | static QString appExecutableDir; |
| 44 | |
| 45 | static void init(const QString& appExecutablePath); |
| 46 | |
| 47 | static QString version(); |
| 48 | static QString displayableVersion(); |
| 49 | static QString webpageUrl(); |
| 50 | |
| 51 | static QSharedPointer<const StaticConfig> staticConfig(); |
| 52 | static QSharedPointer<const ConfigReader> configReader(); |
| 53 | static QSharedPointer<const ConfigWriter> configWriter(); |
| 54 | |
| 55 | static const QNapiConfig loadConfig(); |
| 56 | static void writeConfig(const QNapiConfig& config); |
| 57 | static bool isPortableMode(); |
| 58 | static QString portableConfigPath(); |
| 59 | |
| 60 | static QString uiLanguage(const GeneralConfig& generalConfig); |
| 61 | |
| 62 | static QSharedPointer<const SubtitleDownloadEnginesRegistry> |
| 63 | subtitleDownloadEngineRegistry(); |
| 64 | |
| 65 | static QSharedPointer<const MovieInfoProvider> movieInfoProvider(); |
| 66 | |
| 67 | static QSharedPointer<const SubtitleFormatsRegistry> |
| 68 | subtitleFormatsRegistry(); |
| 69 | static QSharedPointer<const SubtitleConverter> subtitleConverter( |
| 70 | const PostProcessingConfig& ppConfig); |
| 71 | |
| 72 | static QSharedPointer<const P7ZipDecoder> p7zipDecoder( |
| 73 | const QString& p7zipPath); |
| 74 | |
| 75 | static QSharedPointer<const SubtitleMatcher> subtitleMatcher( |
| 76 | const QNapiConfig& config); |
| 77 | static QSharedPointer<const SubtitlePostProcessor> subtitlePostProcessor( |
| 78 | const PostProcessingConfig& config); |
| 79 | }; |
| 80 | |
| 81 | #endif // LIBQNAPI_H |