blob: 54c586bba29520f0dcfa52152f5b8e7f6cf680a7 [file] [log] [blame]
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2013, Regents of the University of California
* Yingdi Yu
*
* BSD license, See the LICENSE file for more information
*
* Author: Yingdi Yu <yingdi@cs.ucla.edu>
*/
#ifndef CONTACTPANEL_H
#define CONTACTPANEL_H
#include <QDialog>
#include <QStringListModel>
#include <QtSql/QSqlDatabase>
#include <QMenu>
#include "profileeditor.h"
#include "addcontactpanel.h"
#include "setaliasdialog.h"
#ifndef Q_MOC_RUN
#include "contact-manager.h"
#endif
namespace Ui {
class ContactPanel;
}
class ContactPanel : public QDialog
{
Q_OBJECT
public:
explicit ContactPanel(ndn::Ptr<ContactManager> contactManager, QWidget *parent = 0);
~ContactPanel();
private slots:
void
updateSelection(const QItemSelection &selected,
const QItemSelection &deselected);
void
openProfileEditor();
void
openAddContactPanel();
void
openSetAliasDialog();
void
refreshContactList();
void
showContextMenu(const QPoint& pos);
private:
Ui::ContactPanel *ui;
ndn::Ptr<ContactManager> m_contactManager;
QStringListModel* m_contactListModel;
ProfileEditor* m_profileEditor;
AddContactPanel* m_addContactPanel;
SetAliasDialog* m_setAliasDialog;
QAction* m_menuInvite;
QAction* m_menuAlias;
std::vector<ndn::Ptr<ContactItem> > m_contactList;
std::string m_currentSelectedContact;
};
#endif // CONTACTPANEL_H