Changed search to retry automatically couple of times before failing.
[jenirok] / src / common / contactmanager.h
1 /*
2  * This file is part of Jenirok.
3  *
4  * Jenirok 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  * Jenirok 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 Jenirok.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  */
18
19 #ifndef CONTACTMANAGER_H
20 #define CONTACTMANAGER_H
21
22 #include <QtCore/QLibrary>
23 #include <QtCore/QString>
24 #include <QtCore/QStringList>
25 #include <QtCore/QVector>
26 #include <libebook/e-book.h>
27
28 class ContactManager
29 {
30 public:
31     struct Name
32     {
33         QString firstname;
34         QString surname;
35     };
36
37     struct Contact
38     {
39         Name name;
40         QString number;
41         QString street;
42         QString zipCode;
43         QString city;
44         QString country;
45     };
46
47     ContactManager();
48     ~ContactManager();
49     bool addContact(Contact const& contact);
50     bool numberExists(QString const& number);
51     static void stringToName(QString const& strname, Name& name);
52
53 private:
54     bool load();
55     EBook* book_;
56 };
57
58 #endif