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 
34 {
35 
36 public:
41 
46 
50  virtual string name() const;
51 
55  virtual YCPValue doActualWork(const YCPList& arglist, Y2Component *displayserver);
56 
57  static Y2WFMComponent* instance();
58 
59  YCPInteger SCROpen (const YCPString& name, const YCPBoolean &check_version);
60  void SCRClose (const YCPInteger& handle);
61  YCPString SCRGetName (const YCPInteger &handle);
62  void SCRSetDefault (const YCPInteger &handle);
63  YCPInteger SCRGetDefault () const;
64  YCPValue Args (const YCPInteger& index = YCPNull ()) const;
65 
71  YCPList SetArgs (const YCPList& new_args);
72  YCPString GetLanguage () const;
73  YCPString GetEncoding () const;
74  YCPString SetLanguage (const YCPString& language, const YCPString& encoding = YCPNull ());
75  YCPValue Read (const YCPPath &path, const YCPValue& arg);
76  YCPValue Write (const YCPPath &path, const YCPValue& arg1, const YCPValue& arg2 = YCPNull ());
77  YCPValue Execute (const YCPPath &path, const YCPValue& arg1);
78  YCPValue CallFunction (const YCPString& client, const YCPList& args = YCPList ());
80  YCPBoolean ClientExists (const YCPString& client);
81 
82  virtual Y2Namespace* import (const char* name_space);
83 
90  void setupComponent (string client_name, string fullname,
91  const YCPValue& script);
92 
93 private:
94 
95  bool createDefaultSCR ();
96 
100  typedef vector <WFMSubAgent*> WFMSubAgents;
101 
103 
107  WFMSubAgents::iterator find_handle (int);
108 
113 
118 
123 
127  const char* get_env_lang () const;
128 
132  string modulename;
133 
140 
143 
148 
153 
154 
156 
161 
165  string client_name;
166 
170  string fullname;
171 };
172 
173 
174 #endif // Y2WFMComponent_h
static Y2WFMComponent * current_wfm
Definition: Y2WFMComponent.h:155
virtual string name() const
Definition: Y2WFMComponent.cc:105
YCPValue CallFunction(const YCPString &client, const YCPList &args=YCPList())
Definition: Y2WFMComponent.cc:674
Definition: Y2WFMComponent.h:33
string client_name
Definition: Y2WFMComponent.h:165
string currentLanguage
Definition: Y2WFMComponent.h:141
void setupComponent(string client_name, string fullname, const YCPValue &script)
Definition: Y2WFMComponent.cc:743
YCPString SetLanguage(const YCPString &language, const YCPString &encoding=YCPNull())
Definition: Y2WFMComponent.cc:453
YCPList argumentlist
Definition: Y2WFMComponent.h:139
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:136
YCPValue Args(const YCPInteger &index=YCPNull()) const
Definition: Y2WFMComponent.cc:374
WFMSubAgents::iterator find_handle(int)
Definition: Y2WFMComponent.cc:213
YCPValue script
Definition: Y2WFMComponent.h:160
YCPValue Read(const YCPPath &path, const YCPValue &arg)
Definition: Y2WFMComponent.cc:525
string currentEncoding
Definition: Y2WFMComponent.h:142
string fullname
Definition: Y2WFMComponent.h:170
int handle_cnt
Definition: Y2WFMComponent.h:112
bool createDefaultSCR()
Definition: Y2WFMComponent.cc:111
YCPString GetEnvironmentEncoding()
Definition: Y2WFMComponent.cc:441
void SCRSetDefault(const YCPInteger &handle)
Definition: Y2WFMComponent.cc:337
YCPInteger SCRGetDefault() const
Definition: Y2WFMComponent.cc:361
string systemEncoding
Definition: Y2WFMComponent.h:147
YCPValue Write(const YCPPath &path, const YCPValue &arg1, const YCPValue &arg2=YCPNull())
Definition: Y2WFMComponent.cc:564
void SCRClose(const YCPInteger &handle)
Definition: Y2WFMComponent.cc:281
YCPValue Execute(const YCPPath &path, const YCPValue &arg1)
Definition: Y2WFMComponent.cc:596
~Y2WFMComponent()
Definition: Y2WFMComponent.cc:91
Communication handle to a YaST2 component.
Definition: Y2Component.h:262
YCPString SCRGetName(const YCPInteger &handle)
Definition: Y2WFMComponent.cc:318
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:117
static Y2WFMComponent * instance()
Definition: Y2WFMComponent.cc:751
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:132
YCPBoolean ClientExists(const YCPString &client)
Definition: Y2WFMComponent.cc:628
YCPString GetLanguage() const
Definition: Y2WFMComponent.cc:415
const char * get_env_lang() const
Definition: Y2WFMComponent.cc:226
YCPInteger SCROpen(const YCPString &name, const YCPBoolean &check_version)
Definition: Y2WFMComponent.cc:244
YCPList SetArgs(const YCPList &new_args)
Definition: Y2WFMComponent.cc:666
YCPString GetEncoding() const
Definition: Y2WFMComponent.cc:428
WFMSubAgents scrs
Definition: Y2WFMComponent.h:102
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:122
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:46
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:152
vector< WFMSubAgent * > WFMSubAgents
Definition: Y2WFMComponent.h:100
Definition: YCPElement.h:125

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