2022-02-16 21:51:04 +00:00
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
#include "section_item.h"
|
|
|
|
|
|
|
|
namespace Shared::Models
|
|
|
|
{
|
2022-02-09 13:07:54 +00:00
|
|
|
SectionItem::SectionItem(const QString& id,
|
2022-02-16 21:51:04 +00:00
|
|
|
SectionType sectionType,
|
2022-02-09 13:07:54 +00:00
|
|
|
const QString& name,
|
|
|
|
const QString& description,
|
|
|
|
const QString& image,
|
|
|
|
const QString& icon,
|
|
|
|
const QString& color,
|
2022-02-16 21:51:04 +00:00
|
|
|
bool active,
|
|
|
|
bool enabled,
|
|
|
|
bool amISectionAdmin,
|
|
|
|
bool hasNotification,
|
|
|
|
int notificationsCount,
|
|
|
|
bool isMember,
|
|
|
|
bool joined,
|
|
|
|
bool canJoin,
|
|
|
|
bool canManageUsers,
|
|
|
|
bool canRequestAccess,
|
|
|
|
int access,
|
|
|
|
bool ensOnly,
|
2022-02-21 18:03:38 +00:00
|
|
|
QObject* parent)
|
|
|
|
: QObject(parent)
|
|
|
|
, m_id(id)
|
|
|
|
, m_sectionType(sectionType)
|
|
|
|
, m_name(name)
|
|
|
|
, m_amISectionAdmin(amISectionAdmin)
|
|
|
|
, m_description(description)
|
|
|
|
, m_image(image)
|
|
|
|
, m_icon(icon)
|
|
|
|
, m_color(color)
|
|
|
|
, m_hasNotification(hasNotification)
|
|
|
|
, m_notificationsCount(notificationsCount)
|
|
|
|
, m_active(active)
|
|
|
|
, m_enabled(enabled)
|
|
|
|
, m_isMember(isMember)
|
|
|
|
, m_joined(joined)
|
|
|
|
, m_canJoin(canJoin)
|
|
|
|
, m_canManageUsers(canManageUsers)
|
|
|
|
, m_canRequestAccess(canRequestAccess)
|
|
|
|
, m_access(access)
|
|
|
|
, m_ensOnly(ensOnly)
|
|
|
|
{ }
|
2022-02-16 21:51:04 +00:00
|
|
|
|
|
|
|
SectionType SectionItem::getSectionType() const
|
|
|
|
{
|
|
|
|
return m_sectionType;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
const QString& SectionItem::getId() const
|
2022-02-16 21:51:04 +00:00
|
|
|
{
|
|
|
|
return m_id;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
const QString& SectionItem::getName() const
|
2022-02-16 21:51:04 +00:00
|
|
|
{
|
|
|
|
return m_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getAmISectionAdmin() const
|
|
|
|
{
|
|
|
|
return m_amISectionAdmin;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
const QString& SectionItem::getDescription() const
|
2022-02-16 21:51:04 +00:00
|
|
|
{
|
|
|
|
return m_description;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
const QString& SectionItem::getImage() const
|
2022-02-16 21:51:04 +00:00
|
|
|
{
|
|
|
|
return m_image;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
const QString& SectionItem::getIcon() const
|
2022-02-16 21:51:04 +00:00
|
|
|
{
|
|
|
|
return m_icon;
|
|
|
|
}
|
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
const QString& SectionItem::getColor() const
|
2022-02-16 21:51:04 +00:00
|
|
|
{
|
|
|
|
return m_color;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getHasNotification() const
|
|
|
|
{
|
|
|
|
return m_hasNotification;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SectionItem::getNotificationsCount() const
|
|
|
|
{
|
|
|
|
return m_notificationsCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getIsActive() const
|
|
|
|
{
|
|
|
|
return m_active;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getIsEnabled() const
|
|
|
|
{
|
|
|
|
return m_enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getIsMember() const
|
|
|
|
{
|
|
|
|
return m_isMember;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getHasJoined() const
|
|
|
|
{
|
|
|
|
return m_joined;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getCanJoin() const
|
|
|
|
{
|
|
|
|
return m_canJoin;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getCanManageUsers() const
|
|
|
|
{
|
|
|
|
return m_canManageUsers;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getCanRequestAccess() const
|
|
|
|
{
|
|
|
|
return m_canRequestAccess;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SectionItem::getAccess() const
|
|
|
|
{
|
|
|
|
return m_access;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SectionItem::getIsEnsOnly() const
|
|
|
|
{
|
|
|
|
return m_ensOnly;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SectionItem::setIsActive(bool isActive)
|
|
|
|
{
|
|
|
|
if(m_active != isActive)
|
|
|
|
{
|
|
|
|
m_active = isActive;
|
|
|
|
activeChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Shared::Models
|