Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

Y2WFMComponent.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013    File:        Y2WFMComponent.h
00014 
00015    Author:      Stanislav Visnovsky <visnov@suse.cz>
00016    Maintainer:  Stanislav Visnovsky <visnov@suse.cz>
00017 
00018 /-*/
00019 
00020 #ifndef Y2WFMComponent_h
00021 #define Y2WFMComponent_h
00022 
00023 #include <y2/Y2Component.h>
00024 #include "WFMSubAgent.h"
00025 
00026 #define MAX_CLIENT_NAME_LEN 160
00027 
00028 class Y2WFMComponent : public Y2Component
00029 {
00030 
00031 public:
00035     Y2WFMComponent();
00036 
00040     ~Y2WFMComponent();
00041 
00045     virtual string name() const;
00046 
00050     virtual YCPValue doActualWork(const YCPList& arglist, Y2Component *displayserver);
00051 
00058     virtual YCPValue evaluate(const YCPValue& command);
00059 
00060     static Y2WFMComponent* instance() { return current_wfm; }
00061 
00062     YCPInteger SCROpen (const YCPString& name, const YCPBoolean &check_version);
00063     void SCRClose (const YCPInteger& handle);
00064     YCPString SCRGetName (const YCPInteger &handle);
00065     void SCRSetDefault (const YCPInteger &handle);
00066     YCPInteger SCRGetDefault () const;
00067     YCPValue Args (const YCPInteger& index = YCPNull ()) const;
00068     YCPString GetLanguage () const;
00069     YCPString GetEncoding () const;
00070     YCPString SetLanguage (const YCPString& language, const YCPString& encoding = YCPNull ());
00071     YCPValue Read (const YCPPath &path, const YCPValue& arg);
00072     YCPValue Write (const YCPPath &path, const YCPValue& arg1, const YCPValue& arg2 = YCPNull ());
00073     YCPValue Execute (const YCPPath &path, const YCPValue& arg1);
00074     YCPValue CallFunction (const YCPString& client, const YCPList& args = YCPList ());
00075     YCPString GetEnvironmentEncoding ();
00076 
00077     virtual Y2Namespace* import (const char* name_space);
00078 private:
00079 
00080     bool createDefaultSCR ();
00081 
00085     typedef vector <WFMSubAgent*> WFMSubAgents;
00086     WFMSubAgents scrs;
00087 
00091     WFMSubAgents::iterator find_handle (int);
00092 
00096     int handle_cnt;
00097 
00101     int default_handle;
00102 
00106     WFMSubAgent local;
00107 
00111     const char* get_env_lang () const;
00112 
00116     string modulename;
00117 
00123     YCPList argumentlist;
00124 
00125     string          currentLanguage;
00126     string          currentEncoding;
00127 
00131     string          systemEncoding;
00132 
00136     string          environmentEncoding;
00137 
00138 
00139     static Y2WFMComponent* current_wfm;
00140 };
00141 
00142 
00143 #endif // Y2WFMComponent_h

Generated on Fri Nov 9 18:15:22 2007 for yast2-core by doxygen 1.3.6