00001 /* 00002 * File Name: plugin_unknown.h 00003 */ 00004 00005 /* 00006 * This file is part of uds-plugin-common. 00007 * 00008 * uds-plugin-common is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation, either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * uds-plugin-common is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 /** 00023 * Copyright (C) 2008 iRex Technologies B.V. 00024 * All rights reserved. 00025 */ 00026 00027 #ifndef PLUGIN_UNKNOWN_H_ 00028 #define PLUGIN_UNKNOWN_H_ 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 #include "plugin_error.h" 00035 #include "plugin_type.h" 00036 #include "uds_string.h" 00037 00038 typedef struct _IPluginUnknown IPluginUnknown; 00039 00040 /** 00041 * @brief Universal Document Shell plugin unknown interface. 00042 * Through IPluginUnknown, caller is able to access the other interfaces 00043 * by given object. 00044 */ 00045 00046 struct _IPluginUnknown 00047 { 00048 // Define a virtual desctuctor to avoid memory leaks in derived classes. 00049 // Note: IPluginUnknown is intended as a plain C struct, 00050 // but uds and/or plugins use it as a C++ base class. 00051 // This may cause memory leaks because the derived class destructor 00052 // is not called when deleting the base type. 00053 virtual ~_IPluginUnknown() {} 00054 00055 /** 00056 * @brief Query specified interface according to the interface id. 00057 * @param thiz The IPluginUnknown pointer of a specifed object. 00058 * @param id The interface id. 00059 * @param ptr The variable to store the returned interface pointer. 00060 * @return TODO. Add return codes here. 00061 */ 00062 PluginStatus (* query_interface)( IPluginUnknown *thiz, 00063 const UDSString *id, 00064 void **ptr ); 00065 00066 /** 00067 * @brief Release the object. 00068 * @param thiz The IPluginUnknown pointer of a specifed object. 00069 */ 00070 int (* release)( IPluginUnknown *thiz ); 00071 00072 }; 00073 00074 #ifdef __cplusplus 00075 } 00076 #endif 00077 00078 #endif 00079