summaryrefslogtreecommitdiffstats
path: root/kompare/komparepart/kompareconnectwidget.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /kompare/komparepart/kompareconnectwidget.h
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kompare/komparepart/kompareconnectwidget.h')
-rw-r--r--kompare/komparepart/kompareconnectwidget.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/kompare/komparepart/kompareconnectwidget.h b/kompare/komparepart/kompareconnectwidget.h
new file mode 100644
index 00000000..96160c97
--- /dev/null
+++ b/kompare/komparepart/kompareconnectwidget.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+ kompareconnectwidget.h - description
+ -------------------
+ begin : Tue Jun 26 2001
+ copyright : (C) 2001-2003 John Firebaugh
+ (C) 2001-2004 Otto Bruggeman
+ (C) 2004 Jeff Snyder
+ email : jfirebaugh@kde.org
+ otto.bruggeman@home.nl
+ jeff@caffeinated.me.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KOMPARECONNECTWIDGET_H
+#define KOMPARECONNECTWIDGET_H
+
+#include "kompare_qsplitter.h"
+#include <qwidget.h>
+
+namespace Diff2 {
+class DiffModel;
+}
+class ViewSettings;
+class KompareListView;
+class KompareSplitter;
+
+class KompareConnectWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ KompareConnectWidget( KompareListView* left, KompareListView* right,
+ ViewSettings* settings, QWidget* parent, const char* name = 0 );
+ ~KompareConnectWidget();
+
+public slots:
+ void slotSetSelection( const Diff2::DiffModel* model, const Diff2::Difference* diff );
+ void slotSetSelection( const Diff2::Difference* diff );
+
+ void slotDelayedRepaint();
+
+signals:
+ void selectionChanged(const Diff2::Difference* diff);
+
+protected:
+ void paintEvent( QPaintEvent* e );
+ QPointArray makeTopBezier( int tl, int tr );
+ QPointArray makeBottomBezier( int bl, int br );
+ QPointArray makeConnectPoly( const QPointArray& topBezier, const QPointArray& bottomBezier );
+
+private:
+ ViewSettings* m_settings;
+
+ KompareListView* m_leftView;
+ KompareListView* m_rightView;
+
+ const Diff2::DiffModel* m_selectedModel;
+ const Diff2::Difference* m_selectedDifference;
+};
+
+class KompareConnectWidgetFrame : public QSplitterHandle
+{
+ Q_OBJECT
+public:
+ KompareConnectWidgetFrame( KompareListView* left, KompareListView* right,
+ ViewSettings* settings, KompareSplitter* parent, const char* name = 0 );
+ ~KompareConnectWidgetFrame();
+
+ QSize sizeHint() const;
+
+ KompareConnectWidget* wid() { return &m_wid; }
+
+protected:
+ // stop the parent QSplitterHandle painting
+ void paintEvent( QPaintEvent* /* e */ ) { }
+
+ void mouseMoveEvent( QMouseEvent * );
+ void mousePressEvent( QMouseEvent * );
+ void mouseReleaseEvent( QMouseEvent * );
+
+private:
+ KompareConnectWidget m_wid;
+ QLabel m_label;
+ QVBoxLayout m_layout;
+};
+
+#endif