]> icculus.org git repositories - duncan/yast2-ruby-bindings.git/blob - src/ruby/Y2RubyComponent.h
- Lot of fixes and support for the UI!!!
[duncan/yast2-ruby-bindings.git] / src / ruby / Y2RubyComponent.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                                                                      |
10 | ruby language support                              (C) Novell Inc.   |
11 \----------------------------------------------------------------------/
12
13 Author: Duncan Mac-Vicar <dmacvicar@suse.de>
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version
18 2 of the License, or (at your option) any later version.
19
20 */
21
22 #ifndef Y2RubyComponent_h
23 #define Y2RubyComponent_h
24
25 #include "Y2.h"
26
27
28 /**
29  * @short YaST2 Component: Ruby bindings
30  */
31 class Y2RubyComponent : public Y2Component
32 {
33 public:
34     /**
35      * Constructor.
36      */
37     Y2RubyComponent();
38
39     /**
40      * Destructor.
41      */
42     ~Y2RubyComponent();
43
44     /**
45      * The name of this component.
46      */
47     string name() const { return "ruby"; }
48
49     /**
50      * Is called by the generic frontend when the session is finished.
51      */
52     void result( const YCPValue & result );
53
54     /**
55      * Implements the Ruby:: functions.
56      **/
57 // not yet, prototype the transparent bindings first
58 //    YCPValue evaluate( const YCPValue & val );
59
60     /**
61      * Try to import a given namespace. This method is used
62      * for transparent handling of namespaces (YCP modules)
63      * through whole YaST.
64      * @param name_space the name of the required namespace
65      * @return on errors, NULL should be returned. The
66      * error reporting must be done by the component itself
67      * (typically using y2log). On success, the method
68      * should return a proper instance of the imported namespace
69      * ready to be used. The returned instance is still owned
70      * by the component, any other part of YaST will try to
71      * free it. Thus, it's possible to share the instance.
72      */
73     Y2Namespace *import (const char* name);
74 };
75
76 #endif  // Y2RubyComponent_h