1
/***************************************************************************
4
begin : Wed Jan 14 2004
5
Copyright 2004 Jeff Snyder <jeff@caffeinated.me.uk>
6
Copyright 2007-2011 Kevin Kofler <kevin.kofler@chello.at>
7
****************************************************************************/
9
/***************************************************************************
11
** This program is free software; you can redistribute it and/or modify
12
** it under the terms of the GNU General Public License as published by
13
** the Free Software Foundation; either version 2 of the License, or
14
** (at your option) any later version.
16
***************************************************************************/
18
#ifndef _KOMPARESPLITTER_H_
19
#define _KOMPARESPLITTER_H_
23
#include <libkomparediff2/komparemodellist.h>
25
class QSplitterHandle;
37
class KompareListView;
38
class KompareConnectWidget;
40
class KompareSplitter : public QSplitter
45
KompareSplitter(ViewSettings* settings, QWidget* parent);
46
~KompareSplitter() override;
51
void scrollViewsToId(int id);
52
void setXOffset(int x);
54
void selectionChanged(const Diff2::Difference* diff);
57
void slotScrollToId(int id);
58
void slotDelayedUpdateScrollBars();
59
void slotUpdateScrollBars();
60
void slotDelayedUpdateVScrollValue();
61
void slotUpdateVScrollValue();
62
void keyPressEvent(QKeyEvent* e) override;
64
void slotApplyDifference(bool apply);
65
void slotApplyAllDifferences(bool apply);
66
void slotApplyDifference(const Diff2::Difference* diff, bool apply);
68
void slotSetSelection(const Diff2::DiffModel* model, const Diff2::Difference* diff);
69
void slotSetSelection(const Diff2::Difference* diff);
71
void slotDifferenceClicked(const Diff2::Difference* diff);
73
void slotConfigChanged();
76
void wheelEvent(QWheelEvent* e) override;
78
ViewSettings* settings() const { return m_settings; }
81
void slotDelayedRepaintHandles();
82
void slotRepaintHandles();
86
// override from QSplitter
87
QSplitterHandle* createHandle() override;
89
void setCursor(int id, const QCursor& cursor);
90
void unsetCursor(int id);
93
KompareListView* listView(int index);
94
KompareConnectWidget* connectWidget(int index);
98
// Scrollbars. all this just for the goddamn scrollbars. i hate them.
102
bool needVScrollBar();
105
bool needHScrollBar();
109
int minVisibleWidth();
111
QTimer* m_scrollTimer;
115
ViewSettings* m_settings;
116
QScrollBar* m_vScroll;
117
QScrollBar* m_hScroll;
119
friend class KompareConnectWidgetFrame;
121
#endif //_KOMPARESPLITTER_H_