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 #undef slots
00022 #include <Python.h>
00023 #define slots
00024 #include <map>
00025 #include <string>
00026 
00027 namespace API{
00028     class EnumModule;
00029 }
00030 
00031 namespace Config
00032 {
00034     class ConfigModule
00035     {
00036     public:
00037         ConfigModule() {}
00039         ConfigModule( PyObject *parent, char *name );
00041         ConfigModule &add( char *name, PyObject *obj);
00043         ConfigModule &add( char *name, const char *str);
00045         ConfigModule &add( char *name, int value, API::EnumModule *_enum=0);
00047         int getInteger(char *name);
00049         char *getString(char *name);
00051         int setInteger(char *name, int value);
00053         int setString(char *name, const char *str);
00055         PyObject *dict();
00057         char *name();
00059         operator PyObject*() { return module; }
00061         API::EnumModule *getEnum(std::string name) { return enum_map[name]; }
00062     private:
00063         PyObject *module;
00064         std::map<std::string, API::EnumModule*> enum_map;
00065     };
00066     
00067     extern ConfigModule edit, view, cute, lang;
00068     
00069     extern "C" void initconfig();
00070 }
00071 
00072 #endif

Generated on Sun May 2 20:02:58 2004 by doxygen 1.3.2