blob: 6f8477c688eda8e7b097c70a9a5b5ea3f166271b [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 Yu64206112013-12-24 11:16:32 +080019#include <ndn-cpp/security/identity/identity-manager.hpp>
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 Yu64206112013-12-24 11:16:32 +080031 explicit ProfileEditor(ndn::ptr_lib::shared_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
Yingdi Yu64206112013-12-24 11:16:32 +080036 void
Yingdi Yub35b8652013-11-07 11:32:40 -080037 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 Yu64206112013-12-24 11:16:32 +080060 ndn::ptr_lib::shared_ptr<ContactManager> m_contactManager;
61 ndn::ptr_lib::shared_ptr<ndn::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