/** \page rbkconfig_compiler The KDE Configuration Compiler for Ruby rbkconfig_compiler generates Ruby source code from an XML file containing information about configuration options (.kcfg) and a file that provides the code generation options (.kcfgc) The generated class is based on KDE::ConfigSkeleton and provides an API for the application to access its configuration data.
tag. The contents of the \ tag is inserted as-is. A
typical use for this is to compute a common default value which can
then be referenced by multiple entries that follow.
Code generation options
The options for generating the Ruby sources are read from the file with the
extension .kcfgc. To generate a class add the corresponding kcfgc file to the
SOURCES line in the Makefile.am.
The following options are read from the kcfgc file:
Name
Type
Default
Description
File
string
programname.kcfg
Name of kcfg file containing the options the class is generated for
NameSpace
string
-
Optional namespace for generated class
ClassName
string
-
Name of generated class (required)
Inherits
string
KConfigSkeleton
Class the generated class inherits from. This class must inherit
KConfigSkeleton.
Visibility
string
-
Inserts visibility directive (for example KDE_EXPORT) between "class" keyword and class
name in header file
Singleton
bool
false
Generated class is a singleton.
CustomAdditions
bool
-
MemberVariables
string: public|protected|private
private
C++ access modifier used for memeber variables holding the configuration
valuse
IncludeFiles
comma separated list of strings
-
Names of files to be included in the header of the generated class
Mutators
true, false or a comma seperated list of options
-
If true, mutator functions for all configuration options are generated.
If false, no mutator functions are generated. If a list is provided,
mutator functions are generated for the options that are listed.
ItemAccessors
bool
false
Generate accessor functions for the KConfigSkeletonItem objects
corresponding to the configuration options. If SetUserTexts is set,
ItemAccessors also has to be set.
SetUserTexts
bool
false
Set the label and whatthis texts of the items from the kcfg file.If
SetUserTexts is set, ItemAccessors also has to be set.
GlobalEnums
bool
false
If set to true all choices of Enum items will be created in the global
scope of the generated class. If set to false, each Enum item will get an own
namespace for its choices.
Advanced options
There are several possibilities to parameterize entries.
- Parameterized entries
An entry can be parameterized using a fixed range parameter specified with
the \ tag. Such parameter can either be an Enum or an int. An Enum
parameter should specify the possible enumeration values with the \
tag. An int parameter should specify its maximum value. Its minimum value
is always 0.
A parameterized entry is expanded to a number of entries, one for each
value in the parameter range. The name and key should contain a reference
to the parameter in the form of $(parameter-name). When expanding the entries
the $(parameter-name) part is replaced with the value of the parameter.
In the case of an Enum parameter it is replaced with the name of the
enumuration value. In the case of an int parameter it is replaced with
the numeric value of the parameter.
Parameterized entries all share the same default value unless different
default values have been specified for specific parameter values.
This can be done with the param= attribute of the \. When a
param attribute is specified the default value only applies to that
particular parameter value.
Example 1:
\verbatim
#ff0000
#00ff00
#0000ff
#ffff00
\endverbatim
The above describes 4 color configuration entries with the following defaults:
color_0=#ff0000
color_1=#00ff00
color_2=#0000ff
color_3=#ffff00
The configuration options will be accessible to the application via
a color(colorIndex) and a
setColor(colorIndex, v) method.
Example 2:
\verbatim
Explosion
Crash
Missile
boom.wav
crash.wav
missile.wav
\endverbatim
The above describes 3 string configuration entries with the following defaults:
sound_Explosion=boom.wav
sound_Crash=crash.wav
sound_Missile=missile.wav
The configuration options will be accessible to the application via
a sound(soundEvent) and a
setSound(soundEvent, v) method.
- Parameterized groups
...STILL TODO...
If you have questions or comments please contact Cornelius Schumacher
or Waldo Bastian
For Ruby specific questions please contact Richard Dale
*/