#pragma once #include "apbase.h" #include "apattachment.h" #include #include struct APPropertyValue { QString key; QString value; }; struct APActorFields { QString url; QString username; // without the leading '@' QString display_name; QString summary; // Profile biography/description (bio) QStringList keys; QStringList values; APAttachment* avatar = nullptr; APAttachment* header = nullptr; bool manuallyApprovesFollowers = false; bool discoverable = true; // is discoverable or indexable QString joined_date; QStringList also_known_as; // other Actors representing the same user }; // APActors will have an avatar, display name, username and more that will be fetched using the remote instance // Currently missing: featured tags and featured posts class APActor : APBase { public: // Empty actor APActor(); APActor(const QString& url); APActor(APActorFields& fields); ~APActor(); const QString get_url(); QString get_html_render(HtmlRenderDetails render_info); const QString get_plain_render(); private: friend class TabActorInfo; QString object_url; QString username; QString name; // Display name QString summary; // Profile biography/description (bio) typedef std::vector APPropertyValueList; // Key/value table in profile (example: "web site | http://example.com/") APPropertyValueList table; APAttachment* avatar = nullptr; APAttachment* header = nullptr; bool manuallyApprovesFollowers = false; bool discoverable = true; // is discoverable or indexable QDateTime joined; // TODO: parse the also_known_as field // APActorList known_as; }; class APActorList : public std::vector, APBase { public: QString get_html_render(HtmlRenderDetails render_info); };