blob: 5446be9d4ca71f0b08b42ee531e7155cf1a4d9d1 [file] [log] [blame]
Yingdi Yu3b318c12013-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 Yu4685b1b2013-10-18 17:05:02 -070018#include "contact-manager.h"
Yingdi Yuf8f572d2014-01-13 11:19:47 -080019#include <ndn-cpp/security/key-chain.hpp>
Yingdi Yu3b318c12013-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 Yu76dd8002013-12-24 11:16:32 +080031 explicit ProfileEditor(ndn::ptr_lib::shared_ptr<ContactManager> contactManager,
Yingdi Yu8f7325a2013-10-17 17:03:46 -070032 QWidget *parent = 0);
Yingdi Yu3b318c12013-10-15 17:54:00 -070033
34 ~ProfileEditor();
Yingdi Yue35bdb82013-11-07 11:32:40 -080035
Yingdi Yu76dd8002013-12-24 11:16:32 +080036 void
Yingdi Yue35bdb82013-11-07 11:32:40 -080037 setCurrentIdentity(const ndn::Name& name)
38 { m_currentIdentity = name; }
Yingdi Yu3b318c12013-10-15 17:54:00 -070039
40private slots:
41 void
42 onAddClicked();
43
44 void
45 onDeleteClicked();
46
47 void
48 onOkClicked();
49
Yingdi Yu8f7325a2013-10-17 17:03:46 -070050 void
51 onGetClicked();
52
Yingdi Yu711f5892013-11-09 22:18:26 -080053signals:
54 void
55 noKeyOrCert(const QString&);
Yingdi Yu3b318c12013-10-15 17:54:00 -070056
57private:
58 Ui::ProfileEditor *ui;
59 QSqlTableModel* m_tableModel;
Yingdi Yu76dd8002013-12-24 11:16:32 +080060 ndn::ptr_lib::shared_ptr<ContactManager> m_contactManager;
Yingdi Yuf8f572d2014-01-13 11:19:47 -080061 ndn::ptr_lib::shared_ptr<ndn::KeyChain> m_keyChain;
Yingdi Yu8f7325a2013-10-17 17:03:46 -070062 ndn::Name m_currentIdentity;
Yingdi Yu3b318c12013-10-15 17:54:00 -070063};
64
65#endif // PROFILEEDITOR_H