blob: 5e20ee5505bed88cc0051d51426dbbd91386fcc7 [file] [log] [blame]
Yingdi Yu9e0dc292013-10-10 11:39:45 -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
Yingdi Yudef90612013-10-09 22:34:42 -070011#ifndef CONTACTPANEL_H
12#define CONTACTPANEL_H
13
14#include <QDialog>
Yingdi Yu01a942b2013-10-10 15:00:58 -070015#include <QStringListModel>
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070016#include <QtSql/QSqlDatabase>
17
18#include "profileeditor.h"
Yingdi Yud59b5932013-10-16 13:16:49 -070019#include "addcontactpanel.h"
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070020
21#ifndef Q_MOC_RUN
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070022#include "contact-manager.h"
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070023#endif
Yingdi Yudef90612013-10-09 22:34:42 -070024
25namespace Ui {
26class ContactPanel;
27}
28
29class ContactPanel : public QDialog
30{
31 Q_OBJECT
32
33public:
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070034 explicit ContactPanel(ndn::Ptr<ContactManager> contactManager, QWidget *parent = 0);
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070035 ~ContactPanel();
Yingdi Yudef90612013-10-09 22:34:42 -070036
Yingdi Yu01a942b2013-10-10 15:00:58 -070037private slots:
38 void
39 updateSelection(const QItemSelection &selected,
40 const QItemSelection &deselected);
41
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070042 void
43 openProfileEditor();
44
Yingdi Yud59b5932013-10-16 13:16:49 -070045 void
46 openAddContactPanel();
47
Yingdi Yudef90612013-10-09 22:34:42 -070048private:
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070049 Ui::ContactPanel *ui;
Yingdi Yu0b82a4e2013-10-18 11:29:25 -070050 ndn::Ptr<ContactManager> m_contactManager;
Yingdi Yu0a6b6c52013-10-15 17:54:00 -070051 QStringListModel* m_contactListModel;
52 ProfileEditor* m_profileEditor;
Yingdi Yud59b5932013-10-16 13:16:49 -070053 AddContactPanel* m_addContactPanel;
Yingdi Yudef90612013-10-09 22:34:42 -070054};
55
56#endif // CONTACTPANEL_H