File indexing completed on 2024-05-12 05:06:11
0001 /* 0002 SPDX-FileCopyrightText: 2016 Christian Dávid <christian-david@web.de> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef INTERFACELOADER_H 0007 #define INTERFACELOADER_H 0008 0009 #include "kmm_plugin_export.h" 0010 0011 namespace KMyMoneyPlugin { 0012 class AppInterface; 0013 class ImportInterface; 0014 class StatementInterface; 0015 class ViewInterface; 0016 } 0017 class KMyMoneyApp; 0018 0019 namespace KMyMoneyPlugin { 0020 0021 class Plugin; 0022 0023 /** 0024 * @internal 0025 * 0026 * This class is used as dead drop to communicate between two compile targets which cannot do 0027 * this directly. 0028 * It is only used by the classes which are named friends. To receive an instance of 0029 * this class @ref pluginInterfaces() is used. 0030 */ 0031 class InterfaceLoader 0032 { 0033 /** 0034 * @{ 0035 * This class is owner of these objects. However, the parent is somebody else. They are deleted by destruction of the parent only. 0036 */ 0037 KMyMoneyPlugin::AppInterface* appInterface; 0038 KMyMoneyPlugin::ViewInterface* viewInterface; 0039 KMyMoneyPlugin::StatementInterface* statementInterface; 0040 KMyMoneyPlugin::ImportInterface* importInterface; 0041 /** @} */ 0042 0043 friend KMyMoneyApp; 0044 friend KMyMoneyPlugin::Plugin; 0045 }; 0046 0047 /** 0048 * @internal 0049 * 0050 * Returns an instance of @ref InterfaceLoader. It is created if needed. 0051 */ 0052 KMM_PLUGIN_EXPORT InterfaceLoader& pluginInterfaces(); 0053 0054 } 0055 0056 #endif