# -*- coding: utf-8 -*-

""""
"chartables" implements various table models of charsets, colors and entities
and provides easy to use interfaces zo include these tables into any application.

At the high level the package implements is a dialog bundling all available tables
in a user interface. For details see "chartables".

At the low level the module implements all tables as QAbstractTableModels
wich may be hosted separately. The various table models are bundeld in
model factories to give an easy to use interface to handle the models.
Again all model factories are bundeld as lists in the modules implementing 
them. For details see "chartables_model_factory" and the modules implementing 
factories like "chartables_models_colors", "chartables_models_ccharsets" and 
"chartables_models_entities".


Sample code:
<pre>
# host a table in a QTableView    
from chrtables.chartables_models_entities import ENTITY_MODELS_FACTORIES

# find the "Xml Entities" model in the list of factories
for factory in ENTITY_MODELS_FACTORIES:
    if factory.name() == "Xml":
        modelClass = factory(0)
        print modelClass.name()
        >>> "Xml Entities"

        # initialize the model and insert it into a table view
        modelInstance = modelClass(parent)

        myTableView.setModel(modelInstance)
        itemDelegate = modelInstance.getItemDelegate()
        if itemDelegate:
            myTableView.setItemDelegate(itemDelegate)
</pre>


The package comes equipped with additional functionality to handle
basic customisations and translated versions of models.

<pre>

from chartables_lang import Language
from chartables_model_options import Options


# install a german translation file to show the german 
# language version of the model
lang = Language()
lang.installTranslator("de")

# set a flag to show the "Hex" and "Int" columns in the model
# wich is not done by default
options = Options()
options.flags = options.CTF_SHOWENTITYHEX | options.CTF_SHOWENTITYINT

modelInstance = modelClass(parent, options=options)
myTableView.setModel(modelInstance)
</pre>


If this all is too troublesome, throw the prefabricated dialog at the user
and and let him* deal with it.

<pre>
from chartables.chartables import CharTablesDialog

dlg = CharTablesDialog()
dlg.show()
result = dlg.exec_()
</pre>



@author Jürgen Urner
"""

__version__ = "0.5.1"
__author__ = "Jürgen Urner"
__email__ = "jUrner@arcor.de"
