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 00081 Y2Component* m_callback; 00082 00083 public: 00084 00085 Y2PluginComponent (bool is_server, string filename, const char* creator_name, 00086 const char* component_name, int level); 00087 00091 ~Y2PluginComponent (); 00092 00096 string name () const; 00097 00103 YCPValue evaluate (const YCPValue& command); 00104 00108 SCRAgent* getSCRAgent (); 00109 00116 void result (const YCPValue& result); 00117 00123 void setServerOptions (int argc, char** argv); 00124 00136 Y2Component* getCallback (void) const; 00137 void setCallback (Y2Component *callback); 00138 00142 YCPValue doActualWork (const YCPList& arglist, Y2Component* user_interface); 00143 00144 private: 00148 bool loadPlugin (); 00149 00153 Y2ComponentCreator* locateSym (int num); 00154 00155 }; 00156 00157 00158 #endif // Y2PluginComponent_h