/* * Copyright (c) 2013 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include #include #include namespace Swift { class ContactListDelegate; class ContactListModel; class SettingsProvider; class QtRemovableItemDelegate; class QtContactListWidget : public QTreeView { Q_OBJECT public: QtContactListWidget(QWidget* parent, SettingsProvider* settings); virtual ~QtContactListWidget(); void setList(const std::vector& list); std::vector getList() const; Contact::ref getContact(const size_t i); void setMaximumNoOfContactsToOne(bool limited); bool isFull() const; public slots: void updateContacts(const std::vector& contactUpdates); signals: void onListChanged(std::vector list); void onJIDsAdded(const std::vector& jids); private: void handleSettingsChanged(const std::string&); private: SettingsProvider* settings_; ContactListModel* contactListModel_; ContactListDelegate* contactListDelegate_; QtRemovableItemDelegate* removableItemDelegate_; bool limited_; }; }