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 cs tu berlin 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 private slots: 00105 void slotSelectedTextToggled(bool selec); 00106 void slotSearchChanged(); 00107 void slotAddPatternToHistory(); 00108 00109 signals: 00110 void searchChanged(); 00111 void findNextClicked(); 00112 void findPreviousClicked(); 00113 00114 private: 00115 long m_enabled; 00116 QMenu *m_incMenu; 00117 QAction *m_caseSensitive; 00118 QAction *m_wholeWordsOnly; 00119 QAction *m_fromCursor; 00120 QAction *m_selectedText; 00121 QAction *m_regExp; 00122 QString m_prevPattern; 00123 bool m_atEnd; 00124 }; 00125 00126 #endif