summaryrefslogtreecommitdiff
path: root/mg_incremental_search.h
blob: 19a249f6ecdffc4871f3e68f5a06ada97e9241c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*! \file  mg_incremental_search.h
 *  \ingroup muggle
 *  \brief  A class that encapsulates incremental search
 *
 *  \version $Revision: $
 *  \date    $Date: $
 *  \author  Lars von Wedel
 *  \author  file owner: $Author: $
 *
 */

/* makes sure we don't use the same declarations twice */
#ifndef _MUGGLE_INCSEARCH_H
#define _MUGGLE_INCSEARCH_H

#include <string>
#include <sys/time.h>

class mgIncrementalSearch
{
	public:
		mgIncrementalSearch();

		std::string KeyStroke( unsigned key );

		std::string Backspace();

	private:
		std::string m_buffer;
		int m_position;
		unsigned m_repeats, m_last_key;

		double m_last_keypress;
};
#endif