yast2-core
Y2PluginComponent.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: Y2PluginComponent.h
14 
15  Author: Arvin Schnell <arvin@suse.de>
16  Maintainer: Arvin Schnell <arvin@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 /*
22  * Component that starts a plugin
23  */
24 
25 #ifndef Y2PluginComponent_h
26 #define Y2PluginComponent_h
27 
28 #include "Y2.h"
29 
31 {
35  const bool is_server;
36 
40  string filename;
41 
45  string creator_name;
46 
51 
55  int argc;
56 
60  char** argv;
61 
65 #ifdef __clang__
66  int level __attribute__((__unused__));
67  // 'level' can be removed for SLE13; now keeping it for ABI.
68 #else
69  int level;
70 #endif
71 
75  void* handle;
76 
81 
82 public:
83 
84  Y2PluginComponent (bool is_server, string filename, const char* creator_name,
85  const char* component_name, int level);
86 
87  Y2PluginComponent (string filename, const char* creator_name,
88  const char* component_name, const char* name_space);
93 
97  string name () const;
98 
104  YCPValue evaluate (const YCPValue& command);
105 
109  SCRAgent* getSCRAgent ();
110 
111  Y2Namespace* import (const char* name_space);
112 
119  void result (const YCPValue& result);
120 
126  void setServerOptions (int argc, char** argv);
127 
131  YCPValue doActualWork (const YCPList& arglist, Y2Component* user_interface);
132 
137  Y2Component* component () { return comp; }
138 
139 private:
143  bool loadPlugin (const char* name_space = NULL);
144 
148  Y2ComponentCreator* locateSym (int num);
149 
150 };
151 
152 
153 #endif // Y2PluginComponent_h
void * handle
Definition: Y2PluginComponent.h:75
string creator_name
Definition: Y2PluginComponent.h:45
SCRAgent * getSCRAgent()
Definition: Y2PluginComponent.cc:115
Y2Component * comp
Definition: Y2PluginComponent.h:80
Y2Component * component()
Definition: Y2PluginComponent.h:137
string component_name
Definition: Y2PluginComponent.h:50
~Y2PluginComponent()
Definition: Y2PluginComponent.cc:68
string filename
Definition: Y2PluginComponent.h:40
bool loadPlugin(const char *name_space=NULL)
Definition: Y2PluginComponent.cc:202
static int variable_not_used __attribute__((unused))
YCPValue doActualWork(const YCPList &arglist, Y2Component *user_interface)
Definition: Y2PluginComponent.cc:173
Communication handle to a YaST2 component.
Definition: Y2Component.h:262
Y2PluginComponent(bool is_server, string filename, const char *creator_name, const char *component_name, int level)
Definition: Y2PluginComponent.cc:33
SuSE Configuration Repository Agent.
Definition: SCRAgent.h:37
YCPValue evaluate(const YCPValue &command)
Definition: Y2PluginComponent.cc:97
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
const bool is_server
Definition: Y2PluginComponent.h:35
Definition: Y2PluginComponent.h:30
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
void setServerOptions(int argc, char **argv)
Definition: Y2PluginComponent.cc:84
Definition: Y2Namespace.h:43
string name() const
Definition: Y2PluginComponent.cc:164
char ** argv
Definition: Y2PluginComponent.h:60
int level
Definition: Y2PluginComponent.h:69
Can create certain YaST2 components As documented in Y2Component, there are many ways how to realize ...
Definition: Y2ComponentCreator.h:43
int argc
Definition: Y2PluginComponent.h:55
Y2ComponentCreator * locateSym(int num)
Definition: Y2PluginComponent.cc:293
void result(const YCPValue &result)
Definition: Y2PluginComponent.cc:149

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