2 Author: Marco Costalba (C) 2005-2007
4 Copyright: See COPYING file that comes with this distribution
14 class FileHighlighter
;
24 class QListWidgetItem
;
26 class FileContent
: public QTextEdit
{
29 FileContent(QWidget
* parent
);
31 void setup(Domain
* parent
, Git
* git
, QListWidget
* lwa
);
32 void doUpdate(bool force
= false);
33 void clearAll(bool emitSignal
= true);
35 void goToAnnotation(int id
, int direction
);
36 bool goToRangeStart();
37 bool rangeFilter(bool b
);
38 bool getRange(SCRef sha
, RangeInfo
* r
);
39 bool startAnnotate(FileHistory
* fh
, SCRef histTime
);
40 void setShowAnnotate(bool b
);
41 void setHighlightSource(bool b
);
42 void setSelection(int paraFrom
, int indexFrom
, int paraTo
, int indexTo
);
43 int itemAnnId(QListWidgetItem
* item
);
44 bool isFileAvailable() const { return isFileAvail
; }
45 bool isAnnotateAvailable() const { return curAnn
!= NULL
; }
48 void annotationAvailable(bool);
49 void fileAvailable(bool);
50 void revIdSelected(int);
53 void on_annotateReady(Annotate
*, bool, const QString
&);
54 void procReadyRead(const QByteArray
&);
55 void procFinished(bool emitSignal
= true);
56 void typeWriterFontChanged();
59 virtual void resizeEvent(QResizeEvent
* e
);
62 void on_list_doubleClicked(QListWidgetItem
*);
63 void on_scrollBar_valueChanged(int);
64 void on_listScrollBar_valueChanged(int);
67 friend class FileHighlighter
;
69 void clear(); // declared as private, to avoid indirect access to QTextEdit::clear()
70 void clearAnnotate(bool emitSignal
);
71 void clearText(bool emitSignal
);
72 void findInFile(SCRef str
);
73 void scrollCursorToTop();
74 void scrollLineToTop(int lineNum
);
75 int positionToLineNum(int pos
= -1);
77 bool lookupAnnotation();
78 uint
annotateLength(const FileAnnotation
* curAnn
);
79 void saveScreenState();
80 void restoreScreenState();
82 void adjustAnnListSize(int width
);
87 QListWidget
* listWidgetAnn
;
90 FileHighlighter
* fileHighlighter
;
91 QPointer
<MyProcess
> proc
;
92 QPointer
<Annotate
> annotateObj
; // valid from beginning of annotation loading
93 const FileAnnotation
* curAnn
; // valid at the end of annotation loading
94 QByteArray fileRowData
;
97 bool isAnnotationLoading
;
98 bool isAnnotationAppended
;
99 bool isRangeFilterActive
;
105 bool isValid
, hasSelectedText
;
106 int topPara
, paraFrom
, indexFrom
, paraTo
, indexTo
;
110 enum BoolOption
{ // used as self-documenting boolean parameters