summaryrefslogtreecommitdiffstats
path: root/kchart/kchart_view.h
blob: c8d5784e3ad7ac4167bd975f689f4961ab22e639 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/**
 *
 * Kalle Dalheimer <kalle@kde.org>
 */

#ifndef KCHART_VIEW
#define KCHART_VIEW


#include <KoView.h>
#include "kdchart/KDChartAxisParams.h"

class TDEAction;
class TDEToggleAction;
class TQPaintEvent;

class DCOPObject;

namespace KChart
{

class KChartPart;
class kchartDataEditor;

class KChartView : public KoView
{
    Q_OBJECT
  
public:
    KChartView( KChartPart* part, TQWidget* parent = 0, const char* name = 0 );
    ~KChartView();

    void updateGuiTypeOfChart();
    virtual DCOPObject* dcopObject();

    void config(int flag);

public slots:
    void  editData();
     void applyEdit(kchartDataEditor *ed);
    void  slotConfig();
    void  wizard();
    void  saveConfig();
    void  loadConfig();
    void  defaultConfig();

    void  pieChart();
    void  barsChart();
    void  lineChart();
    void  areasChart();
    void  hiLoChart();
    void  ringChart();
    void  polarChart();
    void  bwChart();
    void  print(KPrinter &);
    void  setupPrinter(KPrinter &);

    void  slotRepaint();
    void  slotConfigBack();
    void  slotConfigFont();
    void  slotConfigColor();
    void  slotConfigLegend();
    void  slotConfigHeaderFooterChart();
    void  slotConfigSubTypeChart();
    void  slotConfigDataFormat();

    void  slotConfigPageLayout();
    void  importData();
    void  extraCreateTemplate();

protected:
    void          paintEvent( TQPaintEvent* );

    virtual void  updateReadWrite( bool readwrite );

    virtual void  mousePressEvent ( TQMouseEvent * );
    void          updateButton();

private:
    TDEAction  *m_importData;
    TDEAction  *m_wizard;
    TDEAction  *m_edit;
    TDEAction  *m_config;
    TDEAction  *m_saveconfig;
    TDEAction  *m_loadconfig;
    TDEAction  *m_defaultconfig;
    TDEAction  *m_colorConfig;
    TDEAction  *m_fontConfig;
    TDEAction  *m_backConfig;
    TDEAction  *m_legendConfig;
    TDEAction  *m_dataFormatConfig;
    TDEAction  *m_subTypeChartConfig;
    TDEAction  *m_headerFooterConfig;
    TDEAction  *m_pageLayoutConfig;

    TDEToggleAction  *m_chartpie;
    TDEToggleAction  *m_chartareas;
    TDEToggleAction  *m_chartbars;
    TDEToggleAction  *m_chartline;
    TDEToggleAction  *m_charthilo;
    TDEToggleAction  *m_chartring;
    TDEToggleAction  *m_chartpolar;
    TDEToggleAction  *m_chartbw;

    DCOPObject  *m_dcop;

    // This is used for a workaround for a bug in the kdchart code, see #101490.
    bool m_logarithmicScale;
    void forceAxisParams(bool lineMode);
};

}  //KChart namespace

#endif