File indexing completed on 2025-01-05 03:58:14
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2009-06-11 0007 * Description : An unit-test to print item info from file using DMetadata. 0008 * 0009 * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_PRINT_ITEM_INFO_UTEST_H 0016 #define DIGIKAM_PRINT_ITEM_INFO_UTEST_H 0017 0018 // Local includes 0019 0020 #include "abstractunittest.h" 0021 #include "dmetadata.h" 0022 0023 using namespace Digikam; 0024 0025 class PrintItemInfoTest : public AbstractUnitTest 0026 { 0027 Q_OBJECT 0028 0029 public: 0030 0031 explicit PrintItemInfoTest(QObject* const parent = nullptr); 0032 0033 private: 0034 0035 void printMetadataMap(const DMetadata::MetaDataMap& map); 0036 void printItemInfo(const QString& filePath, 0037 bool com, bool ttl, // Comments and titles 0038 bool cnt, bool loc, bool isb, // Iptc 0039 bool pho, bool vid, // Media 0040 bool key, bool xsb, bool cat, // Xmp 0041 bool expectedRead 0042 ); 0043 0044 /// NOTE: 'expected' paramareters want mean that we expect a info container non empty 0045 void printComments(const DMetadata& meta, bool expected); 0046 void printTitles(const DMetadata& meta, bool expected); 0047 0048 void printIptcContact(const DMetadata& meta, bool expected); 0049 void printIptcLocation(const DMetadata& meta, bool expected); 0050 void printIptcSubjects(const DMetadata& meta, bool expected); 0051 0052 void printPhotoInfo(const DMetadata& meta, bool expected); 0053 void printVideoInfo(const DMetadata& meta, bool expected); 0054 0055 void printXmpKeywords(const DMetadata& meta, bool expected); 0056 void printXmpSubjects(const DMetadata& meta, bool expected); 0057 void printXmpSubCategories(const DMetadata& meta, bool expected); 0058 0059 private Q_SLOTS: 0060 0061 void testPrintItemInfo(); 0062 }; 0063 0064 #endif // DIGIKAM_PRINT_ITEM_INFO_UTEST_H