SGL
gdiffgui.h
1 /*
2  * File: gdiffgui.h
3  * ----------------
4  *
5  * @author Marty Stepp
6  * @version 2018/10/06
7  * - allow passing diff flags
8  * @version 2018/09/07
9  * - added doc comments for new documentation generation
10  * @version 2018/08/23
11  * - renamed to gdiffgui.h to replace Java version
12  * @version 2018/07/31
13  * - initial version
14  */
15 
16 
17 #ifndef _gdiffgui_h
18 #define _gdiffgui_h
19 
20 #include <string>
21 #include <QWidget>
22 #include <QSplitter>
23 
24 #include "ginteractor.h"
25 #include "gtextarea.h"
26 #include "gwindow.h"
27 #include "privatediff.h"
28 
37 class GDiffGui {
38 public:
39  static const string COLOR_EXPECTED;
40  static const string COLOR_EXPECTED_DARK_MODE;
41  static const string COLOR_LINE_NUMBERS;
42  static const string COLOR_LINE_NUMBERS_DARK_MODE;
43  static const string COLOR_STUDENT;
44  static const string COLOR_STUDENT_DARK_MODE;
45 
49  static void showDialog(const string& name1,
50  const string& text1,
51  const string& name2,
52  const string& text2,
53  int diffFlags = diff::DIFF_DEFAULT_FLAGS,
54  bool showCheckBoxes = false);
55 
56 private:
57  static const bool LINE_NUMBERS;
58 
59  GDiffGui(const string& name1,
60  const string& text1,
61  const string& name2,
62  const string& text2,
63  int diffFlags = diff::DIFF_DEFAULT_FLAGS,
64  bool showCheckBoxes = false); // forbid construction
65  virtual ~GDiffGui();
66 
67  Q_DISABLE_COPY(GDiffGui)
68 
69  void setupDiffText(const string& diffs);
70  void setupLeftRightText(GTextArea* textArea, const string& text);
71  void syncScrollBars(bool left);
72 
73  GWindow* _window;
74  QSplitter* _hsplitter;
75  QSplitter* _vsplitter;
76  GTextArea* _textAreaLeft;
77  GTextArea* _textAreaRight;
78  GTextArea* _textAreaBottom;
79  GGenericInteractor<QSplitter>* _hsplitterInteractor;
80  GGenericInteractor<QSplitter>* _vsplitterInteractor;
81 };
82 
83 #endif // _gdiffgui_h
A GTextArea is a multi-line editable text box.
Definition: gtextarea.h:33
This class represents a graphics window that supports simple graphics.
Definition: gwindow.h:98
const int DIFF_DEFAULT_FLAGS
Definition: privatediff.h:45