blob: 60996afeb4ec86711d2076e79f60fba055f1827f [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"
24#include <ndn-cxx/security/key-chain.hpp>
25
26#include <QDialog>
27#include <QStandardItemModel>
28
29namespace Ui {
30class KeyViewerDialog;
31}
32
33namespace ndn {
34namespace ncc {
35
36class KeyViewerDialog : public QDialog
37{
38 Q_OBJECT
39
40public:
41 KeyViewerDialog(QWidget *parent = 0);
42
43 virtual
44 ~KeyViewerDialog();
45
46 void
47 updateModel();
48
49private:
50 KeyTreeItem*
51 createIdentityNode(const Name& identity);
52
53 KeyTreeItem*
54 createKeyNode(const Name& keyName, KeyTreeItem* idItem);
55
56signals:
57 void
58 clicked(const QModelIndex &index);
59
60public slots:
61 void
62 present();
63
64private slots:
65 void
66 displayCert(const QModelIndex& index);
67 // void insertChild();
68 // bool insertColumn();
69 // void insertRow();
70 // bool removeColumn();
71 // void removeRow();
72
73private:
74 Ui::KeyViewerDialog* ui;
75
76 shared_ptr<KeyTreeModel> m_model;
77 shared_ptr<KeyChain> m_keyChain;
78
79 shared_ptr<QStandardItemModel> m_tableModel;
80};
81
82} // namespace ncc
83} // namespace ndn
84
85#endif // NDN_NCC_KEY_VIEWER_DIALOG_HPP