Quark  0.1
DiffScrollSynchronizer.h++
Go to the documentation of this file.
1 
2 #ifndef __libquark_diff_DiffScrollSynchronizer_hxx
3 #define __libquark_diff_DiffScrollSynchronizer_hxx
4 
5 #include <quark/DiffTypes.h++>
6 
7 #include <QObject>
8 #include <QScrollBar>
9 
10 namespace quark {
11 namespace diff {
12 
13 class DiffableSourceTextEdit;
14 class DiffModel;
15 
16 class DiffScrollSynchronizer : public QObject
17 {
18  Q_OBJECT;
19 
20  public:
21 
23  DiffableSourceTextEdit* theirsPanel,
24  DiffableSourceTextEdit* basePanel,
25  DiffableSourceTextEdit* yoursPanel);
27 
28  inline bool isActive() const
29  { return(_active); }
30 
31  public slots:
32 
33  inline void setActive(bool active)
34  { _active = active; }
35 
36  private slots:
37 
38  void theirsHorizontalScrollbarValueChanged();
39  void baseHorizontalScrollbarValueChanged();
40  void yoursHorizontalScrollbarValueChanged();
41  void theirsVerticalScrollbarValueChanged();
42  void baseVerticalScrollbarValueChanged();
43  void yoursVerticalScrollbarValueChanged();
44 
45  private:
46 
47  void syncHorizontal(DiffableSourceTextEdit* thisPanel,
48  DiffableSourceTextEdit* otherPanel);
49  void syncVertical(DiffableSourceTextEdit* thisPanel,
50  DiffableSourceTextEdit* otherPanel);
51 
52  DiffModel* _model;
53  DiffableSourceTextEdit* _theirsPanel;
54  DiffableSourceTextEdit* _basePanel;
55  DiffableSourceTextEdit* _yoursPanel;
56  bool _active;
57  bool _adjusting;
58 };
59 
60 } // namespace diff
61 } // namespace quark
62 
63 #endif // __libquark_diff_DiffScrollSynchronizer_hxx
void setActive(bool active)
Definition: DiffScrollSynchronizer.h++:33
DiffScrollSynchronizer(DiffModel *model, DiffableSourceTextEdit *theirsPanel, DiffableSourceTextEdit *basePanel, DiffableSourceTextEdit *yoursPanel)
Definition: DiffScrollSynchronizer.h++:16
Definition: BarChartView.h++:6
TODO: rewrite doc A data model representing a 2-way or 3-way diff.
Definition: DiffModel.h++:23
bool isActive() const
Definition: DiffScrollSynchronizer.h++:28
Definition: DiffableSourceTextEdit.h++:20