2007-03-17 16:58:01 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
|
|
|
|
* Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _OKULAR_SEARCHLINEEDIT_H_
|
|
|
|
#define _OKULAR_SEARCHLINEEDIT_H_
|
|
|
|
|
|
|
|
#include "core/document.h"
|
|
|
|
|
|
|
|
#include <klineedit.h>
|
|
|
|
|
|
|
|
class QTimer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @short A line edit for find-as-you-type search. Outputs to the Document.
|
|
|
|
*/
|
|
|
|
class SearchLineEdit : public KLineEdit
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
SearchLineEdit( QWidget *parent, Okular::Document *document );
|
|
|
|
|
|
|
|
void clearText();
|
|
|
|
|
|
|
|
void setSearchCaseSensitivity( Qt::CaseSensitivity cs );
|
|
|
|
void setSearchMinimumLength( int length );
|
|
|
|
void setSearchType( Okular::Document::SearchType type );
|
|
|
|
void setSearchId( int id );
|
|
|
|
void setSearchColor( const QColor &color );
|
2007-03-17 18:02:23 +00:00
|
|
|
void setSearchMoveViewport( bool move );
|
2007-03-17 16:58:01 +00:00
|
|
|
|
2007-03-23 23:28:39 +00:00
|
|
|
public slots:
|
2007-03-17 16:58:01 +00:00
|
|
|
void restartSearch();
|
2007-03-17 17:28:16 +00:00
|
|
|
void findNext();
|
2007-03-17 16:58:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Okular::Document * m_document;
|
|
|
|
QTimer * m_inputDelayTimer;
|
|
|
|
int m_minLength;
|
|
|
|
Qt::CaseSensitivity m_caseSensitivity;
|
|
|
|
Okular::Document::SearchType m_searchType;
|
|
|
|
int m_id;
|
|
|
|
QColor m_color;
|
2007-03-17 18:02:23 +00:00
|
|
|
bool m_moveViewport;
|
2007-03-17 17:28:16 +00:00
|
|
|
bool m_changed;
|
2007-03-17 16:58:01 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotTextChanged( const QString & text );
|
|
|
|
void startSearch();
|
2007-08-23 22:16:37 +00:00
|
|
|
void searchFinished( int id, Okular::Document::SearchStatus endStatus );
|
2007-03-17 16:58:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|