Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

chmsearchpanel.h

00001 /*
00002 
00003   Copyright (C) 2003  Razvan Cojocaru <razvanco@gmx.net>
00004  
00005   This program is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009   
00010   This program is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU General Public License for more details.
00014   
00015   You should have received a copy of the GNU General Public License
00016   along with this program; if not, write to the Free Software
00017   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 */
00020 
00021 
00022 #ifndef __CHMSEARCHPANEL_HPP_
00023 #define __CHMSEARCHPANEL_HPP_
00024 
00025 
00026 #include <wx/panel.h>
00027 #include <wx/treectrl.h>
00028 #include <wx/textctrl.h>
00029 #include <wx/listctrl.h>
00030 #include <wx/checkbox.h>
00031 #include <wx/button.h>
00032 #include <wx/listbox.h>
00033 #include <wx/html/htmlwin.h>
00034 #include <wx/font.h>
00035 #include <wx/string.h>
00036 
00037 
00038 // Forward declaration.
00039 class CHMListCtrl;
00040 class CHMHtmlWindow;
00041 
00042 
00049 
00050 enum {
00051         ID_SearchText = 1024,
00052         ID_SearchButton,
00053         ID_Results,
00054 };
00055 
00056 
00058 class CHMSearchPanel : public wxPanel {
00059 
00060 public:
00070         CHMSearchPanel(wxWindow *parent, wxTreeCtrl *topics,
00071                        CHMHtmlWindow* html);
00072 
00074         ~CHMSearchPanel();
00075 
00077         void Reset();
00078 
00080         void SetNewFont(const wxFont& font);
00081 
00082 protected:
00087         void OnSearch(wxCommandEvent& event);
00088 
00090         void OnSearchSel(wxListEvent& event);
00091 
00092 private:
00094         void PopulateList(wxTreeItemId root, wxString& text, bool wholeWords);
00095 
00097         bool TitleSearch(const wxString& title, wxString& text,
00098                          bool caseSensitive, bool wholeWords);
00099 
00101         void GetConfig();
00102 
00104         void SetConfig();
00105 
00106 private:
00107         wxTreeCtrl* _tcl;
00108         wxTextCtrl* _text;
00109         wxCheckBox* _partial;
00110         wxCheckBox* _titles;
00111         wxButton* _search;
00112         CHMListCtrl* _results;
00113         CHMHtmlWindow* _html;
00114 
00115 private:
00116         DECLARE_EVENT_TABLE()
00117 };
00118 
00119 
00120 #endif // __CHMSEARCHPANEL_HPP_
00121 
00122 
00123 /*
00124   Local Variables:
00125   mode: c++
00126   c-basic-offset: 8
00127   tab-width: 8
00128   c-indent-comments-syntactically-p: t
00129   c-tab-always-indent: t
00130   indent-tabs-mode: t
00131   End:
00132 */
00133 
00134 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
00135 

Generated on Fri Nov 17 12:35:46 2006 for xCHM by  doxygen 1.4.4