File: mysql_relationship_editor.h

package info (click to toggle)
mysql-workbench 6.3.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 113,932 kB
  • ctags: 87,814
  • sloc: ansic: 955,521; cpp: 427,465; python: 59,728; yacc: 59,129; xml: 54,204; sql: 7,091; objc: 965; makefile: 638; sh: 613; java: 237; perl: 30; ruby: 6; php: 1
file content (81 lines) | stat: -rw-r--r-- 2,096 bytes parent folder | download | duplicates (2)
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
76
77
78
79
80
81
#ifndef _MYSQL_EDITOR_RELATIONSHIP_H_
#define _MYSQL_EDITOR_RELATIONSHIP_H_

#include "grt/editor_base.h"

#include "grts/structs.workbench.physical.h"

#include "mysql_support_backend_public_interface.h"

#define RelationshipEditorBE_VERSION 1


class MYSQLWBMYSQLSUPPORTBACKEND_PUBLIC_FUNC RelationshipEditorBE : public bec::BaseEditor
{
protected:
  workbench_physical_ConnectionRef _relationship;

public: // editor interface
  enum VisibilityType
  {
    Visible = 1,
    Splitted = 2,
    Hidden = 3
  };
  
  RelationshipEditorBE(bec::GRTManager *grtm, const workbench_physical_ConnectionRef &relationship);
  virtual bool should_close_on_delete_of(const std::string &oid);

  bool model_only() { return *get_relationship()->foreignKey()->modelOnly() == 1; }
  void set_model_only(bool flag);
  
  GrtObjectRef get_object() { return get_relationship(); }

  workbench_physical_ConnectionRef get_relationship() { return _relationship; }

  virtual std::string get_title();
  
  void set_caption(const std::string &caption);
  std::string get_caption();
  std::string get_caption_long();
  
  void set_extra_caption(const std::string &caption);
  std::string get_extra_caption();
  std::string get_extra_caption_long();
  
  void set_left_mandatory(bool flag);
  bool get_left_mandatory();

  void set_right_mandatory(bool flag);
  bool get_right_mandatory();

  VisibilityType get_visibility();
  void set_visibility(VisibilityType type);

  void open_editor_for_table(const db_TableRef &table);
  void open_editor_for_left_table();
  void open_editor_for_right_table();
  
  void set_to_many(bool flag);
  bool get_to_many();
  
  bool get_is_identifying();
  void set_is_identifying(bool flag);

  void set_comment(const std::string &comment);
  std::string get_comment();
  
  std::string get_left_table_name();
  std::string get_right_table_name();

  std::string get_left_table_fk();

  std::string get_left_table_info();
  std::string get_right_table_info();

  void edit_left_table();
  void edit_right_table();
  void invert_relationship();
};

#endif /* _EDITOR_RELATIONSHIP_H_ */