StorageCallbacks.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013    File:        StorageCallbacks.h
00014 
00015    Author:      Klaus Kaempf <kkaempf@suse.de>
00016                 Stanislav Visnovsky <visnov@suse.cz>
00017    Maintainer:  Klaus Kaempf <kkaempf@suse.de>
00018 
00019    Purpose:     Access to the storage callbacks
00020                 Handles StorageCallbacks::function (list_of_arguments) calls
00021 /-*/
00022 
00023 #ifndef StorageCallbacks_h
00024 #define StorageCallbacks_h
00025 
00026 #include <string>
00027 
00028 #include <ycp/YCPBoolean.h>
00029 #include <ycp/YCPValue.h>
00030 #include <ycp/YCPList.h>
00031 #include <ycp/YCPMap.h>
00032 #include <ycp/YCPSymbol.h>
00033 #include <ycp/YCPString.h>
00034 #include <ycp/YCPInteger.h>
00035 #include <ycp/YCPVoid.h>
00036 #include <ycp/YBlock.h>
00037 
00038 #include <y2/Y2Namespace.h>
00039 
00043 class StorageCallbacks : public Y2Namespace
00044 {
00045 public:
00046 
00047     // builtin handling
00048     void registerFunctions ();
00049     vector<string> _registered_functions;
00050 
00051     // callbacks
00052     /* TYPEINFO: void(string) */
00053     YCPValue ProgressBar (const YCPString& func);
00054     /* TYPEINFO: void(string) */
00055     YCPValue ShowInstallInfo (const YCPString& func);
00056     /* TYPEINFO: void(string) */
00057     YCPValue InfoPopup (const YCPString& func);
00058     /* TYPEINFO: void(string) */
00059     YCPValue YesNoPopup (const YCPString& func);
00060 
00064     StorageCallbacks ();
00065 
00069     virtual ~StorageCallbacks ();
00070 
00071     virtual const string name () const
00072     {
00073         return "StorageCallbacks";
00074     }
00075 
00076     virtual const string filename () const
00077     {
00078         return "StorageCallbacks";
00079     }
00080 
00081     virtual string toString () const
00082     {
00083         return "// not possible toString";
00084     }
00085 
00086     virtual YCPValue evaluate (bool cse = false)
00087     {
00088         if (cse) return YCPNull ();
00089         else return YCPVoid ();
00090     }
00091 
00092     virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr type);
00093 
00094     static StorageCallbacks* instance ();
00095 
00096 private:
00097 
00098     static StorageCallbacks* current_instance;
00099 
00100 };
00101 
00102 #endif // StorageCallbacks_h

Generated on Thu Jul 6 00:40:24 2006 for yast2-storage by  doxygen 1.4.6