@ -31,15 +31,59 @@ public:
} ;
} ;
Q_ENUM ( Category )
Q_ENUM ( Category )
Q_PROPERTY ( const QString & unicode MEMBER unicode )
Q_PROPERTY ( QString unicode READ unicode CONSTANT )
Q_PROPERTY ( const QString & shortName MEMBER shortName )
Q_PROPERTY ( QString shortName READ shortName CONSTANT )
Q_PROPERTY ( const QString & unicodeName MEMBER unicodeName )
Q_PROPERTY ( QString unicodeName READ unicodeName CONSTANT )
Q_PROPERTY ( emoji : : Emoji : : Category category MEMBER category )
Q_PROPERTY ( emoji : : Emoji : : Category category MEMBER category )
public :
public :
QString unicode ;
constexpr Emoji ( std : : u16string_view unicode ,
QString shortName ;
std : : u16string_view shortName ,
QString unicodeName ;
std : : u16string_view unicodeName ,
Category cat )
: unicode_ ( unicode )
, shortName_ ( shortName )
, unicodeName_ ( unicodeName )
, category ( cat )
{
}
constexpr Emoji ( )
: unicode_ ( u " " , 1 )
, shortName_ ( u " " , 1 )
, unicodeName_ ( u " " , 1 )
, category ( Category : : Search )
{
}
constexpr Emoji ( const Emoji & ) = default ;
constexpr Emoji ( Emoji & & ) = default ;
constexpr Emoji & operator = ( const Emoji & ) = default ;
constexpr Emoji & operator = ( Emoji & & ) = default ;
QString unicode ( ) const
{
return QString : : fromRawData ( reinterpret_cast < const QChar * > ( unicode_ . data ( ) ) ,
unicode_ . size ( ) ) ;
}
QString shortName ( ) const
{
return QString : : fromRawData ( reinterpret_cast < const QChar * > ( shortName_ . data ( ) ) ,
shortName_ . size ( ) ) ;
}
QString unicodeName ( ) const
{
return QString : : fromRawData ( reinterpret_cast < const QChar * > ( unicodeName_ . data ( ) ) ,
unicodeName_ . size ( ) ) ;
}
private :
std : : u16string_view unicode_ ;
std : : u16string_view shortName_ ;
std : : u16string_view unicodeName_ ;
public :
Category category ;
Category category ;
} ;
} ;