yast2-core
Y2ProgramComponent.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: Y2ProgramComponent.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Arvin Schnell <arvin@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 /*
22  * Component that starts an external Y2 program
23  */
24 
25 #ifndef Y2ProgramComponent_h
26 #define Y2ProgramComponent_h
27 
28 #include "Y2.h"
29 #include <ycp/Parser.h>
30 
32 {
36  string chroot_path;
37 
41  string bin_file;
42 
46  bool is_non_y2;
47 
52 
56  int argc;
57 
61  char **argv;
62 
66  int to_external[2];
67 
71  int from_external[2];
72 
77  pid_t pid;
78 
83 
88  int level;
89 
90 public:
91 
92  Y2ProgramComponent (string chroot_path, string binpath,
93  const char *component_name, bool non_y2, int level);
94 
99 
103  string name() const;
104 
110  YCPValue evaluate(const YCPValue& command);
111 
118  void result(const YCPValue& result);
119 
125  void setServerOptions(int argc, char **argv);
126 
130  YCPValue doActualWork(const YCPList& arglist, Y2Component *user_interface);
131 
132  void sendToExternal(const string&);
133 
138 
139 
140  bool remote () const;
141 
142 
143 private:
148  void launchExternalProgram(char** argv);
149 
154 
158  void sendToExternal(const YCPValue&);
159 
163  bool externalProgramOK() const;
164 };
165 
166 
167 #endif // Y2ProgramComponent_h
int from_external[2]
Definition: Y2ProgramComponent.h:71
bool externalProgramOK() const
Definition: Y2ProgramComponent.cc:431
YCPValue evaluate(const YCPValue &command)
Definition: Y2ProgramComponent.cc:69
Y2ProgramComponent(string chroot_path, string binpath, const char *component_name, bool non_y2, int level)
Definition: Y2ProgramComponent.cc:40
string chroot_path
Definition: Y2ProgramComponent.h:36
char ** argv
Definition: Y2ProgramComponent.h:61
string component_name
Definition: Y2ProgramComponent.h:51
string bin_file
Definition: Y2ProgramComponent.h:41
~Y2ProgramComponent()
Definition: Y2ProgramComponent.cc:55
bool is_non_y2
Definition: Y2ProgramComponent.h:46
Definition: Y2ProgramComponent.h:31
YCPValue receiveFromExternal()
Definition: Y2ProgramComponent.cc:353
void setServerOptions(int argc, char **argv)
Definition: Y2ProgramComponent.cc:62
int to_external[2]
Definition: Y2ProgramComponent.h:66
Communication handle to a YaST2 component.
Definition: Y2Component.h:262
bool remote() const
Definition: Y2ProgramComponent.cc:438
void result(const YCPValue &result)
Definition: Y2ProgramComponent.cc:143
void terminateExternalProgram()
Definition: Y2ProgramComponent.cc:333
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
int level
Definition: Y2ProgramComponent.h:88
string name() const
Definition: Y2ProgramComponent.cc:168
int argc
Definition: Y2ProgramComponent.h:56
void sendToExternal(const string &)
Definition: Y2ProgramComponent.cc:390
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
Parser parser
Definition: Y2ProgramComponent.h:82
YCPValue doActualWork(const YCPList &arglist, Y2Component *user_interface)
Definition: Y2ProgramComponent.cc:174
pid_t pid
Definition: Y2ProgramComponent.h:77
void launchExternalProgram(char **argv)
Definition: Y2ProgramComponent.cc:259
YCP language parser.
Definition: Parser.h:64

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