00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: Y2ScriptComponent.h 00014 00015 Author: Stanislav Visnovsky <visnov@suse.cz> 00016 Maintainer: Stanislav Visnovsky <visnov@suse.cz> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 /* 00022 * Component that starts wfm to execute a YCP script 00023 * 00024 * Author: Mathias Kettner <kettner@suse.de> 00025 */ 00026 00027 #ifndef Y2ScriptComponent_h 00028 #define Y2ScriptComponent_h 00029 00030 #include <y2/Y2Component.h> 00031 00032 class Y2ScriptComponent : public Y2Component 00033 { 00037 YCPValue script; 00038 00042 string client_name; 00043 00047 string fullname; 00048 00049 Y2Component* m_wfm; 00050 00051 Y2Component* wfm_instance (); 00052 00053 static Y2ScriptComponent* m_instance; 00054 00055 public: 00056 00057 Y2ScriptComponent (); 00058 00065 void setupComponent (string client_name, string fullname, 00066 const YCPValue& script); 00067 00071 ~Y2ScriptComponent(); 00072 00076 virtual string name() const; 00077 00081 virtual YCPValue evaluate (const YCPValue& command); 00082 00087 virtual YCPValue doActualWork(const YCPList& arglist, Y2Component *user_interface); 00088 00089 virtual Y2Namespace* import (const char* name_space); 00090 00091 static Y2ScriptComponent* instance(); 00092 00093 }; 00094 00095 00096 #endif // Y2ScriptComponent_h