| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2009 Alberto Scarpa * |
| 3 |
* 2009 Enrico Ros <enrico.ros@email.it> * |
| 4 |
* 2009 Alberto Scarpa <skaal.sl@gmail.com> * |
| 5 |
* * |
| 6 |
* Permission is hereby granted, free of charge, to any person * |
| 7 |
* obtaining a copy of this software and associated documentation * |
| 8 |
* files (the "Software"), to deal in the Software without * |
| 9 |
* restriction, including without limitation the rights to use, * |
| 10 |
* copy, modify, merge, publish, distribute, sublicense, and/or sell * |
| 11 |
* copies of the Software, and to permit persons to whom the * |
| 12 |
* Software is furnished to do so, subject to the following * |
| 13 |
* conditions: * |
| 14 |
* * |
| 15 |
* The above copyright notice and this permission notice shall be * |
| 16 |
* included in all copies or substantial portions of the Software. * |
| 17 |
* * |
| 18 |
***************************************************************************/ |
| 19 |
|
| 20 |
#ifndef __Scrambler_h__ |
| 21 |
#define __Scrambler_h__ |
| 22 |
|
| 23 |
#include <QStringList> |
| 24 |
#include <QMap> |
| 25 |
|
| 26 |
class Scrambler |
| 27 |
{ |
| 28 |
public: |
| 29 |
Scrambler(); |
| 30 |
~Scrambler(); |
| 31 |
|
| 32 |
// 1 word 1 line |
| 33 |
void addDictionary( const QString & filename); |
| 34 |
|
| 35 |
// return all the word matching in the dictionary |
| 36 |
QStringList words( const QString & base, int min = 1, int max = -1 ); |
| 37 |
|
| 38 |
// return |
| 39 |
QStringList allWords( const QString & base, int min = 1, int max = -1 ); |
| 40 |
|
| 41 |
// feedback functions |
| 42 |
void setOk( const QString & word ); |
| 43 |
void setFail( const QString & word ); |
| 44 |
|
| 45 |
private: |
| 46 |
QMap<QChar, QStringList> m_dictionaries; |
| 47 |
}; |
| 48 |
|
| 49 |
#endif // SCRAMBLER_H |