GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
workspace-view.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-2015 John W. Eaton
4 Copyright (C) 2011-2015 Jacob Dawid
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if !defined (octave_workspace_view_h)
25 #define octave_workspace_view_h 1
26 
27 #include <QItemDelegate>
28 #include <QTableView>
29 #include <QSemaphore>
30 #include <QComboBox>
31 #include <QSortFilterProxyModel>
32 #include <QCheckBox>
33 
34 #include "octave-dock-widget.h"
35 #include "workspace-model.h"
36 
38 {
39  Q_OBJECT
40 
41 public:
42 
43  workspace_view (QWidget *parent = 0);
44 
45  ~workspace_view (void);
46 
47 public slots:
48 
49  void notice_settings (const QSettings *);
50 
51  void setModel (workspace_model *model);
52 
53 signals:
54 
55  /** signal that user had requested a command on a variable */
56  void command_requested (const QString& cmd);
57 
58 protected:
59 
60  void closeEvent (QCloseEvent *event);
61 
62 protected slots:
63 
64  void contextmenu_requested (const QPoint& pos);
65 
66  // context menu slots
67  void handle_contextmenu_copy (void);
69  void handle_contextmenu_rename (void);
70  void handle_contextmenu_disp (void);
71  void handle_contextmenu_plot (void);
72  void handle_contextmenu_stem (void);
73 
74  void handle_model_changed (void);
75 
76  void copyClipboard ();
77  void selectAll ();
78 
79  void filter_update (const QString& expression);
80  void filter_activate (bool enable);
81  void update_filter_history ();
82 
83 private:
84 
85  void relay_contextmenu_command (const QString& cmdname);
86 
87  QString get_var_name (QModelIndex index);
88  QTableView *view;
91 
92  QSortFilterProxyModel _filter_model;
93  QCheckBox *_filter_checkbox;
94  QComboBox *_filter;
95  enum { MaxFilterHistory = 10 };
96 };
97 
98 #endif
void filter_activate(bool enable)
QCheckBox * _filter_checkbox
void closeEvent(QCloseEvent *event)
QTableView * view
void handle_contextmenu_stem(void)
void command_requested(const QString &cmd)
signal that user had requested a command on a variable
void filter_update(const QString &expression)
QSortFilterProxyModel _filter_model
void handle_contextmenu_rename(void)
workspace_view(QWidget *parent=0)
workspace_model * _model
void setModel(workspace_model *model)
void contextmenu_requested(const QPoint &pos)
void update_filter_history()
int view_previous_row_count
void handle_model_changed(void)
QComboBox * _filter
QString get_var_name(QModelIndex index)
void notice_settings(const QSettings *)
void handle_contextmenu_copy(void)
void handle_contextmenu_disp(void)
void relay_contextmenu_command(const QString &cmdname)
void handle_contextmenu_copy_value(void)
void handle_contextmenu_plot(void)