forked from kitech/kitphone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sipaccountswindow.h
83 lines (63 loc) · 2.13 KB
/
sipaccountswindow.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// sipaccountswindow.h ---
//
// Author: liuguangzhao
// Copyright (C) 2007-2010 liuguangzhao@users.sf.net
// URL:
// Created: 2010-11-20 17:25:31 +0800
// Version: $Id: sipaccountswindow.h 956 2011-08-24 08:53:52Z drswinghead $
//
#ifndef _SIPACCOUNTSWINDOW_H_
#define _SIPACCOUNTSWINDOW_H_
#include <QtCore>
#include <QtGui>
#include <QtSql>
#include "boost/smart_ptr.hpp"
#include "sipaccount.h"
class AsyncDatabase;
class SqlRequest;
namespace Ui {
class SipAccountsWindow;
}
class SipAccountsWindow : public QDialog
{
Q_OBJECT;
public:
explicit SipAccountsWindow(boost::shared_ptr<AsyncDatabase> adb, QWidget *parent = 0);
virtual ~SipAccountsWindow();
public slots:
void onClose();
void onApply();
void onNewAccount();
void onRemoveAccount();
void onModifyAccount();
void onMakeDefaultAccount();
void onSetLogin(bool checked);
void onGetAllAccounts();
void onGetAccountById(int uid);
bool onNewAccountDone(boost::shared_ptr<SqlRequest> req);
bool onRemoveAccountDone(boost::shared_ptr<SqlRequest> req);
bool onModifyAccountDone(boost::shared_ptr<SqlRequest> req);
bool onMakeDefaultAccountDone(boost::shared_ptr<SqlRequest> req);
bool onGetAllAccountsDone(boost::shared_ptr<SqlRequest> req);
bool onAccountListArrived(const QList<QSqlRecord> & results);
// database exec callbacks
void onSqlExecuteDone(const QList<QSqlRecord> & results, int reqno, bool eret,
const QString &estr, const QVariant &eval);
public:
// void reload();
private:
SipAccount accountFromRow(int row);
signals:
void accountWantRegister(QString display_name, QString user_name, QString serv_addr, bool reg);
// void accountWantRemove(QString userName);
void accountAdded(SipAccount &acc);
// void accountModified(SipAccount &acc); // 删掉,添加两步
void accountRemoved(SipAccount &acc);
private:
Ui::SipAccountsWindow *uiw;
boost::shared_ptr<AsyncDatabase> m_adb;
//// sql reqno <---> sql reqclass
QHash<int, boost::shared_ptr<SqlRequest> > mRequests;
bool m_list_inited;
};
#endif /* _SIPACCOUNTSWINDOW_H_ */