00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: Y2PluginComponent.h 00014 00015 Author: Arvin Schnell <arvin@suse.de> 00016 Maintainer: Arvin Schnell <arvin@suse.de> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 /* 00022 * Component that starts a plugin 00023 */ 00024 00025 #ifndef Y2PluginComponent_h 00026 #define Y2PluginComponent_h 00027 00028 #include "Y2.h" 00029 00030 class Y2PluginComponent : public Y2Component 00031 { 00035 const bool is_server; 00036 00040 string filename; 00041 00045 string creator_name; 00046 00050 string component_name; 00051 00055 int argc; 00056 00060 char** argv; 00061 00065 int level; 00066 00070 void* handle; 00071 00075 Y2Component* comp; 00076 00077 public: 00078 00079 Y2PluginComponent (bool is_server, string filename, const char* creator_name, 00080 const char* component_name, int level); 00081 00082 Y2PluginComponent (string filename, const char* creator_name, 00083 const char* component_name, const char* name_space); 00087 ~Y2PluginComponent (); 00088 00092 string name () const; 00093 00099 YCPValue evaluate (const YCPValue& command); 00100 00104 SCRAgent* getSCRAgent (); 00105 00106 Y2Namespace* import (const char* name_space); 00107 00114 void result (const YCPValue& result); 00115 00121 void setServerOptions (int argc, char** argv); 00122 00126 YCPValue doActualWork (const YCPList& arglist, Y2Component* user_interface); 00127 00132 Y2Component* component () { return comp; } 00133 00134 private: 00138 bool loadPlugin (const char* name_space = NULL); 00139 00143 Y2ComponentCreator* locateSym (int num); 00144 00145 }; 00146 00147 00148 #endif // Y2PluginComponent_h