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

Y2WFMComponent Class Reference

#include <Y2WFMComponent.h>

Inheritance diagram for Y2WFMComponent:

Y2Component List of all members.

Public Member Functions

 Y2WFMComponent ()
 ~Y2WFMComponent ()
virtual string name () const
virtual YCPValue doActualWork (const YCPList &arglist, Y2Component *displayserver)
YCPInteger SCROpen (const YCPString &name, const YCPBoolean &check_version)
void SCRClose (const YCPInteger &handle)
 Create a new scr instance.
YCPString SCRGetName (const YCPInteger &handle)
 Close a scr instance.
void SCRSetDefault (const YCPInteger &handle)
 Get the name of a scr instance.
YCPInteger SCRGetDefault () const
 Set's the default scr instance.
YCPValue Args (const YCPInteger &index=YCPNull()) const
 Get's the default scr instance.
YCPString GetLanguage () const
 Returns the arguments with which the module was called. The result is a list whose arguments are the module's arguments. If the module was called with CallFunction("my_mod", [17,true]), Args() will return [ 17, true ].
YCPString GetEncoding () const
 Returns the current language code (without modifiers !).
YCPString SetLanguage (const YCPString &language, const YCPString &encoding=YCPNull())
 Returns the encoding code of the environment where yast is started.
YCPValue Read (const YCPPath &path, const YCPValue &arg)
 Selects the language for translate().
YCPValue Write (const YCPPath &path, const YCPValue &arg1, const YCPValue &arg2=YCPNull())
 Special interface to the system agent. Not for general use.
YCPValue Execute (const YCPPath &path, const YCPValue &arg1)
 Special interface to the system agent. Not for general use.
YCPValue CallFunction (const YCPString &client, const YCPList &args=YCPList())
 Special interface to the system agent. Not for general use.
YCPString GetEnvironmentEncoding ()
 Returns the current encoding code.
virtual Y2Namespaceimport (const char *name_space)
 Executes a YCP client or a Y2 client component.
void setupComponent (string client_name, string fullname, const YCPValue &script)

Static Public Member Functions

static Y2WFMComponentinstance ()

Private Types

typedef vector< WFMSubAgent * > WFMSubAgents

Private Member Functions

bool createDefaultSCR ()
WFMSubAgents::iterator find_handle (int)
const char * get_env_lang () const

Private Attributes

WFMSubAgents scrs
int handle_cnt
int default_handle
WFMSubAgent local
string modulename
YCPList argumentlist
string currentLanguage
string currentEncoding
string systemEncoding
string environmentEncoding
YCPValue script
string client_name
string fullname

Static Private Attributes

static Y2WFMComponentcurrent_wfm = 0

Member Typedef Documentation

typedef vector<WFMSubAgent*> Y2WFMComponent::WFMSubAgents [private]
 

Type and list of SCR instances.


Constructor & Destructor Documentation

Y2WFMComponent::Y2WFMComponent  ) 
 

Creates a new WFM component

Y2WFMComponent::~Y2WFMComponent  ) 
 

Cleans up


Member Function Documentation

YCPValue Y2WFMComponent::Args const YCPInteger &  i = YCPNull ()  )  const
 

Get's the default scr instance.

Args

Returns:
list List of arguments

YCPValue Y2WFMComponent::CallFunction const YCPString client,
const YCPList args = YCPList ()
 

Special interface to the system agent. Not for general use.

call

Parameters:
string name client name
list arguments list of arguments
This implies * that the called YCP code has full access to all module status in the currently running YaST.

The modulename is temporarily changed to the name of the called script or a component.

In the example, WFM looks for the file YAST2HOME/clients/inst_mouse.ycp and executes it. If the client is not found, a Y2 client component is tried to be created.

call ("inst_mouse", [true, false]) -> ....

Returns:
any

bool Y2WFMComponent::createDefaultSCR  )  [private]
 

YCPValue Y2WFMComponent::doActualWork const YCPList arglist,
Y2Component displayserver
[virtual]
 

Executes the YCP script.

Reimplemented from Y2Component.

YCPValue Y2WFMComponent::Execute const YCPPath path,
const YCPValue arg1
 

Special interface to the system agent. Not for general use.

Execute

Parameters:
path path Path any options
Returns:
any

Y2WFMComponent::WFMSubAgents::iterator Y2WFMComponent::find_handle int   )  [private]
 

Finds a SCR instance to a given handle.

const char * Y2WFMComponent::get_env_lang  )  const [private]
 

Get the language from the environment.

YCPString Y2WFMComponent::GetEncoding  )  const
 

Returns the current language code (without modifiers !).

