File indexing completed on 2024-05-19 05:07:44

0001 /*
0002     SPDX-FileCopyrightText: 2008 Thomas Baumgart <ipwizard@users.sourceforge.net>
0003     SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KMMAPPINTERFACE_H
0008 #define KMMAPPINTERFACE_H
0009 
0010 // ----------------------------------------------------------------------------
0011 // QT Includes
0012 
0013 #include <QUrl>
0014 
0015 // ----------------------------------------------------------------------------
0016 // KDE Includes
0017 
0018 // ----------------------------------------------------------------------------
0019 // Project Includes
0020 
0021 #include "appinterface.h"
0022 
0023 class KMyMoneyApp;
0024 
0025 namespace KMyMoneyPlugin {
0026 /**
0027  * This class represents the implementation of the
0028  * AppInterface.
0029  */
0030 class KMMAppInterface : public AppInterface
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     explicit KMMAppInterface(KMyMoneyApp* app, QObject* parent, const char* name = 0);
0036     ~KMMAppInterface() override = default;
0037 
0038     /**
0039      * Makes sure that a MyMoneyFile is open and has been created successfully.
0040      *
0041      * @return Whether the file is open and initialised
0042      */
0043     bool fileOpen() override;
0044 
0045     bool isDatabase() override;
0046     bool isNativeFile() override;
0047     QUrl filenameURL() const override;
0048     void writeFilenameURL(const QUrl& url) override;
0049     QUrl lastOpenedURL() override;
0050     void writeLastUsedFile(const QString& fileName) override;
0051     void slotFileOpenRecent(const QUrl& url) override;
0052     void addToRecentFiles(const QUrl& url) override;
0053     KMyMoneyAppCallback progressCallback() override;
0054     void writeLastUsedDir(const QString& directory) override;
0055     QString readLastUsedDir() const override;
0056     void consistencyCheck(bool alwaysDisplayResult) override;
0057 
0058 private:
0059     KMyMoneyApp* m_app;
0060 };
0061 
0062 }
0063 
0064 #endif