blob: 01261a569d41435bb2ffb6c063ca3b5c31f85aa6 [file] [log] [blame]
Yingdi Yu1f824642016-03-20 17:07:22 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2013-2014, Regents of the University of California,
4 *
5 * This file is part of NFD Control Center. See AUTHORS.md for complete list of NFD
6 * authors and contributors.
7 *
8 * NFD Control Center is free software: you can redistribute it and/or modify it under the
9 * terms of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * NFD Control Center is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with NFD
17 * Control Center, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef NDN_NCC_KEY_VIEWER_DIALOG_HPP
21#define NDN_NCC_KEY_VIEWER_DIALOG_HPP
22
23#include "key-tree-model.hpp"
Yingdi Yu95dbc712016-03-21 09:56:57 -070024#include "cert-tree-model.hpp"
Yingdi Yu1f824642016-03-20 17:07:22 -070025#include <ndn-cxx/security/key-chain.hpp>
26
27#include <QDialog>
Yingdi Yu95dbc712016-03-21 09:56:57 -070028
Yingdi Yu1f824642016-03-20 17:07:22 -070029
30namespace Ui {
31class KeyViewerDialog;
32}
33
34namespace ndn {
35namespace ncc {
36
37class KeyViewerDialog : public QDialog
38{
39 Q_OBJECT
40
41public:
42 KeyViewerDialog(QWidget *parent = 0);
43
44 virtual
45 ~KeyViewerDialog();
46
47 void
48 updateModel();
49
50private:
51 KeyTreeItem*
52 createIdentityNode(const Name& identity);
53
54 KeyTreeItem*
55 createKeyNode(const Name& keyName, KeyTreeItem* idItem);
56
57signals:
58 void
59 clicked(const QModelIndex &index);
60
61public slots:
62 void
63 present();
64
65private slots:
66 void
67 displayCert(const QModelIndex& index);
68 // void insertChild();
69 // bool insertColumn();
70 // void insertRow();
71 // bool removeColumn();
72 // void removeRow();
73
74private:
75 Ui::KeyViewerDialog* ui;
76
77 shared_ptr<KeyTreeModel> m_model;
78 shared_ptr<KeyChain> m_keyChain;
79
Yingdi Yu95dbc712016-03-21 09:56:57 -070080 shared_ptr<CertTreeModel> m_tableModel;
Yingdi Yu1f824642016-03-20 17:07:22 -070081};
82
83} // namespace ncc
84} // namespace ndn
85
86#endif // NDN_NCC_KEY_VIEWER_DIALOG_HPP