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., 51 Franklin Street, Fifth Floor, Boston, 
00018   MA 02110-1301, USA.
00019 
00020 */
00021 
00022 
00023 #ifndef __CHMSEARCHPANEL_HPP_
00024 #define __CHMSEARCHPANEL_HPP_
00025 
00026 
00027 #include <wx/panel.h>
00028 #include <wx/treectrl.h>
00029 #include <wx/textctrl.h>
00030 #include <wx/listctrl.h>
00031 #include <wx/checkbox.h>
00032 #include <wx/button.h>
00033 #include <wx/listbox.h>
00034 #include <wx/html/htmlwin.h>
00035 #include <wx/font.h>
00036 #include <wx/string.h>
00037 
00038 
00039 // Forward declaration.
00040 class CHMListCtrl;
00041 class CHMHtmlNotebook;
00042 
00043 
00050 
00051 enum {
00052         ID_SearchText = 1024,
00053         ID_SearchButton,
00054         ID_Results,
00055 };
00056 
00057 
00059 class CHMSearchPanel : public wxPanel {
00060 
00061 public:
00071         CHMSearchPanel(wxWindow *parent, wxTreeCtrl *topics,
00072                        CHMHtmlNotebook* nbhtml);
00073 
00075         ~CHMSearchPanel();
00076 
00078         void Reset();
00079 
00081         void SetNewFont(const wxFont& font);
00082 
00083 protected:
00088         void OnSearch(wxCommandEvent& event);
00089 
00091         void OnSearchSel(wxListEvent& event);
00092 
00093 private:
00095         void PopulateList(wxTreeItemId root, wxString& text, bool wholeWords);
00096 
00098         bool TitleSearch(const wxString& title, wxString& text,
00099                          bool caseSensitive, bool wholeWords);
00100 
00102         void GetConfig();
00103 
00105         void SetConfig();
00106 
00107 private:
00108         wxTreeCtrl* _tcl;
00109         wxTextCtrl* _text;
00110         wxCheckBox* _partial;
00111         wxCheckBox* _titles;
00112         wxButton* _search;
00113         CHMListCtrl* _results;
00114         CHMHtmlNotebook* _nbhtml;
00115 
00116 private:
00117         DECLARE_EVENT_TABLE()
00118 };
00119 
00120 
00121 #endif // __CHMSEARCHPANEL_HPP_
00122 
00123 
00124 /*
00125   Local Variables:
00126   mode: c++
00127   c-basic-offset: 8
00128   tab-width: 8
00129   c-indent-comments-syntactically-p: t
00130   c-tab-always-indent: t
00131   indent-tabs-mode: t
00132   End:
00133 */
00134 
00135 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
00136 

Generated on Tue Apr 14 19:43:38 2009 for xCHM by  doxygen 1.5.4