summaryrefslogtreecommitdiffstats
path: root/libkdchart/KDChartWrapperFactory.cpp
blob: e24b9fe1cd6e5afa9267c443b7fc06baa738e49b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "KDChartWrapperFactory.h"
#include <KDChartTable.h>
#include <tqfont.h>
#include "wrappers/KDChartParamsWrapper.h"
#include "wrappers/KDChartTableDataWrapper.h"
#include "wrappers/KDChartCustomBoxWrapper.h"
#include <KDChartCustomBox.h>
#include "wrappers/KDChartAxisParamsWrapper.h"

KDChartWrapperFactory::KDChartWrapperFactory()
{
    registerWrapper( "KDChartParams", "KDChartParamsWrapper" );
    registerWrapper( "KDChartVectorTableData", "KDChartTableDataWrapper" );
    registerWrapper( "KDChartCustomBox", "KDChartCustomBoxWrapper" );
    registerWrapper( "KDChartAxisParams", "KDChartAxisParamsWrapper" );
}

TQObject* KDChartWrapperFactory::create( const TQString& className, void* ptr )
{
    if ( className == TQString::fromLatin1( "KDChartParams" ) )
        return new KDChartParamsWrapper( static_cast<KDChartParams*>( ptr ) );

    if ( className == TQString::fromLatin1( "KDChartVectorTableData" ) )
        return new KDChartTableDataWrapper( static_cast<KDChartTableData*>( ptr ) );

    if ( className == TQString::fromLatin1( "KDChartCustomBox" ) )
        return new KDChartCustomBoxWrapper( static_cast<KDChartCustomBox*>( ptr ) );

    if ( className == TQString::fromLatin1( "KDChartAxisParams" ) )
        return new KDChartAxisParamsWrapper( static_cast<KDChartAxisParams*>( ptr ) );

    return 0;
}