WordTree
|
00001 /* 00002 * header file for SearchHistory class 00003 * written by: christian moellinger <ch.moellinger@gmail.com> 00004 * 03/2011 - 06/2011 Project "InfoVis: Word Tree" 00005 */ 00006 00007 #ifndef SEARCHHISTORY_H 00008 #define SEARCHHISTORY_H 00009 00010 #include <QDialog> 00011 #include <map> 00012 00013 class WTVisualizedTree; 00014 class QListWidgetItem; 00015 00016 namespace Ui { 00017 class SearchHistory; 00018 } 00019 00020 class SearchHistory : public QDialog 00021 { 00022 Q_OBJECT 00023 00024 public: 00025 /*! \name Construction / Destruction */ 00026 //@{ 00027 /// Constructor 00028 explicit SearchHistory(QWidget *parent = 0); 00029 00030 /// Destructor 00031 ~SearchHistory(); 00032 //@} 00033 00034 /*! \name Methods */ 00035 //@{ 00036 /// adds a new search to the list and stores the result tree 00037 void AddNewSearch(QString sSearchTerm, QSharedPointer<WTVisualizedTree> spVisualizedTree); 00038 //@} 00039 00040 /*! \name Methods */ 00041 //@{ 00042 /// returns the last search to the reference parameters and true as retun value if successfull, else false 00043 bool GetLastSearch(std::string &rsSearchPhrase, QSharedPointer<WTVisualizedTree> &rspVisualizedTree); 00044 //@} 00045 00046 signals: 00047 /*! \name Signals */ 00048 //@{ 00049 /// emitted when a new search is requested (e.g. by clicking on a entry in the search window) 00050 void EmitSearch(QString sSearchTerm); 00051 //@} 00052 00053 private slots: 00054 /*! \name Private slots */ 00055 //@{ 00056 /// handles the click on an item of the list 00057 void HandleItemClicked(QListWidgetItem * pClickedItem); 00058 00059 /// clears the history 00060 void ClearHistory(); 00061 //@} 00062 00063 private: 00064 /*! \name Private members */ 00065 //@{ 00066 Ui::SearchHistory *ui; 00067 00068 std::string m_sLastSearchPhrase; 00069 QSharedPointer<WTVisualizedTree> m_spLastAddedTree; 00070 std::map<QString, QSharedPointer<WTVisualizedTree> > m_mAlreadyVisualizedTrees; 00071 //@} 00072 }; 00073 00074 #endif // SEARCHHISTORY_H