Mercurial > hg > easyhg-kdiff3
comparison kdiff3/src/difftextwindow.h @ 69:8febbfb1148c
KDiff3 0.9.89
author | joachim99 |
---|---|
date | Mon, 10 Apr 2006 08:40:51 +0000 |
parents | |
children | 5bbfe4784324 1184fc843210 |
comparison
equal
deleted
inserted
replaced
68:d7cafcda8c99 | 69:8febbfb1148c |
---|---|
1 /*************************************************************************** | |
2 difftextwindow.h - description | |
3 ------------------- | |
4 begin : Mon Mar 18 2002 | |
5 copyright : (C) 2002-2005 by Joachim Eibl | |
6 email : joachim.eibl at gmx.de | |
7 ***************************************************************************/ | |
8 | |
9 /*************************************************************************** | |
10 * * | |
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. * | |
15 * * | |
16 ***************************************************************************/ | |
17 | |
18 #ifndef DIFFTEXTWINDOW_H | |
19 #define DIFFTEXTWINDOW_H | |
20 | |
21 #include "diff.h" | |
22 | |
23 #include <qwidget.h> | |
24 | |
25 class QStatusBar; | |
26 class OptionDialog; | |
27 class DiffTextWindowData; | |
28 class DiffTextWindowFrame; | |
29 | |
30 class DiffTextWindow : public QWidget | |
31 { | |
32 Q_OBJECT | |
33 public: | |
34 DiffTextWindow( | |
35 DiffTextWindowFrame* pParent, | |
36 QStatusBar* pStatusBar, | |
37 OptionDialog* pOptionDialog, | |
38 int winIdx | |
39 ); | |
40 ~DiffTextWindow(); | |
41 void init( | |
42 const QString& fileName, | |
43 const LineData* pLineData, | |
44 int size, | |
45 const Diff3LineVector* pDiff3LineVector, | |
46 const ManualDiffHelpList* pManualDiffHelpList, | |
47 bool bTriple | |
48 ); | |
49 void reset(); | |
50 void convertToLinePos( int x, int y, int& line, int& pos ); | |
51 | |
52 QString getSelection(); | |
53 int getFirstLine(); | |
54 int calcTopLineInFile( int firstLine ); | |
55 | |
56 int getNofColumns(); | |
57 int getNofLines(); | |
58 int getNofVisibleLines(); | |
59 int getNofVisibleColumns(); | |
60 | |
61 int convertLineToDiff3LineIdx( int line ); | |
62 int convertDiff3LineIdxToLine( int d3lIdx ); | |
63 | |
64 void convertD3LCoordsToLineCoords( int d3LIdx, int d3LPos, int& line, int& pos ); | |
65 void convertLineCoordsToD3LCoords( int line, int pos, int& d3LIdx, int& d3LPos ); | |
66 | |
67 void convertSelectionToD3LCoords(); | |
68 | |
69 bool findString( const QString& s, int& d3vLine, int& posInLine, bool bDirDown, bool bCaseSensitive ); | |
70 void setSelection( int firstLine, int startPos, int lastLine, int endPos, int& l, int& p ); | |
71 void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType ); | |
72 | |
73 void setPaintingAllowed( bool bAllowPainting ); | |
74 void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns ); | |
75 void print( MyPainter& painter, const QRect& r, int firstLine, int nofLinesPerPage ); | |
76 signals: | |
77 void resizeSignal( int nofVisibleColumns, int nofVisibleLines ); | |
78 void scroll( int deltaX, int deltaY ); | |
79 void newSelection(); | |
80 void selectionEnd(); | |
81 void setFastSelectorLine( int line ); | |
82 void gotFocus(); | |
83 void lineClicked( int winIdx, int line ); | |
84 | |
85 public slots: | |
86 void setFirstLine( int line ); | |
87 void setFirstColumn( int col ); | |
88 void resetSelection(); | |
89 void setFastSelectorRange( int line1, int nofLines ); | |
90 | |
91 protected: | |
92 virtual void mousePressEvent ( QMouseEvent * ); | |
93 virtual void mouseReleaseEvent ( QMouseEvent * ); | |
94 virtual void mouseMoveEvent ( QMouseEvent * ); | |
95 virtual void mouseDoubleClickEvent ( QMouseEvent * e ); | |
96 | |
97 virtual void paintEvent( QPaintEvent* ); | |
98 virtual void dragEnterEvent( QDragEnterEvent* e ); | |
99 virtual void focusInEvent( QFocusEvent* e ); | |
100 | |
101 virtual void resizeEvent( QResizeEvent* ); | |
102 virtual void timerEvent(QTimerEvent*); | |
103 | |
104 private: | |
105 DiffTextWindowData* d; | |
106 void showStatusLine( int line ); | |
107 friend class DiffTextWindowFrame; | |
108 }; | |
109 | |
110 | |
111 class DiffTextWindowFrameData; | |
112 | |
113 class DiffTextWindowFrame : public QWidget | |
114 { | |
115 Q_OBJECT | |
116 public: | |
117 DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx ); | |
118 ~DiffTextWindowFrame(); | |
119 DiffTextWindow* getDiffTextWindow(); | |
120 void init(); | |
121 void setFirstLine(int firstLine); | |
122 signals: | |
123 void fileNameChanged(const QString&, int); | |
124 protected: | |
125 bool eventFilter( QObject*, QEvent* ); | |
126 private slots: | |
127 void slotReturnPressed(); | |
128 void slotBrowseButtonClicked(); | |
129 private: | |
130 DiffTextWindowFrameData* d; | |
131 }; | |
132 | |
133 | |
134 #endif | |
135 |