Yingdi Yu | 0a6b6c5 | 2013-10-15 17:54:00 -0700 | [diff] [blame] | 1 | /* -*- 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 Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 18 | #include "contact-manager.h" |
Yingdi Yu | 71ec965 | 2013-11-09 22:18:26 -0800 | [diff] [blame^] | 19 | #include <ndn.cxx/security/identity/identity-manager.h> |
Yingdi Yu | 0a6b6c5 | 2013-10-15 17:54:00 -0700 | [diff] [blame] | 20 | #endif |
| 21 | |
| 22 | namespace Ui { |
| 23 | class ProfileEditor; |
| 24 | } |
| 25 | |
| 26 | class ProfileEditor : public QDialog |
| 27 | { |
| 28 | Q_OBJECT |
| 29 | |
| 30 | public: |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 31 | explicit ProfileEditor(ndn::Ptr<ContactManager> contactManager, |
Yingdi Yu | c26af3c | 2013-10-17 17:03:46 -0700 | [diff] [blame] | 32 | QWidget *parent = 0); |
Yingdi Yu | 0a6b6c5 | 2013-10-15 17:54:00 -0700 | [diff] [blame] | 33 | |
| 34 | ~ProfileEditor(); |
Yingdi Yu | b35b865 | 2013-11-07 11:32:40 -0800 | [diff] [blame] | 35 | |
| 36 | inline void |
| 37 | setCurrentIdentity(const ndn::Name& name) |
| 38 | { m_currentIdentity = name; } |
Yingdi Yu | 0a6b6c5 | 2013-10-15 17:54:00 -0700 | [diff] [blame] | 39 | |
| 40 | private slots: |
| 41 | void |
| 42 | onAddClicked(); |
| 43 | |
| 44 | void |
| 45 | onDeleteClicked(); |
| 46 | |
| 47 | void |
| 48 | onOkClicked(); |
| 49 | |
Yingdi Yu | c26af3c | 2013-10-17 17:03:46 -0700 | [diff] [blame] | 50 | void |
| 51 | onGetClicked(); |
| 52 | |
Yingdi Yu | 71ec965 | 2013-11-09 22:18:26 -0800 | [diff] [blame^] | 53 | signals: |
| 54 | void |
| 55 | noKeyOrCert(const QString&); |
Yingdi Yu | 0a6b6c5 | 2013-10-15 17:54:00 -0700 | [diff] [blame] | 56 | |
| 57 | private: |
| 58 | Ui::ProfileEditor *ui; |
| 59 | QSqlTableModel* m_tableModel; |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 60 | ndn::Ptr<ContactManager> m_contactManager; |
Yingdi Yu | 71ec965 | 2013-11-09 22:18:26 -0800 | [diff] [blame^] | 61 | ndn::Ptr<ndn::security::IdentityManager> m_identityManager; |
Yingdi Yu | c26af3c | 2013-10-17 17:03:46 -0700 | [diff] [blame] | 62 | ndn::Name m_currentIdentity; |
Yingdi Yu | 0a6b6c5 | 2013-10-15 17:54:00 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | #endif // PROFILEEDITOR_H |