1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(contact): Add Contact class

This commit is contained in:
Diadlo 2017-07-29 20:48:50 +03:00
parent 6c85e542a3
commit 90f4750e73
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
4 changed files with 71 additions and 0 deletions

View File

@ -251,6 +251,8 @@ set(${PROJECT_NAME}_SOURCES
src/grouplist.h
src/ipc.cpp
src/ipc.h
src/model/contact.cpp
src/model/contact.h
src/model/friend.cpp
src/model/friend.h
src/model/group.cpp

View File

@ -369,6 +369,7 @@ HEADERS += \
src/groupinvite.h \
src/grouplist.h \
src/ipc.h \
src/model/contact.h \
src/model/friend.h \
src/model/group.h \
src/net/autoupdate.h \
@ -491,6 +492,7 @@ SOURCES += \
src/grouplist.cpp \
src/ipc.cpp \
src/main.cpp \
src/model/contact.cpp \
src/model/friend.cpp \
src/model/group.cpp \
src/net/autoupdate.cpp \

27
src/model/contact.cpp Normal file
View File

@ -0,0 +1,27 @@
/*
Copyright © 2017 by The qTox Project Contributors
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qTox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#include "contact.h"
#include <QVariant>
Contact::~Contact()
{
}

40
src/model/contact.h Normal file
View File

@ -0,0 +1,40 @@
/*
Copyright © 2017 by The qTox Project Contributors
This file is part of qTox, a Qt-based graphical interface for Tox.
qTox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
qTox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with qTox. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONTACT_H
#define CONTACT_H
#include <QObject>
#include <QString>
class Contact : public QObject
{
Q_OBJECT
public:
virtual ~Contact() = 0;
virtual void setName(const QString& name) = 0;
virtual QString getDisplayedName() const = 0;
virtual uint32_t getId() const = 0;
virtual void setEventFlag(bool flag) = 0;
virtual bool getEventFlag() const = 0;
};
#endif // CONTACT_H