Fixed issue where the LRC of a card was the reverse of the start
[magread] / carddetect.h
1 /*
2     This file is part of MagRead.
3
4     MagRead is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
8
9     MagRead is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with MagRead.  If not, see <http://www.gnu.org/licenses/>.
16     
17     Written by Jeffrey Malone <ieatlint@tehinterweb.com>
18     http://blog.tehinterweb.com
19 */
20 #ifndef CARDDETECT_H
21 #define CARDDETECT_H
22
23 #include <QMap>
24 #include "magcard.h"
25
26 struct issuer {
27         QString name;
28         QString abbreviation;
29         QString format;
30 };
31
32 class CardDetect {
33         public:
34                 CardDetect( MagCard *_card = 0 );
35                 void setCard( MagCard *_card ); 
36
37         private:
38                 MagCard *card;
39
40                 void processCard();
41
42                 void luhnCheck();
43                 void creditCardCheck();
44                 void aamvaCardCheck( QString expDate );
45                 void aamvaIssuerList();
46                 QMap<QString,struct issuer> issuerList;
47
48 };
49
50
51 #endif // CARDDETECT_H