GetEncoding

Returns:
string Encoding

YCPString Y2WFMComponent::GetEnvironmentEncoding  ) 
 

Returns the current encoding code.

GetEnvironmentEncoding

Returns:
string encoding code of the environment

YCPString Y2WFMComponent::GetLanguage  )  const
 

Returns the arguments with which the module was called. The result is a list whose arguments are the module's arguments. If the module was called with CallFunction("my_mod", [17,true]), Args() will return [ 17, true ].

GetLanguage

Returns:
string Language

Y2Namespace * Y2WFMComponent::import const char *  name_space  )  [virtual]
 

Executes a YCP client or a Y2 client component.

Reimplemented from Y2Component.

Y2WFMComponent * Y2WFMComponent::instance  )  [static]
 

string Y2WFMComponent::name  )  const [virtual]
 

Returns "wfm";

Implements Y2Component.

YCPValue Y2WFMComponent::Read const YCPPath path,
const YCPValue arg
 

Selects the language for translate().

Read

Parameters:
path path Path any options
Returns:
any

void Y2WFMComponent::SCRClose const YCPInteger &  h  ) 
 

Create a new scr instance.

SCRClose

Parameters:
integer handle SCR handle
Returns:
void

YCPInteger Y2WFMComponent::SCRGetDefault  )  const
 

Set's the default scr instance.

SCRGetDefault

Returns:
integer Default SCR handle

YCPString Y2WFMComponent::SCRGetName const YCPInteger &  h  ) 
 

Close a scr instance.

SCRGetName

Parameters:
integer handle SCR handle
Returns:
string Name

YCPInteger Y2WFMComponent::SCROpen const YCPString scrname,
const YCPBoolean checkversion
 

SCROpen

Create a new scr instance. The name must be a valid y2component name (e.g. "scr", "chroot=/mnt:scr"). The component is created immediately. The parameter check_version determines whether the SuSE Version should be checked. On error a negative value is returned.

Parameters:
string name a valid y2component name
boolean check_version determines whether the SuSE Version should be checked
Returns:
integer On error a negative value is returned.

void Y2WFMComponent::SCRSetDefault const YCPInteger &  handle  ) 
 

Get the name of a scr instance.

SCRSetDefault

Parameters:
integer handle SCR handle
Returns:
void

YCPString Y2WFMComponent::SetLanguage const YCPString language,
const YCPString encoding = YCPNull ()
 

Returns the encoding code of the environment where yast is started.

SetLanguage

Parameters:
string language string encoding SetLanguage("de_DE", "UTF-8") -> "" SetLanguage("de_DE@euro") -> "ISO-8859-15"
The "<proposed encoding>" is the output of 'nl_langinfo (CODESET)' and only given if SetLanguage() is called with a single argument.

Returns:
string proposed encoding have fun

void Y2WFMComponent::setupComponent string  client_name,
string  fullname,
const YCPValue script
 

Setups this script component.

Parameters:
the name of the component that is realized be the script.
script the script. This component clones it, so you can destroy the script after the constructor call.

YCPValue Y2WFMComponent::Write const YCPPath path,
const YCPValue arg1,
const YCPValue arg2 = YCPNull ()
 

Special interface to the system agent. Not for general use.

Write

Parameters:
path path Path any options
Returns:
boolean


Member Data Documentation

YCPList Y2WFMComponent::argumentlist [private]
 

Arguments of the module that is realized through the wfm. The script has access to it via the builtin args(). The symbol of the term itself is the module name.

string Y2WFMComponent::client_name [private]
 

The name of the client that is implemented by the script.

Y2WFMComponent * Y2WFMComponent::current_wfm = 0 [static, private]
 

string Y2WFMComponent::currentEncoding [private]
 

string Y2WFMComponent::currentLanguage [private]
 

int Y2WFMComponent::default_handle [private]
 

Handle of default SCR instance.

string Y2WFMComponent::environmentEncoding [private]
 

environment encoding

string Y2WFMComponent::fullname [private]
 

The fullname of the script file.

int Y2WFMComponent::handle_cnt [private]
 

Handle count.

WFMSubAgent Y2WFMComponent::local [private]
 

The local system agent.

string Y2WFMComponent::modulename [private]
 

The name of the module that is realized by this wfm.

YCPValue Y2WFMComponent::script [private]
 

The script that implements the component.

WFMSubAgents Y2WFMComponent::scrs [private]
 

string Y2WFMComponent::systemEncoding [private]
 

system encoding


The documentation for this class was generated from the following files:
Generated on Tue Mar 22 11:35:49 2005 for yast2-core by  doxygen 1.4.1