File indexing completed on 2024-04-28 16:30:31
0001 /*************************************************************************** 0002 * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr 0003 * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 ***************************************************************************/ 0006 #ifndef SKGDOCUMENTPRIVATE_H 0007 #define SKGDOCUMENTPRIVATE_H 0008 /** @file 0009 * This file defines classes SKGDocumentPrivate. 0010 * 0011 * @author Stephane MANKOWSKI / Guillaume DE BURE 0012 */ 0013 0014 #include <qfuturewatcher.h> 0015 #include <qhash.h> 0016 #include <qsqldatabase.h> 0017 #include <qstringlist.h> 0018 0019 #include <functional> 0020 0021 #include "skgdefine.h" 0022 #include "skgerror.h" 0023 #include "skgservices.h" 0024 0025 using FuncProgress = std::function<int(int, qint64, const QString&, void*)>; 0026 using checksFunction = SKGError(*)(SKGDocument*); 0027 0028 /** 0029 * This class manages skg documents 0030 */ 0031 class SKGDocumentPrivate 0032 { 0033 public: 0034 /** 0035 * Constructor 0036 */ 0037 explicit SKGDocumentPrivate(); 0038 0039 /** 0040 * Destructor 0041 */ 0042 virtual ~SKGDocumentPrivate(); 0043 0044 static SKGError m_lastCallbackError; 0045 0046 static int m_databaseUniqueIdentifier; 0047 0048 int m_lastSavedTransaction{0}; 0049 FuncProgress m_progressFunction{nullptr}; 0050 QList<checksFunction> m_checkFunctions; 0051 void* m_progressData{nullptr}; 0052 QString m_currentFileName; 0053 QString m_databaseIdentifier; 0054 QSqlDatabase m_currentDatabase; 0055 SKGIntList m_nbStepForTransaction; 0056 SKGIntList m_posStepForTransaction; 0057 QStringList m_nameForTransaction; 0058 int m_inundoRedoTransaction{0}; 0059 int m_currentTransaction{0}; 0060 qint64 m_timeBeginTransaction{0}; 0061 QString m_temporaryFile; 0062 QString m_uniqueIdentifier; 0063 // SKGMessageList m_unTransactionnalMessages; 0064 QMap<QString, QStringList> m_ImpactedViews; 0065 QMap<QString, QStringList> m_MaterializedViews; 0066 0067 QHash<QString, QString> m_cache; 0068 QHash<QString, SKGStringListList>* m_cacheSql; 0069 bool m_inProgress{false}; 0070 QString m_backupPrefix; 0071 QString m_backupSuffix; 0072 bool m_directAccessDb{false}; 0073 bool m_modeReadOnly{false}; 0074 bool m_modeSQLCipher{false}; 0075 QList<QFutureWatcher<SKGStringListList>*> m_watchers; 0076 0077 bool m_blockEmits{false}; 0078 QMutex m_mutex; 0079 QString m_password; 0080 bool m_password_got{false}; 0081 }; 0082 #endif