summaryrefslogtreecommitdiffstats
path: root/kompare/komparepart/komparesplitter.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/komparesplitter.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/komparesplitter.h')
-rw-r--r--kompare/komparepart/komparesplitter.h115
1 files changed, 115 insertions, 0 deletions
diff --git a/kompare/komparepart/komparesplitter.h b/kompare/komparepart/komparesplitter.h
new file mode 100644
index 00000000..47eee6bf
--- /dev/null
+++ b/kompare/komparepart/komparesplitter.h
@@ -0,0 +1,115 @@
+/***************************************************************************
+ kompareview.cpp - description
+ -------------------
+ begin : Wed Jan 14 2004
+ copyright : (C) 2004 by Jeff Snyder
+ email : 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 _KOMPARESPLITTER_H_
+#define _KOMPARESPLITTER_H_
+
+#include "kompare_qsplitter.h"
+
+#include <qtimer.h>
+
+#include "komparelistview.h"
+#include "komparemodellist.h"
+
+class QSplitterLayoutStruct;
+class QTextStream;
+class QSplitterHandle;
+
+namespace Diff2 {
+class DiffModel;
+class Difference;
+}
+class ViewSettings;
+
+class KompareSplitter : public QSplitter
+{
+ Q_OBJECT
+
+public:
+ KompareSplitter(ViewSettings *settings, QWidget *parent=0, const char *name = 0);
+ ~KompareSplitter();
+
+signals:
+ void selectionChanged( const Diff2::Difference* diff );
+
+ void configChanged();
+
+ void scrollViewsToId( int id );
+ void setXOffset( int x );
+
+public slots:
+ void slotApplyDifference( bool apply );
+ void slotApplyAllDifferences( bool apply );
+ void slotApplyDifference( const Diff2::Difference* diff, bool apply );
+
+ // to update the list views
+ void slotSetSelection( const Diff2::DiffModel* model, const Diff2::Difference* diff );
+ void slotSetSelection( const Diff2::Difference* diff );
+
+ void slotDifferenceClicked( const Diff2::Difference* diff );
+
+ void slotConfigChanged();
+
+ void scrollToId( int id );
+ void slotDelayedUpdateScrollBars();
+ void slotUpdateScrollBars();
+ void slotDelayedUpdateVScrollValue();
+ void slotUpdateVScrollValue();
+
+protected:
+ void childEvent( QChildEvent * );
+ void wheelEvent( QWheelEvent* e );
+ void keyPressEvent( QKeyEvent* e );
+
+ void moveSplitter( QCOORD pos, int id );
+
+private slots:
+ void slotDelayedRepaintHandles();
+ void timerTimeout();
+
+private:
+ QSplitterLayoutStruct *addWidget(KompareListViewFrame *w,
+ bool prepend = FALSE );
+
+ void doMove( bool backwards, int pos, int id, int delta,
+ bool mayCollapse, int* positions, int* widths );
+
+ void repaintHandles();
+
+ QTimer* m_scrollTimer;
+ bool restartTimer;
+ int scrollTo;
+
+ // Scrollbars. all this just for the goddamn scrollbars. i hate them.
+ int scrollId();
+ int lineSpacing();
+ int pageSize();
+ bool needVScrollBar();
+ int minVScrollId();
+ int maxVScrollId();
+ bool needHScrollBar();
+ int maxHScrollId();
+ int maxContentsX();
+ int minVisibleWidth();
+
+ ViewSettings* m_settings;
+ QScrollBar* m_vScroll;
+ QScrollBar* m_hScroll;
+
+ friend class KompareConnectWidgetFrame;
+};
+#endif //_KOMPARESPLITTER_H_