KHTML
khtmlfindbar.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 * 00003 * Copyright (C) 2008 Bernhard Beschow <bbeschow AT cs DOT tu-berlin DOT de> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library 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 GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef __khtml_findbar_h__ 00021 #define __khtml_findbar_h__ 00022 00023 #include "khtmlviewbarwidget.h" 00024 #include "ui_khtmlfindbar_base.h" 00025 00026 class QMenu; 00027 class QAction; 00028 00029 class KHTMLFindBar : public KHTMLViewBarWidget, private Ui::KHTMLFindBarBase 00030 { 00031 Q_OBJECT 00032 public: 00033 KHTMLFindBar( QWidget *parent = 0 ); 00034 00043 void setFindHistory( const QStringList &history ); 00044 00050 QStringList findHistory() const; 00051 00052 /* 00053 * makes the current pattern be the first entry of the find history. 00054 * Return false if the history was empty. 00055 * 00056 */ 00057 bool restoreLastPatternFromHistory(); 00058 00065 void setHasSelection( bool hasSelection ); 00066 00074 void setHasCursor( bool hasCursor ); 00075 00084 void setOptions( long options ); 00085 00093 long options() const; 00094 00098 QString pattern() const; 00099 00100 void setFoundMatch( bool match ); 00101 void setAtEnd( bool atEnd ); 00102 virtual void setVisible( bool visible ); 00103 00104 protected: 00105 virtual bool event(QEvent* e); 00106 00107 private slots: 00108 void slotSelectedTextToggled(bool selec); 00109 void slotSearchChanged(); 00110 void slotAddPatternToHistory(); 00111 00112 signals: 00113 void searchChanged(); 00114 void findNextClicked(); 00115 void findPreviousClicked(); 00116 00117 private: 00118 long m_enabled; 00119 QMenu *m_incMenu; 00120 QAction *m_caseSensitive; 00121 QAction *m_wholeWordsOnly; 00122 QAction *m_fromCursor; 00123 QAction *m_selectedText; 00124 QAction *m_regExp; 00125 QString m_prevPattern; 00126 bool m_atEnd; 00127 }; 00128 00129 #endif