Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

py_config.h

00001 /***************************************************************************
00002                           py_config.h
00003                              -------------------
00004     begin                : Mon Feb 10 2003
00005     copyright          : (C) 2003 by Heiko Köhler
00006     email                : heicom@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017  
00018 #ifndef __PY_CONFIG_H__
00019 #define __PY_CONFIG_H__
00020  
00021 #include <Python.h>
00022 #include <map>
00023 #include <string>
00024 
00025 namespace API{
00026     class EnumModule;
00027 }
00028 
00029 namespace Config
00030 {
00032     class ConfigModule
00033     {
00034     public:
00035         ConfigModule() {}
00037         ConfigModule( PyObject *parent, char *name );
00039         ConfigModule &add( char *name, PyObject *obj);
00041         ConfigModule &add( char *name, const char *str);
00043         ConfigModule &add( char *name, int value, API::EnumModule *_enum=0);
00045         int getInteger(char *name);
00047         char *getString(char *name);
00049         int setInteger(char *name, int value);
00051         int setString(char *name, char *str);
00053         PyObject *dict();
00055         char *name();
00057         operator PyObject*() { return module; }
00059         API::EnumModule *getEnum(std::string name) { return enum_map[name]; }
00060     private:
00061         PyObject *module;
00062         std::map<std::string, API::EnumModule*> enum_map;
00063     };
00064     
00065     extern ConfigModule edit, view, cute, lang;
00066     
00067     extern "C" void initconfig();
00068 }
00069 
00070 #endif

Generated on Wed Sep 10 03:46:24 2003 by doxygen1.2.18