compile
[kdegraphics.git] / okular / ui / searchlineedit.h
blob314df956b507047c23bfa2710d2dcc245ead6869
1 /***************************************************************************
2 * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
3 * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
11 #ifndef _OKULAR_SEARCHLINEEDIT_H_
12 #define _OKULAR_SEARCHLINEEDIT_H_
14 #include "core/document.h"
16 #include <klineedit.h>
18 class QTimer;
20 /**
21 * @short A line edit for find-as-you-type search. Outputs to the Document.
23 class SearchLineEdit : public KLineEdit
25 Q_OBJECT
26 public:
27 SearchLineEdit( QWidget *parent, Okular::Document *document );
29 void clearText();
31 void setSearchCaseSensitivity( Qt::CaseSensitivity cs );
32 void setSearchMinimumLength( int length );
33 void setSearchType( Okular::Document::SearchType type );
34 void setSearchId( int id );
35 void setSearchColor( const QColor &color );
36 void setSearchMoveViewport( bool move );
37 void setSearchFromStart( bool fromStart );
39 public slots:
40 void restartSearch();
41 void findNext();
42 void findPrev();
44 private:
45 Okular::Document * m_document;
46 QTimer * m_inputDelayTimer;
47 int m_minLength;
48 Qt::CaseSensitivity m_caseSensitivity;
49 Okular::Document::SearchType m_searchType;
50 int m_id;
51 QColor m_color;
52 bool m_moveViewport;
53 bool m_changed;
54 bool m_fromStart;
56 private slots:
57 void slotTextChanged( const QString & text );
58 void startSearch();
59 void searchFinished( int id, Okular::Document::SearchStatus endStatus );
62 #endif