/* * Copyright (c) 2018 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include namespace Swift { /** * reference from XEP-0372 */ class SWIFTEN_API ReferencePayload : public Payload { public: typedef std::shared_ptr ref; enum class Type { Data, Mention, PubSub, Unknown }; ReferencePayload(); const Type& getType() const; const boost::optional& getUri() const; const boost::optional& getBegin() const; const boost::optional& getEnd() const; const boost::optional& getAnchor() const; const std::vector>& getPayloads() const; void setType(const Type& type); void setUri(const boost::optional& uri); void setBegin(const boost::optional& begin); void setEnd(const boost::optional& end); void setAnchor(const boost::optional& anchor); void addPayload(const std::shared_ptr& payload); private: Type type_; boost::optional uri_; boost::optional begin_; boost::optional end_; boost::optional anchor_; std::vector> payloads_; }; }