/*
* Authors:
* Nicholas Bishop <nicholasbishop@gmail.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
* Copyright (C) 2007 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifndef INKSCAPE_UTIL_ENUMS_H
#define INKSCAPE_UTIL_ENUMS_H
/**
* Simplified management of enumerations of svg items with UI labels.
* IMPORTANT:
* When initializing the EnumData struct, you cannot use _(...) to translate strings.
* Instead, one must use N_(...) and do the translation every time the string is retreived.
*/
struct EnumData
{
E id;
};
/**
* Simplified management of enumerations of svg items with UI labels.
*
* @note that get_id_from_key and get_id_from_label return 0 if it cannot find an entry for that key string.
* @note that get_label and get_key return an empty string when the requested id is not in the list.
*/
{
{}
{
for(unsigned int i = 0; i < _length; ++i) {
}
return (E)0;
}
{
for(unsigned int i = 0; i < _length; ++i) {
}
return (E)0;
}
{
for(unsigned int i = 0; i < _length; ++i) {
return true;
}
return false;
}
{
for(unsigned int i = 0; i < _length; ++i) {
return true;
}
return false;
}
{
for(unsigned int i = 0; i < _length; ++i) {
}
return empty_string;
}
{
for(unsigned int i = 0; i < _length; ++i) {
}
return empty_string;
}
{
return _data[i];
}
const unsigned int _length;
};
}
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :