yast2-x11: Xf86ConfigAgent.h Source File

Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

# Xf86ConfigAgent.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002
    00003 #ifndef Xf86ConfigAgent_h
    00004 #define Xf86ConfigAgent_h
    00005
    00006
    00007 #include <scr/SCRAgent.h>
    00008 #include <Y2.h>
    00009
    00014 // Simplify access to the map passed to the agent
    00015 //
    00016 typedef struct
    00017 {
    00018     string v;   // value
    00019     string c;   // comment
    00020 } ValueComment;
    00021
    00022 class Xf86ConfigAgent : public SCRAgent
    00023 {
    00024 public:
    00025     Xf86ConfigAgent();
    00026
    00032     YCPValue Read(const YCPPath& path, const YCPValue& arg = YCPNull(), const YCPValue& opt = YCPNull ());
    00033
    00037     YCPBoolean Write(const YCPPath& path, const YCPValue& value, const YCPValue& arg = YCPNull());
    00038
    00042     YCPList Dir(const YCPPath& path);
    00043
    00044 private:
    00045     // Utilities
    00046     void init( void );
    00047     int shellCommand( const string command );
    00048     YCPValue readYCPFile( const string ycp_file );
    00049     YCPValue mergeMaps( YCPMap target, YCPMap source );
    00050     ValueComment getValueComment( const YCPMap config_map, const string key);
    00051
    00052     void writeKeyboardSection( const YCPMap& config_map, FILE* file );
    00053     void writeMouseSection( const YCPMap& config_map, FILE* file );
    00054     void writePathSection( const YCPMap& config_map, FILE* file );
    00055
    00056     // Read whole XF86Config file (only XFree 4)
    00057     YCPValue ReadAllXFree4( const YCPValue& arg = YCPNull() );
    00058
    00059     // Read parts of the XF86Config file (only XFree 4)
    00060     YCPValue ReadXF86Config( const string section, const YCPValue& arg = YCPNull() );
    00061     YCPValue ReadKeyboard( const YCPValue& arg = YCPNull() );
    00062     YCPValue ReadMouse( const YCPValue& arg = YCPNull() );
    00063     YCPValue ReadCard( const YCPValue& arg = YCPNull() );
    00064     YCPValue ReadDesktop( const YCPValue& arg = YCPNull() );
    00065     YCPValue ReadPath( const YCPValue& arg = YCPNull() );
    00066     YCPValue ReadLayout( const YCPValue& arg = YCPNull() );
    00067
    00068     // Write parts of the XF86Config file (only XFree 4)
    00069     YCPBoolean UpdateKeyboard( const YCPMap& config_map, const YCPValue& arg = YCPNull() );
    00070     YCPBoolean UpdateMouse( const YCPMap& config_map, const YCPValue& arg = YCPNull() );
    00071     YCPBoolean UpdatePath( const YCPMap& config_map, const YCPValue& arg = YCPNull() );
    00072 };
    00073
    00074
    00075 #endif // Xf86ConfigAgent_h