File indexing completed on 2024-05-19 04:29:54

0001 /*
0002  * SPDX-FileCopyrightText: 2012 Friedrich W. H. Kossebau <kossebau@kde.org>
0003  * SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KOICON_H
0007 #define KOICON_H
0008 
0009 #include <kis_icon_utils.h>
0010 #include <QString>
0011 /**
0012  * Macros to support collecting the icons in use.
0013  *
0014  * After any change to this list of macros the file /CheckIcons.sh needs to be
0015  * updated accordingly, to ensure that the icon names of the affected macros are
0016  * still considered in the extraction.
0017  *
0018  * The naming pattern of the macros is like this:
0019  * * koIcon*, kisIcon return a QIcon object
0020  * * koIconName* returns a QLatin1String (aligned with usual API where "iconName" property is of type QString)
0021  * * koIconNameCStr* returns a const char*
0022  */
0023 
0024 /// Use these macros for icons without any issues
0025 #define koIcon(name) (KisIconUtils::loadIcon(QLatin1String(name)))  // Can be used
0026 #define kisIcon(name) (KisIconUtils::loadIcon(name))
0027 #define koIconName(name) (QLatin1String(name))
0028 #define koIconNameCStr(name) (name)
0029 
0030 /// Use these macros if there is a proper icon missing
0031 #define koIconNeeded(comment, neededName) (KisIconUtils::loadIcon(QLatin1String(neededName)))
0032 #define koIconNeededWithSubs(comment, neededName, substituteName) (KisIconUtils::loadIcon(QLatin1String(substituteName)))
0033 #define koIconNameNeeded(comment, neededName) (QLatin1String(neededName))
0034 #define koIconNameNeededWithSubs(comment, neededName, substituteName) (QLatin1String(substituteName))
0035 #define koIconNameCStrNeeded(comment, neededName) (neededName)
0036 #define koIconNameCStrNeededWithSubs(comment, neededName, substituteName) (substituteName)
0037 
0038 #endif