1 /**
2 *  Copyright Mikael H�gdahl - triyana@users.sourceforge.net
3 *
4 *  This source is distributed under the terms of the Q Public License version 1.0,
5 *  created by Trolltech (www.trolltech.com).
6 */
7 
8 #ifndef PrefPortfolioChartData_h
9 #define PrefPortfolioChartData_h
10 
11 #include "table/BaseData.h"
12 #include "chart/PortfolioChart.h"
13 #include <MHString.h>
14 
15 class MHVector;
16 
17 
18 
19 /**
20 *  Supply data for editing portfolio chart preferences to the table widget.
21 *  Get data from database.
22 */
23 class PrefPortfolioChartData : public BaseData {
24 public:
25                             PrefPortfolioChartData (int view);
26                             ~PrefPortfolioChartData ();
27 
28     Fl_Align                align (int row, int col);
Class()29     const char*             Class () {return "PrefPortfolioChartData";}
30     const char**            choice (int row, int col, int& size, int& selected, char* label);
cols()31     int                     cols() {return 2;}
32     FL_TABLE_EDITOR         editor_type (int row, int col, bool force_custom);
33     void                    reload (const char* message);
rows()34     int                     rows() {return 12;}
35     bool                    value (const char* data, int row, int col);
36     const char*             value (int row, int col);
37     int                     width (int col);
38 
39 private:
40     int                     aView;
41     char                    aBuffer[1000];
42     char**                  aChoiceLayout;
43     char**                  aChoiceModels;
44     char**                  aChoiceSecurity;
45     MHVector*               aVectorSecurity;
46     PortfolioChart          aModels;
47 
48     void                    setLabel (int row);
49     void                    setPreference (int row, int col);
50 };
51 
52 #endif
53