Version 2.6
[qgit4/redivivus.git] / src / fileview.h
blob3996e3a1bce1ab464bcdb4c7cb8749873afa22be
1 /*
2 Author: Marco Costalba (C) 2005-2007
4 Copyright: See COPYING file that comes with this distribution
6 */
7 #ifndef FILEVIEW_H
8 #define FILEVIEW_H
10 #include "ui_fileview.h" // needed by moc_* file to understand tab() function
11 #include "common.h"
12 #include "domain.h"
14 class MainImpl;
15 class Git;
16 class FileHistory;
18 class FileView: public Domain {
19 Q_OBJECT
20 public:
21 FileView() {}
22 FileView(MainImpl* m, Git* git);
23 ~FileView();
24 virtual void clear(bool complete = true);
25 void append(SCRef data);
26 void historyReady();
27 void updateHistViewer(SCRef revSha, SCRef fileName, bool fromUpstream = true);
28 void eof();
29 Ui_TabFile* tab() { return fileTab; }
31 public slots:
32 void on_toolButtonCopy_clicked();
33 void on_toolButtonShowAnnotate_toggled(bool);
34 void on_toolButtonFindAnnotate_toggled(bool);
35 void on_toolButtonGoNext_clicked();
36 void on_toolButtonGoPrev_clicked();
37 void on_toolButtonRangeFilter_toggled(bool);
38 void on_toolButtonPin_toggled(bool);
39 void on_toolButtonHighlightText_toggled(bool);
40 void on_spinBoxRevision_valueChanged(int);
41 void on_loadCompleted(const FileHistory*, const QString&);
42 void on_annotationAvailable(bool);
43 void on_fileAvailable(bool);
44 void on_revIdSelected(int);
46 protected:
47 virtual bool doUpdate(bool force);
48 virtual bool isMatch(SCRef sha);
49 virtual bool eventFilter(QObject *obj, QEvent *e);
51 private:
52 friend class MainImpl;
53 friend class FileHighlighter;
55 void showAnnotation();
56 bool goToCurrentAnnotation(int direction = 0);
57 void filterOnRange(bool b);
58 void updateSpinBoxValue();
59 void updateEnabledButtons();
61 Ui_TabFile* fileTab;
64 #endif