00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: Y2Component.h 00014 00015 Author: Mathias Kettner <kettner@suse.de> 00016 Maintainer: Thomas Roelz <tom@suse.de> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 #ifndef Y2Component_h 00022 #define Y2Component_h 00023 00024 #include "YCP.h" 00025 00026 class SCRAgent; 00027 00068 class Y2Component 00069 { 00070 public: 00071 00072 /* ================ common ================ */ 00073 00074 Y2Component(); 00075 00079 virtual ~Y2Component(); 00080 00084 virtual string name() const = 0; 00085 00086 /* ================ server ================ */ 00087 00099 virtual YCPValue evaluate(const YCPValue& command); 00100 00107 virtual void result(const YCPValue& result); 00108 00120 virtual void setServerOptions(int argc, char **argv); 00121 00128 virtual Y2Component *getCallback (void) const; 00129 virtual void setCallback (Y2Component *callback); 00130 00148 virtual Y2Namespace* import(const char* name_space); 00149 00150 /* ================ client ================ */ 00151 00169 virtual YCPValue doActualWork(const YCPList& arglist, Y2Component *user_interface); 00170 00171 /* ================ misc ================ */ 00172 00179 virtual SCRAgent * getSCRAgent (); 00180 00181 private: 00182 00186 Y2Component *callbackComponent; 00187 }; 00188 00189 #endif // Y2Component_h