File indexing completed on 2024-05-12 16:42:15

0001 /*
0002     SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
0003     SPDX-FileCopyrightText: 2020 Dawid Wróbel <me@dawidwrobel.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef ICONS_H
0009 #define ICONS_H
0010 
0011 // ----------------------------------------------------------------------------
0012 // QT Includes
0013 
0014 #include <icons/kmm_icons_export.h>
0015 
0016 // ----------------------------------------------------------------------------
0017 // Project Includes
0018 
0019 class QString;
0020 class QIcon;
0021 
0022 namespace Icons {
0023 
0024 enum class IconSet { Common, Oxygen, Tango, Breeze };
0025 
0026 // clang-format off
0027 enum class Icon { OpenDatabase, Merge, Reconcile, Split, Tip, PerformanceTest,
0028                   Calculator,
0029                   UserProperties, DocumentProperties,
0030                   ZoomIn, ZoomOut,
0031                   Pause, SeekForward,
0032                   SkipForward,
0033                   HideReconciled, HideCategories,
0034                   ShowReconciledBalances,
0035                   Home, Institution, Institutions,
0036                   Accounts,
0037                   Schedule, Tags,
0038                   Payees,
0039                   Investment, Investments, Reports,
0040                   Budget, Forecast,
0041                   OnlineJobOutbox, Filter,
0042                   Loan, Stock,
0043                   Checking,
0044                   Savings,
0045                   LoanAsset, CreditCard,
0046                   Cash, Equity,
0047                   Income, Expense,
0048                   Asset, Liability,
0049                   UpcomingEvents, CalendarDay,
0050                   Ledger, BankAccount,
0051                   Currencies, FinancialCategories,
0052                   Transaction, Bank,
0053                   Calendar,
0054                   TransactionDetails, Close,
0055                   DialogOK, DialogClose, DialogCancel,
0056                   DialogOKApply, DialogError, DialogWarning,
0057                   DialogInformation,
0058                   ListExpand, ListCollapse,
0059                   ListAdd, ListAddUser, ListRemoveUser,
0060                   ListAddTag, ListRemoveTag,
0061                   GoTo, KeyEnter, Download, TagRename,
0062                   EditDelete, EditCopy, EditRename,
0063                   Find, EditUndo, EditClear,
0064                   DocumentEdit,
0065                   DocumentNew, DocumentSave,
0066                   DocumentClose, DocumentOpen,
0067                   DocumentImport, DocumentExport,
0068                   OfficeChartLine,
0069                   MailMessageNew, MailMessage, MailReceive,
0070                   MapOnlineAccount, UnmapOnlineAccount,
0071                   NewSchedule, KMyMoney,
0072                   PayeeRename, PayeeMerge,
0073                   Configure,
0074                   Reconciled, AccountClosed, Unknown,
0075                   Report, Refresh, PreferencesGeneral,
0076                   SortAscending, SortDescending,
0077                   ArrowUp, ArrowDown, ArrowRight, ArrowLeft,
0078                   Warning, TaskComplete,
0079                   TaskReject, TaskAccepted, TaskOngoing,
0080                   Help, Folder,
0081                   PreferencesFonts, PreferencesColors, PreferencesIcons,
0082                   PreferencesNetwork, PreferencesPlugins,
0083                   Empty,
0084                   InstitutionNew, InstitutionEdit, InstitutionDelete,
0085                   AccountNew, AccountEdit, AccountDelete,
0086                   AccountClose, AccountReopen,
0087                   AccountUpdate, AccountUpdateAll,
0088                   AccountCreditTransfer, AccountFinishReconciliation,
0089                   CategoryNew, CategoryEdit, CategoryDelete,
0090                   TransactionNew, TransactionEdit,
0091                   TransactionMatch, TransactionAccept,
0092                   InvestmentNew, InvestmentEdit,
0093                   InvestmentDelete, InvestmentOnlinePrice,
0094                   BudgetNew, BudgetRename, BudgetDelete, BudgetCopy,
0095                   PriceUpdate, InvestmentOnlinePriceAll, Reverse, Visibility, NoVisibility,
0096                   SelectAll,
0097                 };
0098 // clang-format on
0099 
0100 KMM_ICONS_EXPORT void setUpMappings(const QString & themeName);
0101 KMM_ICONS_EXPORT QIcon get(Icons::Icon icon);
0102 
0103 
0104 /**
0105  * return an icon from the application local cache or an icon provided
0106  * by the application. The @a name is formatted as @c type:iconName.
0107  * The following types are supported
0108  *
0109  * - enum
0110  * - favicon
0111  *
0112  * @sa storeIconInApplicationCache(const QString& name, const QIcon& icon)
0113  */
0114 KMM_ICONS_EXPORT QIcon loadIconFromApplicationCache(const QString& name);
0115 
0116 /**
0117  * store the @a icon in the applications local cache directory under the given @a name.
0118  * The @a name is formatted as @c type:iconName.
0119  * The icon will be stored in the file "type-iconName".
0120  *
0121  * @sa loadIconFromApplicationCache(const QString& name)
0122  */
0123 KMM_ICONS_EXPORT bool storeIconInApplicationCache(const QString& name, const QIcon& icon);
0124 }
0125 
0126 #endif