blob: 7a5c6f71748fdb6e26d618ff753c0435032efdf0 [file] [log] [blame]
Yingdi Yu0a6b6c52013-10-15 17:54:00 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013, Regents of the University of California
4 * Yingdi Yu
5 *
6 * BSD license, See the LICENSE file for more information
7 *
8 * Author: Yingdi Yu <yingdi@cs.ucla.edu>
9 */
10
11#ifndef PROFILEEDITOR_H
12#define PROFILEEDITOR_H
13
14#include <QDialog>
15#include <QtSql/QSqlTableModel>
16
17#ifndef Q_MOC_RUN
Yingdi Yuaa8d7692013-10-18 17:05:02 -070018#include "contact-manager.h"
Yingdi Yu71ec9652013-11-09 22:18:26 -080019#include <ndn.cxx/security/identity/identity-manager.h>
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070020#endif
21
22namespace Ui {
23class ProfileEditor;
24}
25
26class ProfileEditor : public QDialog
27{
28 Q_OBJECT
29
30public:
Yingdi Yuaa8d7692013-10-18 17:05:02 -070031 explicit ProfileEditor(ndn::Ptr<ContactManager> contactManager,
Yingdi Yuc26af3c2013-10-17 17:03:46 -070032 QWidget *parent = 0);
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070033
34 ~ProfileEditor();
Yingdi Yub35b8652013-11-07 11:32:40 -080035
36 inline void
37 setCurrentIdentity(const ndn::Name& name)
38 { m_currentIdentity = name; }
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070039
40private slots:
41 void
42 onAddClicked();
43
44 void
45 onDeleteClicked();
46
47 void
48 onOkClicked();
49
Yingdi Yuc26af3c2013-10-17 17:03:46 -070050 void
51 onGetClicked();
52
Yingdi Yu71ec9652013-11-09 22:18:26 -080053signals:
54 void
55 noKeyOrCert(const QString&);
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070056
57private:
58 Ui::ProfileEditor *ui;
59 QSqlTableModel* m_tableModel;
Yingdi Yuaa8d7692013-10-18 17:05:02 -070060 ndn::Ptr<ContactManager> m_contactManager;
Yingdi Yu71ec9652013-11-09 22:18:26 -080061 ndn::Ptr<ndn::security::IdentityManager> m_identityManager;
Yingdi Yuc26af3c2013-10-17 17:03:46 -070062 ndn::Name m_currentIdentity;
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070063};
64
65#endif // PROFILEEDITOR_H