File: mysql_table_editor_fe.h

package info (click to toggle)
mysql-workbench 5.2.40%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 53,880 kB
  • sloc: cpp: 419,850; yacc: 74,784; xml: 54,510; python: 31,455; sh: 9,423; ansic: 4,736; makefile: 2,442; php: 529; java: 237
file content (75 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download
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
#ifndef __WB_MYSQL_TABLE_EDITOR_H__
#define __WB_MYSQL_TABLE_EDITOR_H__

#include "wb_config.h"
#include <gtkmm/notebook.h>
#include "linux_utilities/plugin_editor_base.h"
#include "../backend/mysql_table_editor.h"

#include <gtkmm/notebook.h>

class DbMySQLTableEditorColumnPage;
class DbMySQLTableEditorIndexPage;
class DbMySQLTableEditorFKPage;
class DbMySQLTableEditorTriggerPage;
class DbMySQLTableEditorPartPage;
class DbMySQLTableEditorOptPage;
class RecordsetView;
class DbMySQLEditorPrivPage;

//==============================================================================
//
//==============================================================================
class DbMySQLTableEditor : public PluginEditorBase
{
  friend class DbMySQLTableEditorColumnPage;
  
  MySQLTableEditorBE                *_be;
  DbMySQLTableEditorColumnPage      *_columns_page;
  DbMySQLTableEditorIndexPage       *_indexes_page;
  DbMySQLTableEditorFKPage          *_fks_page;
  DbMySQLTableEditorTriggerPage     *_triggers_page;
  DbMySQLTableEditorPartPage        *_part_page;
  DbMySQLTableEditorOptPage         *_opts_page;
  RecordsetView                     *_inserts_page;
  DbMySQLEditorPrivPage             *_privs_page;

  void create_table_page();

  void refresh_table_page();
  void partial_refresh(const int what);

  void set_table_collation(Gtk::ComboBoxEntryText* combo);
  void set_table_engine(Gtk::ComboBoxEntryText* combo);

  virtual bec::BaseEditor *get_be();

  bool event_from_table_name_entry(GdkEvent*);

  void page_changed(GtkNotebookPage* page, guint page_num);

  void set_table_name(const std::string &);

  //TESTING
  void refresh_indices();
  //\TESTING
  void set_table_option_by_name(const std::string& name, const std::string& value);
  void set_comment(const std::string& cmt);

  void toggle_header_part();

 protected:
  virtual void decorate_object_editor();

 public:
  DbMySQLTableEditor(grt::Module *m, bec::GRTManager *grtm, const grt::BaseListRef &args);

  virtual ~DbMySQLTableEditor();
  virtual void do_refresh_form_data(); // That's called from PluginEditorBase::refresh_form_data
                                       // which is passed to the backend refresh slot
  virtual std::string get_title();
  virtual bool can_close();
  virtual bool switch_edited_object(bec::GRTManager *grtm, const grt::BaseListRef &args); 
};

#endif