diff --git a/src/itemdataroles.h b/src/itemdataroles.h index 0737bea5a00f6d7e279ce6f7c1ae4885db22d93b..2c9334e6310ef83ea4fb9179d6d69177500512bc 100644 --- a/src/itemdataroles.h +++ b/src/itemdataroles.h @@ -36,6 +36,7 @@ enum class Role { DisplayRole = Qt::DisplayRole , Object = Qt::UserRole + 1, + ObjectType , Name , Number , LastUsed , @@ -45,4 +46,20 @@ enum class Role DropState , UserRole = Qt::UserRole + 100 // this should always be the last role in the list }; + +/** + * All LRC models that store more than one type of class (eg: RecentModel) should return a member of + * this enum when ::data(Ring::Role::ObjectType) is called on one of their indeces. This is to + * simplify LRC and client logic by not having to dynamic_cast the pointer stored in the index. + */ +enum class ObjectType +{ + Person, + ContactMethod, + Call, + Media, +}; + } // namespace Ring + +Q_DECLARE_METATYPE(Ring::ObjectType)