2009-07-01 16:47:37 +02:00
|
|
|
#ifndef ADDRESSBOOK_H
|
|
|
|
|
#define ADDRESSBOOK_H
|
|
|
|
|
|
|
|
|
|
#include <QtGui/QWidget>
|
2009-07-02 11:07:42 +02:00
|
|
|
#include <QtGui/QMessageBox>
|
2009-07-22 15:48:20 +02:00
|
|
|
#include <QtCore/QMap>
|
2009-07-02 11:07:42 +02:00
|
|
|
#include "finddialog.h"
|
2009-07-01 16:47:37 +02:00
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
|
{
|
|
|
|
|
class AddressBook;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AddressBook : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AddressBook(QWidget *parent = 0);
|
2009-07-02 11:07:42 +02:00
|
|
|
enum Mode { NavigationMode, AddingMode, EditingMode };
|
2009-07-01 16:47:37 +02:00
|
|
|
~AddressBook();
|
|
|
|
|
|
2009-07-02 11:07:42 +02:00
|
|
|
public slots:
|
|
|
|
|
void addContact();
|
|
|
|
|
void submitContact();
|
|
|
|
|
void cancel();
|
|
|
|
|
void editContact();
|
|
|
|
|
void removeContact();
|
|
|
|
|
void next();
|
|
|
|
|
void previous();
|
|
|
|
|
void findContact();
|
2009-07-02 11:25:33 +02:00
|
|
|
//! [slot definition]
|
|
|
|
|
void saveToFile();
|
|
|
|
|
void loadFromFile();
|
|
|
|
|
//! [slot definition]
|
2009-07-02 11:07:42 +02:00
|
|
|
|
2009-07-01 16:47:37 +02:00
|
|
|
private:
|
|
|
|
|
Ui::AddressBook *ui;
|
2009-07-02 11:07:42 +02:00
|
|
|
void updateInterface(Mode mode);
|
|
|
|
|
|
|
|
|
|
QMap<QString, QString> contacts;
|
|
|
|
|
QString oldName;
|
|
|
|
|
QString oldAddress;
|
|
|
|
|
Mode currentMode;
|
|
|
|
|
FindDialog *dialog;
|
2009-07-01 16:47:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // ADDRESSBOOK_H
|