~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kspread/plugins/scripting/ScriptingWidgets.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 */
35
35
class ScriptingSheetsListView : public QWidget
36
36
{
37
 
        Q_OBJECT
38
 
 
39
 
        /**
40
 
        * Enumeration of selection types.
41
 
        */
42
 
        Q_ENUMS(SelectionType)
43
 
 
44
 
        /**
45
 
        * Enumeration of editor types.
46
 
        */
47
 
        Q_ENUMS(EditorType)
48
 
 
49
 
    public:
50
 
 
51
 
        /**
52
 
        * Constructor.
53
 
        * \param module The \a ScriptingModule instance that should be used
54
 
        * as datasource for what should be displayed within the listview.
55
 
        * \param parent The parent QWidget this widget should be displayed in.
56
 
        */
57
 
        ScriptingSheetsListView(ScriptingModule* module, QWidget* parent);
58
 
 
59
 
        /**
60
 
        * Destructor.
61
 
        */
62
 
        virtual ~ScriptingSheetsListView();
63
 
 
64
 
        enum SelectionType { SingleSelect, MultiSelect };
65
 
        enum EditorType { Disabled, Cell, Range };
66
 
 
67
 
    public slots:
68
 
 
69
 
        /**
70
 
        * Set the selection type to \p selectiontype. This could be either
71
 
        * "SingleSelect" or "MultiSelect".
72
 
        */
73
 
        void setSelectionType(const QString& selectiontype);
74
 
 
75
 
        /**
76
 
        * Set the editor type to \p editortype. This could be either
77
 
        * "Disabled", "Cell" or "Range".
78
 
        */
79
 
        void setEditorType(const QString& editortype);
80
 
 
81
 
        /**
82
 
        * Return the name of the sheet. This makes only sense of
83
 
        * "SingleSelect" was defined as selection type else, if
84
 
        * "MultiSelect" was defined, use the sheets() function.
85
 
        */
86
 
        QString sheet();
87
 
 
88
 
        /**
89
 
        * Return the content of the editor. This makes only sense of
90
 
        * "SingleSelect" was defined as selection type else, if
91
 
        * "MultiSelect" was defined, use the sheets() function.
92
 
        */
93
 
        QString editor();
94
 
 
95
 
        /**
96
 
        * Return the list of all selected sheets. Selected are those sheets the
97
 
        * user enabled the checkbutton for and the resulting list contains for
98
 
        * each such sheetitem a list of the name and the range rectangle.
99
 
        *
100
 
        * For example in python following structure got returned if there
101
 
        * exist 3 sheets where Sheet1 and Sheet2 got selected. Sheet1 also does
102
 
        * define the range A1:B2.
103
 
        * [['Sheet1', 1, [1, 1, 2, 2]], ['Sheet2', 1], ['Sheet3', 0]]
104
 
        *
105
 
        * Each sheet contains a tuple of
106
 
        * \li sheetname
107
 
        * \li 1=enabled or 0=disabled
108
 
        * \li optional range tuple [from column, from row, to column, to row]
109
 
        */
110
 
        QVariantList sheets();
111
 
 
112
 
    private:
113
 
        ScriptingModule* m_module;
114
 
        QTreeView* m_view;
115
 
        bool m_initialized;
116
 
        QVariantList m_prevlist;
117
 
 
118
 
        SelectionType m_selectiontype;
119
 
        EditorType m_editortype;
120
 
 
121
 
        void initialize();
122
 
        void finalize();
123
 
 
124
 
        virtual void showEvent(QShowEvent* event);
 
37
    Q_OBJECT
 
38
 
 
39
    /**
 
40
    * Enumeration of selection types.
 
41
    */
 
42
    Q_ENUMS(SelectionType)
 
43
 
 
44
    /**
 
45
    * Enumeration of editor types.
 
46
    */
 
47
    Q_ENUMS(EditorType)
 
48
 
 
49
public:
 
50
 
 
51
    /**
 
52
    * Constructor.
 
53
    * \param module The \a ScriptingModule instance that should be used
 
54
    * as datasource for what should be displayed within the listview.
 
55
    * \param parent The parent QWidget this widget should be displayed in.
 
56
    */
 
57
    ScriptingSheetsListView(ScriptingModule* module, QWidget* parent);
 
58
 
 
59
    /**
 
60
    * Destructor.
 
61
    */
 
62
    virtual ~ScriptingSheetsListView();
 
63
 
 
64
    enum SelectionType { SingleSelect, MultiSelect };
 
65
    enum EditorType { Disabled, Cell, Range };
 
66
 
 
67
public slots:
 
68
 
 
69
    /**
 
70
    * Set the selection type to \p selectiontype. This could be either
 
71
    * "SingleSelect" or "MultiSelect".
 
72
    */
 
73
    void setSelectionType(const QString& selectiontype);
 
74
 
 
75
    /**
 
76
    * Set the editor type to \p editortype. This could be either
 
77
    * "Disabled", "Cell" or "Range".
 
78
    */
 
79
    void setEditorType(const QString& editortype);
 
80
 
 
81
    /**
 
82
    * Return the name of the sheet. This makes only sense of
 
83
    * "SingleSelect" was defined as selection type else, if
 
84
    * "MultiSelect" was defined, use the sheets() function.
 
85
    */
 
86
    QString sheet();
 
87
 
 
88
    /**
 
89
    * Return the content of the editor. This makes only sense of
 
90
    * "SingleSelect" was defined as selection type else, if
 
91
    * "MultiSelect" was defined, use the sheets() function.
 
92
    */
 
93
    QString editor();
 
94
 
 
95
    /**
 
96
    * Return the list of all selected sheets. Selected are those sheets the
 
97
    * user enabled the checkbutton for and the resulting list contains for
 
98
    * each such sheetitem a list of the name and the range rectangle.
 
99
    *
 
100
    * For example in python following structure got returned if there
 
101
    * exist 3 sheets where Sheet1 and Sheet2 got selected. Sheet1 also does
 
102
    * define the range A1:B2.
 
103
    * [['Sheet1', 1, [1, 1, 2, 2]], ['Sheet2', 1], ['Sheet3', 0]]
 
104
    *
 
105
    * Each sheet contains a tuple of
 
106
    * \li sheetname
 
107
    * \li 1=enabled or 0=disabled
 
108
    * \li optional range tuple [from column, from row, to column, to row]
 
109
    */
 
110
    QVariantList sheets();
 
111
 
 
112
private:
 
113
    ScriptingModule* m_module;
 
114
    QTreeView* m_view;
 
115
    bool m_initialized;
 
116
    QVariantList m_prevlist;
 
117
 
 
118
    SelectionType m_selectiontype;
 
119
    EditorType m_editortype;
 
120
 
 
121
    void initialize();
 
122
    void finalize();
 
123
 
 
124
    virtual void showEvent(QShowEvent* event);
125
125
};
126
126
 
127
127
#endif