yast2-core
Y2WFMComponent.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: Y2WFMComponent.h
14 
15  Author: Stanislav Visnovsky <visnov@suse.cz>
16  Maintainer: Stanislav Visnovsky <visnov@suse.cz>
17 
18 /-*/
19 
20 #ifndef Y2WFMComponent_h
21 #define Y2WFMComponent_h
22 
23 #include <y2/Y2Component.h>
24 
25 #include <ycp/YCPInteger.h>
26 #include <ycp/YCPList.h>
27 #include <ycp/YCPString.h>
28 
29 #include "WFMSubAgent.h"
30 
31 #define MAX_CLIENT_NAME_LEN 160
32 
33 class Y2SystemNamespace;
34 
36 {
37 
38 public:
43 
48 
52  virtual string name() const;
53 
57  virtual YCPValue doActualWork(const YCPList& arglist, Y2Component *displayserver);
58 
59  static Y2WFMComponent* instance();
60 
61  YCPInteger SCROpen (const YCPString& name, const YCPBoolean &check_version);
62  void SCRClose (const YCPInteger& handle);
63  YCPString SCRGetName (const YCPInteger &handle);
64  void SCRSetDefault (const YCPInteger &handle);
65  YCPInteger SCRGetDefault () const;
66  YCPValue Args (const YCPInteger& index = YCPNull ()) const;
67 
73  YCPList SetArgs (const YCPList& new_args);
74  YCPString GetLanguage () const;
75  YCPString GetEncoding () const;
76  YCPString SetLanguage (const YCPString& language, const YCPString& encoding = YCPNull ());
77  YCPValue Read (const YCPPath &path, const YCPValue& arg);
78  YCPValue Write (const YCPPath &path, const YCPValue& arg1, const YCPValue& arg2 = YCPNull ());
79  YCPValue Execute (const YCPPath &path, const YCPValue& arg1);
80  YCPValue CallFunction (const YCPString& client, const YCPList& args = YCPList ());
82  YCPBoolean ClientExists (const YCPString& client);
83 
84  virtual Y2Namespace* import (const char* name_space);
85 
92  void setupComponent (string client_name, string fullname,
93  const YCPValue& script);
94 
95 private:
96 
97  bool createDefaultSCR ();
98 
102  typedef vector <WFMSubAgent*> WFMSubAgents;
103  typedef vector <Y2SystemNamespace*> SystemNamespaces;
104 
107 
111  WFMSubAgents::iterator find_handle (int);
112 
117 
122 
127 
131  const char* get_env_lang () const;
132 
136  string modulename;
137 
144 
147 
152 
157 
158 
160 
165 
169  string client_name;
170 
174  string fullname;
175 };
176 
177 
178 #endif // Y2WFMComponent_h
static Y2WFMComponent * current_wfm
Definition: Y2WFMComponent.h:159
virtual string name() const
Definition: Y2WFMComponent.cc:106
YCPValue CallFunction(const YCPString &client, const YCPList &args=YCPList())
Definition: Y2WFMComponent.cc:697
Definition: Y2WFMComponent.h:35
string client_name
Definition: Y2WFMComponent.h:169
string currentLanguage
Definition: Y2WFMComponent.h:145
void setupComponent(string client_name, string fullname, const YCPValue &script)
Definition: Y2WFMComponent.cc:804
YCPString SetLanguage(const YCPString &language, const YCPString &encoding=YCPNull())
Definition: Y2WFMComponent.cc:476
YCPList argumentlist
Definition: Y2WFMComponent.h:143
Wrapper for YCPIntegerRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPIntegerRep with the arrow operator. See YCPIntegerRep.
Definition: YCPInteger.h:92
Definition: WFMSubAgent.h:33
virtual YCPValue doActualWork(const YCPList &arglist, Y2Component *displayserver)
Definition: Y2WFMComponent.cc:135
SystemNamespaces system_namespaces
Definition: Y2WFMComponent.h:106
YCPValue Args(const YCPInteger &index=YCPNull()) const
Definition: Y2WFMComponent.cc:397
WFMSubAgents::iterator find_handle(int)
Definition: Y2WFMComponent.cc:212
YCPValue script
Definition: Y2WFMComponent.h:164
YCPValue Read(const YCPPath &path, const YCPValue &arg)
Definition: Y2WFMComponent.cc:548
string currentEncoding
Definition: Y2WFMComponent.h:146
string fullname
Definition: Y2WFMComponent.h:174
int handle_cnt
Definition: Y2WFMComponent.h:116
bool createDefaultSCR()
Definition: Y2WFMComponent.cc:112
YCPString GetEnvironmentEncoding()
Definition: Y2WFMComponent.cc:464
void SCRSetDefault(const YCPInteger &handle)
Definition: Y2WFMComponent.cc:346
YCPInteger SCRGetDefault() const
Definition: Y2WFMComponent.cc:384
string systemEncoding
Definition: Y2WFMComponent.h:151
YCPValue Write(const YCPPath &path, const YCPValue &arg1, const YCPValue &arg2=YCPNull())
Definition: Y2WFMComponent.cc:587
void SCRClose(const YCPInteger &handle)
Definition: Y2WFMComponent.cc:283
YCPValue Execute(const YCPPath &path, const YCPValue &arg1)
Definition: Y2WFMComponent.cc:619
~Y2WFMComponent()
Definition: Y2WFMComponent.cc:92
Communication handle to a YaST2 component.
Definition: Y2Component.h:262
YCPString SCRGetName(const YCPInteger &handle)
Definition: Y2WFMComponent.cc:330
Wrapper for YCPStringRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPStringRep with the arrow operator. See YCPStringRep.
Definition: YCPString.h:133
int default_handle
Definition: Y2WFMComponent.h:121
static Y2WFMComponent * instance()
Definition: Y2WFMComponent.cc:812
Wrapper for YCPListRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPListRep with the arrow operator. See YCPListRep.
Definition: YCPList.h:236
string modulename
Definition: Y2WFMComponent.h:136
YCPBoolean ClientExists(const YCPString &client)
Definition: Y2WFMComponent.cc:651
YCPString GetLanguage() const
Definition: Y2WFMComponent.cc:438
const char * get_env_lang() const
Definition: Y2WFMComponent.cc:225
YCPInteger SCROpen(const YCPString &name, const YCPBoolean &check_version)
Definition: Y2WFMComponent.cc:243
YCPList SetArgs(const YCPList &new_args)
Definition: Y2WFMComponent.cc:689
YCPString GetEncoding() const
Definition: Y2WFMComponent.cc:451
Definition: Y2SystemNamespace.h:35
vector< Y2SystemNamespace * > SystemNamespaces
Definition: Y2WFMComponent.h:103
WFMSubAgents scrs
Definition: Y2WFMComponent.h:105
Wrapper for YCPValueRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPValueRep with the arrow operator. See YCPValueRep.
Definition: YCPValue.h:275
Definition: Y2Namespace.h:43
WFMSubAgent local
Definition: Y2WFMComponent.h:126
Wrapper for YCPPathRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPPathRep with the arrow operator. See YCPPathRep.
Definition: YCPPath.h:175
Y2WFMComponent()
Definition: Y2WFMComponent.cc:47
Wrapper for YCPBooleanRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPBooleanRep with the arrow operator. See YCPBooleanRep.
Definition: YCPBoolean.h:93
string environmentEncoding
Definition: Y2WFMComponent.h:156
vector< WFMSubAgent * > WFMSubAgents
Definition: Y2WFMComponent.h:102
Definition: YCPElement.h:125

Generated on a sunny day for yast2-core by doxygen 1.8.5