File indexing completed on 2024-04-21 05:54:08
0001 /** 0002 * SPDX-FileCopyrightText: 2021 by Alexander Stippich <a.stippich@gmx.net> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #ifndef SKANPAGE_UTILS_H 0008 #define SKANPAGE_UTILS_H 0009 0010 #include <memory> 0011 0012 #include <QPageSize> 0013 #include <QTemporaryFile> 0014 #include <QList> 0015 0016 namespace SkanpageUtils { 0017 0018 Q_NAMESPACE 0019 0020 enum MessageLevel { 0021 ErrorMessage, 0022 InformationMessage, 0023 }; 0024 0025 Q_ENUM_NS(MessageLevel) 0026 0027 enum FileType { 0028 EntireDocument, 0029 OCRDocument, 0030 PageSelection, 0031 SharingDocument, 0032 }; 0033 0034 Q_ENUM_NS(FileType) 0035 0036 struct PageProperties { 0037 std::shared_ptr<QTemporaryFile> temporaryFile; 0038 QPageSize pageSize; 0039 int dpi; 0040 int rotationAngle = 0; 0041 }; 0042 0043 typedef QList<PageProperties> DocumentPages; 0044 0045 bool operator==(const PageProperties& lhs, const PageProperties& rhs); 0046 QDebug operator<<(QDebug d, const PageProperties& pageProperties); 0047 } 0048 0049 Q_DECLARE_METATYPE(SkanpageUtils::MessageLevel) 0050 Q_DECLARE_METATYPE(SkanpageUtils::PageProperties) 0051 Q_DECLARE_METATYPE(SkanpageUtils::DocumentPages) 0052 0053 #endif // SKANPAGE_UTILS_H