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