File indexing completed on 2025-03-09 03:57:05
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2009-09-14 0007 * Description : a class to build the tooltip for a renameparser and its options 0008 * 0009 * SPDX-FileCopyrightText: 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_TOOL_TIPCREATOR_H 0016 #define DIGIKAM_TOOL_TIPCREATOR_H 0017 0018 // Qt includes 0019 0020 #include <QString> 0021 0022 // Local includes 0023 0024 #include "rule.h" 0025 0026 namespace Digikam 0027 { 0028 0029 class Parser; 0030 0031 class TooltipCreator 0032 { 0033 public: 0034 0035 ~TooltipCreator() 0036 { 0037 }; 0038 0039 static TooltipCreator& getInstance(); 0040 0041 QString tooltip(Parser* parser); 0042 0043 private: 0044 0045 QIcon getInfoIcon() const; 0046 QString getInfoIconBase64() const; 0047 0048 /// common methods 0049 0050 QString markOption(const QString& str); 0051 QString tableStart(); 0052 QString tableStart(int widthPercentage); 0053 QString tableEnd(); 0054 0055 QString additionalInformation(); 0056 0057 /// parse object related methods 0058 0059 QString createEntries(const RulesList& data); 0060 QString createSection(const QString& sectionName, const RulesList& data, bool lastSection = false); 0061 QString createHeader(const QString& str); 0062 0063 private: 0064 0065 // Disable 0066 explicit TooltipCreator() = default; 0067 TooltipCreator(const TooltipCreator&) = delete; 0068 TooltipCreator& operator=(const TooltipCreator&) = delete; 0069 0070 }; 0071 0072 } // namespace Digikam 0073 0074 #endif // DIGIKAM_TOOL_TIPCREATOR_H