00001 /* 00002 Author: Marco Costalba (C) 2005-2006 00003 00004 Copyright: See COPYING file that comes with this distribution 00005 00006 */ 00007 #ifndef FILEVIEW_H 00008 #define FILEVIEW_H 00009 00010 #include <qguardedptr.h> 00011 #include "filebase.h" // needed by moc_* file to understand tab() function 00012 #include "common.h" 00013 #include "domain.h" 00014 00015 class QListViewItem; 00016 class ListView; 00017 class FileContent; 00018 class MainImpl; 00019 class Git; 00020 class TabFile; 00021 class FileHistory; 00022 00023 class FileView: public Domain { 00024 Q_OBJECT 00025 public: 00026 FileView() {} 00027 FileView(MainImpl* m, Git* git); 00028 ~FileView(); 00029 void append(SCRef data); 00030 void clear(bool complete = true); 00031 void historyReady(); 00032 void updateHistViewer(SCRef revSha, SCRef fileName, bool fromUpstream = true); 00033 void eof(); 00034 virtual TabFile* tab() { return fileTab; } 00035 00036 public slots: 00037 void on_toolButtonCopy_clicked(); 00038 void on_toolButtonShowAnnotate_toggled(bool); 00039 void on_toolButtonFindAnnotate_toggled(bool); 00040 void on_toolButtonRangeFilter_toggled(bool); 00041 void on_toolButtonPin_toggled(bool); 00042 void on_toolButtonHighlightText_toggled(bool); 00043 void on_spinBoxRevision_valueChanged(int); 00044 void on_loadCompleted(const FileHistory*, const QString&); 00045 void on_annotationAvailable(bool); 00046 void on_fileAvailable(bool); 00047 void on_revIdSelected(int); 00048 00049 protected: 00050 virtual void customEvent(QCustomEvent* e); 00051 virtual bool doUpdate(bool force); 00052 00053 private: 00054 friend class MainImpl; 00055 friend class FileHighlighter; 00056 00057 void showAnnotation(); 00058 bool goToCurrentAnnotation(); 00059 void updateProgressBar(int annotatedNum); 00060 void filterOnRange(bool b); 00061 void updateSpinBoxValue(); 00062 void updateEnabledButtons(); 00063 00064 TabFile* fileTab; 00065 ListView* histListView; 00066 FileContent* textEditFile; 00067 FileHistory* fh; 00068 bool annotateAvailable; 00069 bool fileAvailable; 00070 }; 00071 00072 #endif