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

« back to all changes in this revision

Viewing changes to frontend/common/grt_code_editor.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
/* 
 
2
 * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; version 2 of the
 
7
 * License.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
17
 * 02110-1301  USA
 
18
 */
 
19
 
 
20
#ifndef __grt_code_editor_h__
 
21
#define __grt_code_editor_h__
 
22
 
 
23
#include "mforms/box.h"
 
24
#include "mforms/code_editor.h"
 
25
#include "mforms/splitter.h"
 
26
#include "mforms/panel.h"
 
27
#include "mforms/tabview.h"
 
28
#include "mforms/textentry.h"
 
29
#include "mforms/textbox.h"
 
30
#include "mforms/filechooser.h"
 
31
 
 
32
class GRTShellWindow;
 
33
class PythonDebugger;
 
34
 
 
35
class GRTCodeEditor : public mforms::Box
 
36
{
 
37
public:
 
38
  GRTCodeEditor(GRTShellWindow *owner, bool module, const std::string &language);
 
39
  virtual ~GRTCodeEditor();
 
40
 
 
41
  void set_path(const std::string &path);
 
42
  const std::string& get_path() { return _filename; };
 
43
  const std::string& get_language() { return _language; };
 
44
  void set_text(const std::string &text);
 
45
  std::string get_title();
 
46
  std::string get_text();
 
47
  
 
48
  bool is_dirty() const { return _dirty; }
 
49
  bool can_close();
 
50
  
 
51
  bool load(const std::string &path);
 
52
  bool save(bool choose_file);
 
53
  void execute();
 
54
 
 
55
  GRTShellWindow *get_shell_window() { return _owner; }
 
56
  
 
57
  mforms::CodeEditor *get_editor() { return &_text; }
 
58
 
 
59
#ifdef _DEBUG
 
60
  void test_markup();
 
61
#endif
 
62
protected:
 
63
  GRTShellWindow *_owner;
 
64
  mforms::Box _top;
 
65
  mforms::CodeEditor _text;
 
66
 
 
67
  std::string _filename;
 
68
  std::string _language;
 
69
  bool _debugging_supported;
 
70
  bool _editing_module;
 
71
  bool _dirty;
 
72
  
 
73
  void text_changed(int line, int linesAdded);
 
74
  
 
75
  void close();
 
76
};
 
77
 
 
78
 
 
79
 
 
80
#endif /* __grt_code_editor.h__ */