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