~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to plugins/db.mysql.editors/linux/mysql_table_editor_column_page.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __WB_COLUMN_PAGE_HANDLING_H__
 
2
#define __WB_COLUMN_PAGE_HANDLING_H__
 
3
 
 
4
#include "grt/tree_model.h"
 
5
#include <gtkmm/builder.h>
 
6
 
 
7
class MySQLTableEditorBE;
 
8
class ListModelWrapper;
 
9
class DbMySQLTableEditor;
 
10
class AutoCompletable;
 
11
 
 
12
namespace Gtk
 
13
{
 
14
  class ScrolledWindow;
 
15
  class ComboBox;
 
16
}
 
17
 
 
18
//==============================================================================
 
19
//
 
20
//==============================================================================
 
21
class DbMySQLTableEditorColumnPage
 
22
{
 
23
  public:
 
24
    DbMySQLTableEditorColumnPage(DbMySQLTableEditor *owner, MySQLTableEditorBE* be, Glib::RefPtr<Gtk::Builder> xml);
 
25
    ~DbMySQLTableEditorColumnPage();
 
26
        
 
27
    void refresh();
 
28
    void partial_refresh(const int what);
 
29
 
 
30
    void switch_be(MySQLTableEditorBE* be);
 
31
 
 
32
  private:
 
33
    grt::StringListRef get_types_for_table(const db_TableRef table); //!< T
 
34
 
 
35
    bool process_event(GdkEvent* event);
 
36
    void type_column_event(GdkEvent* e);
 
37
    void cursor_changed();
 
38
 
 
39
    void update_column_details(const ::bec::NodeId &node);
 
40
    
 
41
    void set_comment(const std::string& comment);
 
42
    void set_collation();
 
43
    void update_collation();
 
44
 
 
45
    void check_resize(Gtk::Allocation& r);
 
46
    bool do_on_visible(GdkEventVisibility*);
 
47
 
 
48
    bec::NodeId get_selected();
 
49
  private:
 
50
    void refill_completions();
 
51
    void refill_columns_tv();
 
52
 
 
53
    DbMySQLTableEditor                       *_owner;
 
54
    MySQLTableEditorBE                       *_be;
 
55
    Glib::RefPtr<Gtk::Builder>                _xml;
 
56
 
 
57
    Glib::RefPtr<ListModelWrapper>            _model;
 
58
    Gtk::TreeView                            *_tv;
 
59
    Gtk::ScrolledWindow                      *_tv_holder;
 
60
 
 
61
    Gtk::ComboBox                            *_collation_combo;
 
62
 
 
63
    gulong                                    _edit_conn;
 
64
    GtkCellEditable                          *_ce;
 
65
    int                                       _old_column_count;
 
66
 
 
67
    // Auto completion of types and related functions
 
68
    static AutoCompletable                    _types_completion;
 
69
    static AutoCompletable                    _names_completion;
 
70
    static void type_cell_editing_started(GtkCellRenderer* cr, GtkCellEditable* ce, gchar* path, gpointer udata);
 
71
    static void cell_editing_done(GtkCellEditable* ce, gpointer udata);
 
72
    bool                                      _editing;
 
73
};
 
74
 
 
75
#endif