diff options
Diffstat (limited to 'Swiften/Elements')
52 files changed, 0 insertions, 1654 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Elements/AuthChallenge.h b/Swiften/Elements/AuthChallenge.h deleted file mode 100644 index b8a9297..0000000 --- a/Swiften/Elements/AuthChallenge.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "Swiften/Base/ByteArray.h" -#include "Swiften/Elements/Element.h" - -namespace Swift { - class AuthChallenge : public Element { - public: - AuthChallenge(const ByteArray& value = "") : value(value) { - } - - const ByteArray& getValue() const { - return value; - } - - void setValue(const ByteArray& value) { - this->value = value; - } - - private: - ByteArray value; - }; -} diff --git a/Swiften/Elements/AuthFailure.h b/Swiften/Elements/AuthFailure.h deleted file mode 100644 index b1857b3..0000000 --- a/Swiften/Elements/AuthFailure.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef SWIFTEN_AuthFailure_H -#define SWIFTEN_AuthFailure_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class AuthFailure : public Element { - public: - AuthFailure() {} - }; -} - -#endif diff --git a/Swiften/Elements/AuthRequest.h b/Swiften/Elements/AuthRequest.h deleted file mode 100644 index 1f49175..0000000 --- a/Swiften/Elements/AuthRequest.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef SWIFTEN_AuthRequest_H -#define SWIFTEN_AuthRequest_H - -#include "Swiften/Base/ByteArray.h" -#include "Swiften/Elements/Element.h" - -namespace Swift { - class AuthRequest : public Element { - public: - AuthRequest(const String& mechanism = "", const ByteArray& message = "") : - mechanism_(mechanism), message_(message) { - } - - const ByteArray& getMessage() const { - return message_; - } - - void setMessage(const ByteArray& message) { - message_ = message; - } - - const String& getMechanism() const { - return mechanism_; - } - - void setMechanism(const String& mechanism) { - mechanism_ = mechanism; - } - - private: - String mechanism_; - ByteArray message_; - }; -} - -#endif diff --git a/Swiften/Elements/AuthResponse.h b/Swiften/Elements/AuthResponse.h deleted file mode 100644 index 8a0679f..0000000 --- a/Swiften/Elements/AuthResponse.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "Swiften/Base/ByteArray.h" -#include "Swiften/Elements/Element.h" - -namespace Swift { - class AuthResponse : public Element { - public: - AuthResponse(const ByteArray& value = "") : value(value) { - } - - const ByteArray& getValue() const { - return value; - } - - void setValue(const ByteArray& value) { - this->value = value; - } - - private: - ByteArray value; - }; -} diff --git a/Swiften/Elements/AuthSuccess.h b/Swiften/Elements/AuthSuccess.h deleted file mode 100644 index 1db1729..0000000 --- a/Swiften/Elements/AuthSuccess.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "Swiften/Elements/Element.h" -#include "Swiften/Base/ByteArray.h" - -namespace Swift { - class AuthSuccess : public Element { - public: - AuthSuccess() {} - - const ByteArray& getValue() const { - return value; - } - - void setValue(const ByteArray& value) { - this->value = value; - } - - private: - ByteArray value; - }; -} diff --git a/Swiften/Elements/Body.h b/Swiften/Elements/Body.h deleted file mode 100644 index d78cecf..0000000 --- a/Swiften/Elements/Body.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef SWIFTEN_Body_H -#define SWIFTEN_Body_H - -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" - -namespace Swift { - class Body : public Payload { - public: - Body(const String& text = "") : text_(text) { - } - - void setText(const String& text) { - text_ = text; - } - - const String& getText() const { - return text_; - } - - private: - String text_; - }; -} - -#endif diff --git a/Swiften/Elements/CapsInfo.h b/Swiften/Elements/CapsInfo.h deleted file mode 100644 index 4b478aa..0000000 --- a/Swiften/Elements/CapsInfo.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SWIFTEN_CapsInfo_H -#define SWIFTEN_CapsInfo_H - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class CapsInfo : public Payload { - public: - CapsInfo(const String& node, const String& version, const String& hash = "sha-1") : node_(node), version_(version), hash_(hash) {} - - const String& getNode() const { return node_; } - const String& getVersion() const { return version_; } - const String& getHash() const { return hash_; } - - private: - String node_; - String version_; - String hash_; - }; -} - -#endif diff --git a/Swiften/Elements/ChatState.h b/Swiften/Elements/ChatState.h deleted file mode 100644 index 3378cc3..0000000 --- a/Swiften/Elements/ChatState.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class ChatState : public Payload { - public: - enum ChatStateType {Active, Composing, Paused, Inactive, Gone}; - ChatState(ChatStateType state = Active) { - state_ = state; - } - - ChatStateType getChatState() { return state_; } - void setChatState(ChatStateType state) {state_ = state;} - - private: - ChatStateType state_; - }; -} diff --git a/Swiften/Elements/CompressFailure.h b/Swiften/Elements/CompressFailure.h deleted file mode 100644 index 880f71a..0000000 --- a/Swiften/Elements/CompressFailure.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef SWIFTEN_CompressFailure_H -#define SWIFTEN_CompressFailure_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class CompressFailure : public Element { - public: - CompressFailure() {} - }; -} - -#endif diff --git a/Swiften/Elements/CompressRequest.h b/Swiften/Elements/CompressRequest.h deleted file mode 100644 index 53c0805..0000000 --- a/Swiften/Elements/CompressRequest.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef SWIFTEN_CompressRequest_H -#define SWIFTEN_CompressRequest_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class CompressRequest : public Element - { - public: - CompressRequest(const String& method = "") : method_(method) {} - - const String& getMethod() const { - return method_; - } - - void setMethod(const String& method) { - method_ = method; - } - - private: - String method_; - }; -} - -#endif diff --git a/Swiften/Elements/Compressed.h b/Swiften/Elements/Compressed.h deleted file mode 100644 index 37113d8..0000000 --- a/Swiften/Elements/Compressed.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SWIFTEN_COMPRESSED_H -#define SWIFTEN_COMPRESSED_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class Compressed : public Element - { - public: - Compressed() {} - }; -} - -#endif diff --git a/Swiften/Elements/DiscoInfo.cpp b/Swiften/Elements/DiscoInfo.cpp deleted file mode 100644 index 63ee051..0000000 --- a/Swiften/Elements/DiscoInfo.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "Swiften/Elements/DiscoInfo.h" - -namespace Swift { - -bool DiscoInfo::Identity::operator<(const Identity& other) const { - if (category_ == other.category_) { - if (type_ == other.type_) { - if (lang_ == other.lang_) { - return name_ < other.name_; - } - else { - return lang_ < other.lang_; - } - } - else { - return type_ < other.type_; - } - } - else { - return category_ < other.category_; - } -} - -const std::string DiscoInfo::SecurityLabels = "urn:xmpp:sec-label:0"; -} diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h deleted file mode 100644 index 8caeaf9..0000000 --- a/Swiften/Elements/DiscoInfo.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef SWIFTEN_DiscoInfo_H -#define SWIFTEN_DiscoInfo_H - -#include <vector> -#include <algorithm> - -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" - -namespace Swift { - class DiscoInfo : public Payload { - public: - const static std::string SecurityLabels; - class Identity { - public: - Identity(const String& name, const String& category = "client", const String& type = "pc", const String& lang = "") : name_(name), category_(category), type_(type), lang_(lang) { - } - - const String& getCategory() const { - return category_; - } - - const String& getType() const { - return type_; - } - - const String& getLanguage() const { - return lang_; - } - - const String& getName() const { - return name_; - } - - // Sorted according to XEP-115 rules - bool operator<(const Identity& other) const; - - private: - String name_; - String category_; - String type_; - String lang_; - }; - - DiscoInfo() { - } - - const String& getNode() const { - return node_; - } - - void setNode(const String& node) { - node_ = node; - } - - const std::vector<Identity> getIdentities() const { - return identities_; - } - - void addIdentity(const Identity& identity) { - identities_.push_back(identity); - } - - const std::vector<String>& getFeatures() const { - return features_; - } - - void addFeature(const String& feature) { - features_.push_back(feature); - } - - bool hasFeature(const String& feature) const { - return std::find(features_.begin(), features_.end(), feature) != features_.end(); - } - - private: - String node_; - std::vector<Identity> identities_; - std::vector<String> features_; - }; -} - -#endif diff --git a/Swiften/Elements/Element.cpp b/Swiften/Elements/Element.cpp deleted file mode 100644 index a62aad9..0000000 --- a/Swiften/Elements/Element.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Swiften/Elements/Element.h" - -namespace Swift { - -Element::~Element() { -} - -} diff --git a/Swiften/Elements/Element.h b/Swiften/Elements/Element.h deleted file mode 100644 index d1e9c6a..0000000 --- a/Swiften/Elements/Element.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef SWIFTEN_ELEMENT_H -#define SWIFTEN_ELEMENT_H - -namespace Swift { - class Element { - public: - virtual ~Element(); - }; -} - -#endif diff --git a/Swiften/Elements/ErrorPayload.h b/Swiften/Elements/ErrorPayload.h deleted file mode 100644 index 32fd067..0000000 --- a/Swiften/Elements/ErrorPayload.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once - -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" - -namespace Swift { - class ErrorPayload : public Payload { - public: - enum Type { Cancel, Continue, Modify, Auth, Wait }; - - enum Condition { - BadRequest, - Conflict, - FeatureNotImplemented, - Forbidden, - Gone, - InternalServerError, - ItemNotFound, - JIDMalformed, - NotAcceptable, - NotAllowed, - NotAuthorized, - PaymentRequired, - RecipientUnavailable, - Redirect, - RegistrationRequired, - RemoteServerNotFound, - RemoteServerTimeout, - ResourceConstraint, - ServiceUnavailable, - SubscriptionRequired, - UndefinedCondition, - UnexpectedRequest - }; - - ErrorPayload(Condition condition = UndefinedCondition, Type type = Cancel, const String& text = String()) : type_(type), condition_(condition), text_(text) { } - - Type getType() const { - return type_; - } - - void setType(Type type) { - type_ = type; - } - - Condition getCondition() const { - return condition_; - } - - void setCondition(Condition condition) { - condition_ = condition; - } - - void setText(const String& text) { - text_ = text; - } - - const String& getText() const { - return text_; - } - - private: - Type type_; - Condition condition_; - String text_; - }; -} diff --git a/Swiften/Elements/IQ.cpp b/Swiften/Elements/IQ.cpp deleted file mode 100644 index 53dec53..0000000 --- a/Swiften/Elements/IQ.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "Swiften/Elements/IQ.h" - -namespace Swift { - -boost::shared_ptr<IQ> IQ::createRequest( - Type type, const JID& to, const String& id, boost::shared_ptr<Payload> payload) { - boost::shared_ptr<IQ> iq(new IQ(type)); - if (to.isValid()) { - iq->setTo(to); - } - iq->setID(id); - if (payload) { - iq->addPayload(payload); - } - return iq; -} - -boost::shared_ptr<IQ> IQ::createResult( - const JID& to, const String& id, boost::shared_ptr<Payload> payload) { - boost::shared_ptr<IQ> iq(new IQ(Result)); - iq->setTo(to); - iq->setID(id); - if (payload) { - iq->addPayload(payload); - } - return iq; -} - -boost::shared_ptr<IQ> IQ::createError(const JID& to, const String& id, ErrorPayload::Condition condition, ErrorPayload::Type type) { - boost::shared_ptr<IQ> iq(new IQ(IQ::Error)); - iq->setTo(to); - iq->setID(id); - iq->addPayload(boost::shared_ptr<Swift::ErrorPayload>(new Swift::ErrorPayload(condition, type))); - return iq; -} - -} diff --git a/Swiften/Elements/IQ.h b/Swiften/Elements/IQ.h deleted file mode 100644 index 80c2913..0000000 --- a/Swiften/Elements/IQ.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "Swiften/Elements/Stanza.h" -#include "Swiften/Elements/ErrorPayload.h" - -namespace Swift -{ - class IQ : public Stanza - { - public: - enum Type { Get, Set, Result, Error }; - - IQ(Type type = Get) : type_(type) { } - - Type getType() const { return type_; } - void setType(Type type) { type_ = type; } - - static boost::shared_ptr<IQ> createRequest( - Type type, - const JID& to, - const String& id, - boost::shared_ptr<Payload> payload); - static boost::shared_ptr<IQ> createResult( - const JID& to, - const String& id, - boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>()); - static boost::shared_ptr<IQ> createError( - const JID& to, - const String& id, - ErrorPayload::Condition condition, - ErrorPayload::Type type); - - private: - Type type_; - }; -} diff --git a/Swiften/Elements/MUCPayload.h b/Swiften/Elements/MUCPayload.h deleted file mode 100644 index 97932a1..0000000 --- a/Swiften/Elements/MUCPayload.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class MUCPayload : public Payload { - public: - MUCPayload() { - } - }; -} diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h deleted file mode 100644 index 6d9171f..0000000 --- a/Swiften/Elements/Message.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#include <boost/optional.hpp> - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Body.h" -#include "Swiften/Elements/ErrorPayload.h" -#include "Swiften/Elements/Stanza.h" - -namespace Swift -{ - class Message : public Stanza - { - public: - enum Type { Normal, Chat, Error, Groupchat, Headline }; - - Message() : type_(Chat) { } - - String getBody() const { - boost::shared_ptr<Body> body(getPayload<Body>()); - if (body) { - return body->getText(); - } - return ""; - } - - void setBody(const String& body) { - updatePayload(boost::shared_ptr<Body>(new Body(body))); - } - - bool isError() { - boost::shared_ptr<Swift::ErrorPayload> error(getPayload<Swift::ErrorPayload>()); - return getType() == Message::Error || error; - } - - Type getType() const { return type_; } - void setType(Type type) { type_ = type; } - - private: - String body_; - Type type_; - }; -} diff --git a/Swiften/Elements/Payload.cpp b/Swiften/Elements/Payload.cpp deleted file mode 100644 index d929fad..0000000 --- a/Swiften/Elements/Payload.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Swiften/Elements/Payload.h" - -namespace Swift { - -Payload::~Payload() { -} - -} diff --git a/Swiften/Elements/Payload.h b/Swiften/Elements/Payload.h deleted file mode 100644 index 829dc24..0000000 --- a/Swiften/Elements/Payload.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef SWIFTEN_PAYLOAD_H -#define SWIFTEN_PAYLOAD_H - -namespace Swift { - class Payload { - public: - virtual ~Payload(); - }; -} - -#endif diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h deleted file mode 100644 index f748e44..0000000 --- a/Swiften/Elements/Presence.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once - -#include "Swiften/Elements/Stanza.h" -#include "Swiften/Elements/Status.h" -#include "Swiften/Elements/StatusShow.h" -#include "Swiften/Elements/Priority.h" - -namespace Swift { - class Presence : public Stanza - { - public: - enum Type { Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed }; - - Presence() : type_(Available) /*, showType_(Online)*/ {} - Presence(const String& status) : type_(Available) { - setStatus(status); - } - - Type getType() const { return type_; } - void setType(Type type) { type_ = type; } - - StatusShow::Type getShow() const { - boost::shared_ptr<StatusShow> show(getPayload<StatusShow>()); - if (show) { - return show->getType(); - } - return type_ == Available ? StatusShow::Online : StatusShow::None; - } - - void setShow(const StatusShow::Type &show) { - updatePayload(boost::shared_ptr<StatusShow>(new StatusShow(show))); - } - - String getStatus() const { - boost::shared_ptr<Status> status(getPayload<Status>()); - if (status) { - return status->getText(); - } - return ""; - } - - void setStatus(const String& status) { - updatePayload(boost::shared_ptr<Status>(new Status(status))); - } - - int getPriority() const { - boost::shared_ptr<Priority> priority(getPayload<Priority>()); - return (priority ? priority->getPriority() : 0); - } - - void setPriority(int priority) { - updatePayload(boost::shared_ptr<Priority>(new Priority(priority))); - } - - boost::shared_ptr<Presence> clone() const { - return boost::shared_ptr<Presence>(new Presence(*this)); - } - - private: - Presence::Type type_; - }; -} diff --git a/Swiften/Elements/Priority.h b/Swiften/Elements/Priority.h deleted file mode 100644 index fd6080e..0000000 --- a/Swiften/Elements/Priority.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef SWIFTEN_Priority_H -#define SWIFTEN_Priority_H - -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class Priority : public Payload { - public: - Priority(int priority = 0) : priority_(priority) { - } - - void setPriority(int priority) { - priority_ = priority; - } - - int getPriority() const { - return priority_; - } - - private: - int priority_; - }; -} - -#endif diff --git a/Swiften/Elements/PrivateStorage.h b/Swiften/Elements/PrivateStorage.h deleted file mode 100644 index 93f1cfe..0000000 --- a/Swiften/Elements/PrivateStorage.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include <boost/shared_ptr.hpp> - -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class PrivateStorage : public Payload { - public: - PrivateStorage(boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>()) : payload(payload) { - } - - boost::shared_ptr<Payload> getPayload() const { - return payload; - } - - void setPayload(boost::shared_ptr<Payload> p) { - payload = p; - } - - private: - boost::shared_ptr<Payload> payload; - }; -} diff --git a/Swiften/Elements/ProtocolHeader.h b/Swiften/Elements/ProtocolHeader.h deleted file mode 100644 index da64811..0000000 --- a/Swiften/Elements/ProtocolHeader.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "Swiften/Base/String.h" - -namespace Swift { - class ProtocolHeader { - public: - ProtocolHeader() : version("1.0") {} - - const String& getTo() const { return to; } - void setTo(const String& a) { - to = a; - } - - const String& getFrom() const { return from; } - void setFrom(const String& a) { - from = a; - } - - const String& getVersion() const { return version; } - void setVersion(const String& a) { - version = a; - } - - const String& getID() const { return id; } - void setID(const String& a) { - id = a; - } - - private: - String to; - String from; - String id; - String version; - }; -} diff --git a/Swiften/Elements/RawXMLPayload.h b/Swiften/Elements/RawXMLPayload.h deleted file mode 100644 index c2ee439..0000000 --- a/Swiften/Elements/RawXMLPayload.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class RawXMLPayload : public Payload { - public: - RawXMLPayload() {} - - void setRawXML(const String& data) { - rawXML_ = data; - } - - const String& getRawXML() const { - return rawXML_; - } - - private: - String rawXML_; - }; -} diff --git a/Swiften/Elements/ResourceBind.h b/Swiften/Elements/ResourceBind.h deleted file mode 100644 index 3b6c632..0000000 --- a/Swiften/Elements/ResourceBind.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef SWIFTEN_ResourceBind_H -#define SWIFTEN_ResourceBind_H - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" -#include "Swiften/JID/JID.h" - -namespace Swift { - class ResourceBind : public Payload - { - public: - ResourceBind() {} - - void setJID(const JID& jid) { - jid_ = jid; - } - - const JID& getJID() const { - return jid_; - } - - void setResource(const String& resource) { - resource_ = resource; - } - - const String& getResource() const { - return resource_; - } - - private: - JID jid_; - String resource_; - }; -} - -#endif diff --git a/Swiften/Elements/RosterItemPayload.h b/Swiften/Elements/RosterItemPayload.h deleted file mode 100644 index 3925117..0000000 --- a/Swiften/Elements/RosterItemPayload.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SWIFTEN_RosterItemPayloadPayload_H -#define SWIFTEN_RosterItemPayloadPayload_H - -#include <vector> - -#include "Swiften/JID/JID.h" -#include "Swiften/Base/String.h" - -namespace Swift { - class RosterItemPayload - { - public: - enum Subscription { None, To, From, Both, Remove }; - - RosterItemPayload() : subscription_(None), ask_(false) {} - RosterItemPayload(const JID& jid, const String& name, Subscription subscription) : jid_(jid), name_(name), subscription_(subscription), ask_(false) { } - - void setJID(const JID& jid) { jid_ = jid; } - const JID& getJID() const { return jid_; } - - void setName(const String& name) { name_ = name; } - const String& getName() const { return name_; } - - void setSubscription(Subscription subscription) { subscription_ = subscription; } - const Subscription& getSubscription() const { return subscription_; } - - void addGroup(const String& group) { groups_.push_back(group); } - void setGroups(const std::vector<String>& groups) { groups_ = groups; } - const std::vector<String>& getGroups() const { return groups_; } - - void setSubscriptionRequested() { ask_ = true; } - bool getSubscriptionRequested() const { return ask_; } - - private: - JID jid_; - String name_; - Subscription subscription_; - std::vector<String> groups_; - bool ask_; - }; -} - -#endif diff --git a/Swiften/Elements/RosterPayload.cpp b/Swiften/Elements/RosterPayload.cpp deleted file mode 100644 index 1aecde9..0000000 --- a/Swiften/Elements/RosterPayload.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "Swiften/Elements/RosterPayload.h" -#include "Swiften/Base/foreach.h" - -namespace Swift { - -boost::optional<RosterItemPayload> RosterPayload::getItem(const JID& jid) const { - foreach(const RosterItemPayload& item, items_) { - // FIXME: MSVC rejects this. Find out why. - //if (item.getJID() == jid) { - if (item.getJID().equals(jid, JID::WithResource)) { - return boost::optional<RosterItemPayload>(item); - } - } - return boost::optional<RosterItemPayload>(); -} - -} diff --git a/Swiften/Elements/RosterPayload.h b/Swiften/Elements/RosterPayload.h deleted file mode 100644 index afb68c2..0000000 --- a/Swiften/Elements/RosterPayload.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef SWIFTEN_RosterPayload_H -#define SWIFTEN_RosterPayload_H - -#include <vector> -#include <boost/optional.hpp> - -#include "Swiften/Elements/RosterItemPayload.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class RosterPayload : public Payload { - public: - typedef std::vector<RosterItemPayload> RosterItemPayloads; - - public: - RosterPayload() {} - - boost::optional<RosterItemPayload> getItem(const JID& jid) const; - - void addItem(const RosterItemPayload& item) { - items_.push_back(item); - } - - const RosterItemPayloads& getItems() const { - return items_; - } - - private: - RosterItemPayloads items_; - }; -} - -#endif diff --git a/Swiften/Elements/SecurityLabel.h b/Swiften/Elements/SecurityLabel.h deleted file mode 100644 index 65bdb4f..0000000 --- a/Swiften/Elements/SecurityLabel.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SWIFTEN_SecurityLabel_H -#define SWIFTEN_SecurityLabel_H - -#include <vector> - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class SecurityLabel : public Payload { - public: - SecurityLabel() {} - - const String& getDisplayMarking() const { return displayMarking_; } - - void setDisplayMarking(const String& displayMarking) { - displayMarking_ = displayMarking; - } - - const String& getForegroundColor() const { - return foregroundColor_; - } - - void setForegroundColor(const String& foregroundColor) { - foregroundColor_ = foregroundColor; - } - - const String& getBackgroundColor() const { - return backgroundColor_; - } - - void setBackgroundColor(const String& backgroundColor) { - backgroundColor_ = backgroundColor; - } - - const String& getLabel() const { return label_; } - - void setLabel(const String& label) { - label_ = label; - } - - const std::vector<String>& getEquivalentLabels() const { return equivalentLabels_; } - - void addEquivalentLabel(const String& label) { - equivalentLabels_.push_back(label); - } - - private: - String displayMarking_; - String foregroundColor_; - String backgroundColor_; - String label_; - std::vector<String> equivalentLabels_; - }; -} - -#endif diff --git a/Swiften/Elements/SecurityLabelsCatalog.h b/Swiften/Elements/SecurityLabelsCatalog.h deleted file mode 100644 index 611c26b..0000000 --- a/Swiften/Elements/SecurityLabelsCatalog.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef SWIFTEN_SecurityLabelsCatalog_H -#define SWIFTEN_SecurityLabelsCatalog_H - -#include <vector> - -#include "Swiften/JID/JID.h" -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" -#include "Swiften/Elements/SecurityLabel.h" - -namespace Swift { - class SecurityLabelsCatalog : public Payload { - public: - SecurityLabelsCatalog(const JID& to = JID()) : to_(to) {} - - const std::vector<SecurityLabel>& getLabels() const { - return labels_; - } - - void addLabel(const SecurityLabel& label) { - labels_.push_back(label); - } - - const JID& getTo() const { - return to_; - } - - void setTo(const JID& to) { - to_ = to; - } - - const String& getName() const { - return name_; - } - - void setName(const String& name) { - name_ = name; - } - - const String& getDescription() const { - return description_; - } - - void setDescription(const String& description) { - description_ = description; - } - - private: - JID to_; - String name_; - String description_; - std::vector<SecurityLabel> labels_; - }; -} - -#endif diff --git a/Swiften/Elements/SoftwareVersion.h b/Swiften/Elements/SoftwareVersion.h deleted file mode 100644 index d064414..0000000 --- a/Swiften/Elements/SoftwareVersion.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef SWIFTEN_SoftwareVersion_H -#define SWIFTEN_SoftwareVersion_H - -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" - -namespace Swift { - class SoftwareVersion : public Payload { - public: - SoftwareVersion( - const String& name = "", - const String& version = "", - const String& os = "") : - name_(name), version_(version), os_(os) {} - - const String& getName() const { - return name_; - } - - void setName(const String& name) { - name_ = name; - } - - const String& getVersion() const { - return version_; - } - - void setVersion(const String& version) { - version_ = version; - } - - const String& getOS() const { - return os_; - } - - void setOS(const String& os) { - os_ = os; - } - - private: - String name_; - String version_; - String os_; - }; -} - -#endif diff --git a/Swiften/Elements/Stanza.cpp b/Swiften/Elements/Stanza.cpp deleted file mode 100644 index e644665..0000000 --- a/Swiften/Elements/Stanza.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "Swiften/Elements/Stanza.h" - -#include <typeinfo> - -namespace Swift { - -Stanza::~Stanza() { - payloads_.clear(); -} - -void Stanza::updatePayload(boost::shared_ptr<Payload> payload) { - foreach (boost::shared_ptr<Payload>& i, payloads_) { - if (typeid(*i.get()) == typeid(*payload.get())) { - i = payload; - return; - } - } - addPayload(payload); -} - -boost::shared_ptr<Payload> Stanza::getPayloadOfSameType(boost::shared_ptr<Payload> payload) const { - foreach (const boost::shared_ptr<Payload>& i, payloads_) { - if (typeid(*i.get()) == typeid(*payload.get())) { - return i; - } - } - return boost::shared_ptr<Payload>(); -} - - -} diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h deleted file mode 100644 index e60ab21..0000000 --- a/Swiften/Elements/Stanza.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SWIFTEN_STANZAS_STANZA_H -#define SWIFTEN_STANZAS_STANZA_H - -#include <vector> -#include <boost/shared_ptr.hpp> - -#include "Swiften/Elements/Element.h" -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" -#include "Swiften/Base/foreach.h" -#include "Swiften/JID/JID.h" - -namespace Swift { - class Stanza : public Element { - public: - virtual ~Stanza(); - - template<typename T> - boost::shared_ptr<T> getPayload() const { - foreach (const boost::shared_ptr<Payload>& i, payloads_) { - boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(i)); - if (result) { - return result; - } - } - return boost::shared_ptr<T>(); - } - - const std::vector< boost::shared_ptr<Payload> >& getPayloads() const { - return payloads_; - } - - void addPayload(boost::shared_ptr<Payload> payload) { - payloads_.push_back(payload); - } - - void updatePayload(boost::shared_ptr<Payload> payload); - - boost::shared_ptr<Payload> getPayloadOfSameType(boost::shared_ptr<Payload>) const; - - const JID& getFrom() const { return from_; } - void setFrom(const JID& from) { from_ = from; } - - const JID& getTo() const { return to_; } - void setTo(const JID& to) { to_ = to; } - - const String& getID() const { return id_; } - void setID(const String& id) { id_ = id; } - - private: - String id_; - JID from_; - JID to_; - - typedef std::vector< boost::shared_ptr<Payload> > Payloads; - Payloads payloads_; - }; -} - -#endif diff --git a/Swiften/Elements/StartSession.h b/Swiften/Elements/StartSession.h deleted file mode 100644 index 2b46d05..0000000 --- a/Swiften/Elements/StartSession.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SWIFTEN_StartSession_H -#define SWIFTEN_StartSession_H - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class StartSession : public Payload { - public: - StartSession() {} - }; -} - -#endif diff --git a/Swiften/Elements/StartTLSFailure.h b/Swiften/Elements/StartTLSFailure.h deleted file mode 100644 index 17a1750..0000000 --- a/Swiften/Elements/StartTLSFailure.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef SWIFTEN_StartTLSFailure_H -#define SWIFTEN_StartTLSFailure_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class StartTLSFailure : public Element { - public: - StartTLSFailure() {} - }; -} - -#endif diff --git a/Swiften/Elements/StartTLSRequest.h b/Swiften/Elements/StartTLSRequest.h deleted file mode 100644 index c40499a..0000000 --- a/Swiften/Elements/StartTLSRequest.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SWIFTEN_StartTLSRequest_H -#define SWIFTEN_StartTLSRequest_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class StartTLSRequest : public Element - { - public: - StartTLSRequest() {} - }; -} - -#endif diff --git a/Swiften/Elements/Status.h b/Swiften/Elements/Status.h deleted file mode 100644 index 0b80682..0000000 --- a/Swiften/Elements/Status.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef SWIFTEN_Status_H -#define SWIFTEN_Status_H - -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" - -namespace Swift { - class Status : public Payload { - public: - Status(const String& text = "") : text_(text) { - } - - void setText(const String& text) { - text_ = text; - } - - const String& getText() const { - return text_; - } - - private: - String text_; - }; -} - -#endif diff --git a/Swiften/Elements/StatusShow.h b/Swiften/Elements/StatusShow.h deleted file mode 100644 index a001657..0000000 --- a/Swiften/Elements/StatusShow.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SWIFTEN_StatusShow_H -#define SWIFTEN_StatusShow_H - -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class StatusShow : public Payload { - public: - enum Type { Online, Away, FFC, XA, DND, None }; - - StatusShow(const Type& type = Online) : type_(type) { - } - - void setType(const Type& type) { - type_ = type; - } - - const Type& getType() const { - return type_; - } - - private: - Type type_; - }; -} - -#endif diff --git a/Swiften/Elements/Storage.h b/Swiften/Elements/Storage.h deleted file mode 100644 index 1458836..0000000 --- a/Swiften/Elements/Storage.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include <vector> - -#include "Swiften/Elements/Payload.h" -#include "Swiften/Base/String.h" -#include "Swiften/JID/JID.h" - -namespace Swift { - class Storage : public Payload { - public: - struct Conference { - Conference() : autoJoin(false) {} - - String name; - JID jid; - bool autoJoin; - String nick; - String password; - }; - - Storage() { - } - - const std::vector<Conference>& getConferences() const { - return conferences; - } - - void addConference(const Conference& conference) { - conferences.push_back(conference); - } - - private: - std::vector<Conference> conferences; - }; -} diff --git a/Swiften/Elements/StreamFeatures.h b/Swiften/Elements/StreamFeatures.h deleted file mode 100644 index 2d5f4d6..0000000 --- a/Swiften/Elements/StreamFeatures.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef SWIFTEN_StreamFeatures_H -#define SWIFTEN_StreamFeatures_H - -#include <vector> -#include <algorithm> - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Element.h" - -namespace Swift { - class StreamFeatures : public Element - { - public: - StreamFeatures() : hasStartTLS_(false), hasResourceBind_(false), hasSession_(false) {} - - void setHasStartTLS() { - hasStartTLS_ = true; - } - - bool hasStartTLS() const { - return hasStartTLS_; - } - - void setHasSession() { - hasSession_ = true; - } - - bool hasSession() const { - return hasSession_; - } - - void setHasResourceBind() { - hasResourceBind_ = true; - } - - bool hasResourceBind() const { - return hasResourceBind_; - } - - const std::vector<String>& getCompressionMethods() const { - return compressionMethods_; - } - - void addCompressionMethod(const String& mechanism) { - compressionMethods_.push_back(mechanism); - } - - bool hasCompressionMethod(const String& mechanism) const { - return std::find(compressionMethods_.begin(), compressionMethods_.end(), mechanism) != compressionMethods_.end(); - } - - const std::vector<String>& getAuthenticationMechanisms() const { - return authenticationMechanisms_; - } - - void addAuthenticationMechanism(const String& mechanism) { - authenticationMechanisms_.push_back(mechanism); - } - - bool hasAuthenticationMechanism(const String& mechanism) const { - return std::find(authenticationMechanisms_.begin(), authenticationMechanisms_.end(), mechanism) != authenticationMechanisms_.end(); - } - - bool hasAuthenticationMechanisms() const { - return !authenticationMechanisms_.empty(); - } - - private: - bool hasStartTLS_; - std::vector<String> compressionMethods_; - std::vector<String> authenticationMechanisms_; - bool hasResourceBind_; - bool hasSession_; - }; -} - -#endif diff --git a/Swiften/Elements/TLSProceed.h b/Swiften/Elements/TLSProceed.h deleted file mode 100644 index 41f0341..0000000 --- a/Swiften/Elements/TLSProceed.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef SWIFTEN_TLSProceed_H -#define SWIFTEN_TLSProceed_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class TLSProceed : public Element - { - public: - TLSProceed() {} - }; -} - -#endif diff --git a/Swiften/Elements/UnitTest/IQTest.cpp b/Swiften/Elements/UnitTest/IQTest.cpp deleted file mode 100644 index a5e6dc8..0000000 --- a/Swiften/Elements/UnitTest/IQTest.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> -#include <boost/shared_ptr.hpp> - -#include "Swiften/Elements/IQ.h" -#include "Swiften/Elements/SoftwareVersion.h" - -using namespace Swift; - -class IQTest : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE(IQTest); - CPPUNIT_TEST(testCreateResult); - CPPUNIT_TEST(testCreateResult_WithoutPayload); - CPPUNIT_TEST(testCreateError); - CPPUNIT_TEST_SUITE_END(); - - public: - IQTest() {} - - void testCreateResult() { - boost::shared_ptr<Payload> payload(new SoftwareVersion("myclient")); - boost::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid", payload)); - - CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo()); - CPPUNIT_ASSERT_EQUAL(String("myid"), iq->getID()); - CPPUNIT_ASSERT(iq->getPayload<SoftwareVersion>()); - CPPUNIT_ASSERT(payload == iq->getPayload<SoftwareVersion>()); - } - - void testCreateResult_WithoutPayload() { - boost::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid")); - - CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo()); - CPPUNIT_ASSERT_EQUAL(String("myid"), iq->getID()); - CPPUNIT_ASSERT(!iq->getPayload<SoftwareVersion>()); - } - - void testCreateError() { - boost::shared_ptr<IQ> iq(IQ::createError(JID("foo@bar/fum"), "myid", ErrorPayload::BadRequest, ErrorPayload::Modify)); - - CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo()); - CPPUNIT_ASSERT_EQUAL(String("myid"), iq->getID()); - boost::shared_ptr<ErrorPayload> error(iq->getPayload<ErrorPayload>()); - CPPUNIT_ASSERT(error); - CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, error->getCondition()); - CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, error->getType()); - } - -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(IQTest); diff --git a/Swiften/Elements/UnitTest/StanzaTest.cpp b/Swiften/Elements/UnitTest/StanzaTest.cpp deleted file mode 100644 index b905957..0000000 --- a/Swiften/Elements/UnitTest/StanzaTest.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> -#include <boost/shared_ptr.hpp> - -#include "Swiften/Elements/Stanza.h" -#include "Swiften/Elements/Payload.h" -#include "Swiften/Elements/Message.h" - -using namespace Swift; - -class StanzaTest : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE(StanzaTest); - CPPUNIT_TEST(testConstructor_Copy); - CPPUNIT_TEST(testGetPayload); - CPPUNIT_TEST(testGetPayload_NoSuchPayload); - CPPUNIT_TEST(testDestructor); - CPPUNIT_TEST(testDestructor_Copy); - CPPUNIT_TEST(testUpdatePayload_ExistingPayload); - CPPUNIT_TEST(testUpdatePayload_NewPayload); - CPPUNIT_TEST(testGetPayloadOfSameType); - CPPUNIT_TEST(testGetPayloadOfSameType_NoSuchPayload); - CPPUNIT_TEST_SUITE_END(); - - public: - class MyPayload1 : public Payload { - public: - MyPayload1() {} - }; - - class MyPayload2 : public Payload { - public: - MyPayload2(const String& s = "") : text_(s) {} - - String text_; - }; - - class MyPayload3 : public Payload { - public: - MyPayload3() {} - }; - - class DestroyingPayload : public Payload { - public: - DestroyingPayload(bool* alive) : alive_(alive) { - } - - ~DestroyingPayload() { - (*alive_) = false; - } - - private: - bool* alive_; - }; - - StanzaTest() {} - - void testConstructor_Copy() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload2>(new MyPayload2())); - Message copy(m); - - CPPUNIT_ASSERT(copy.getPayload<MyPayload1>()); - CPPUNIT_ASSERT(copy.getPayload<MyPayload2>()); - } - - void testDestructor() { - bool payloadAlive = true; - { - Message m; - m.addPayload(boost::shared_ptr<DestroyingPayload>(new DestroyingPayload(&payloadAlive))); - } - - CPPUNIT_ASSERT(!payloadAlive); - } - - void testDestructor_Copy() { - bool payloadAlive = true; - Message* m1 = new Message(); - m1->addPayload(boost::shared_ptr<DestroyingPayload>(new DestroyingPayload(&payloadAlive))); - Message* m2 = new Message(*m1); - - delete m1; - CPPUNIT_ASSERT(payloadAlive); - - delete m2; - CPPUNIT_ASSERT(!payloadAlive); - } - - void testGetPayload() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload2>(new MyPayload2())); - m.addPayload(boost::shared_ptr<MyPayload3>(new MyPayload3())); - - boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>()); - CPPUNIT_ASSERT(p); - } - - void testGetPayload_NoSuchPayload() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload3>(new MyPayload3())); - - boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>()); - CPPUNIT_ASSERT(!p); - } - - void testUpdatePayload_ExistingPayload() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload2>(new MyPayload2("foo"))); - m.addPayload(boost::shared_ptr<MyPayload3>(new MyPayload3())); - - m.updatePayload(boost::shared_ptr<MyPayload2>(new MyPayload2("bar"))); - - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size()); - boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>()); - CPPUNIT_ASSERT_EQUAL(String("bar"), p->text_); - } - - void testUpdatePayload_NewPayload() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload3>(new MyPayload3())); - - m.updatePayload(boost::shared_ptr<MyPayload2>(new MyPayload2("bar"))); - - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size()); - boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>()); - CPPUNIT_ASSERT_EQUAL(String("bar"), p->text_); - } - - void testGetPayloadOfSameType() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload2>(new MyPayload2("foo"))); - m.addPayload(boost::shared_ptr<MyPayload3>(new MyPayload3())); - - boost::shared_ptr<MyPayload2> payload(boost::dynamic_pointer_cast<MyPayload2>(m.getPayloadOfSameType(boost::shared_ptr<MyPayload2>(new MyPayload2("bar"))))); - CPPUNIT_ASSERT(payload); - CPPUNIT_ASSERT_EQUAL(String("foo"), payload->text_); - } - - void testGetPayloadOfSameType_NoSuchPayload() { - Message m; - m.addPayload(boost::shared_ptr<MyPayload1>(new MyPayload1())); - m.addPayload(boost::shared_ptr<MyPayload3>(new MyPayload3())); - - CPPUNIT_ASSERT(!m.getPayloadOfSameType(boost::shared_ptr<MyPayload2>(new MyPayload2("bar")))); - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(StanzaTest); diff --git a/Swiften/Elements/UnitTest/StanzasTest.cpp b/Swiften/Elements/UnitTest/StanzasTest.cpp deleted file mode 100644 index 35b84e7..0000000 --- a/Swiften/Elements/UnitTest/StanzasTest.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "Swiften/Elements/Message.h" -#include "Swiften/Elements/IQ.h" -#include "Swiften/Elements/Presence.h" diff --git a/Swiften/Elements/UnknownElement.h b/Swiften/Elements/UnknownElement.h deleted file mode 100644 index 3d2c219..0000000 --- a/Swiften/Elements/UnknownElement.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef SWIFTEN_UnknownElement_H -#define SWIFTEN_UnknownElement_H - -#include "Swiften/Elements/Element.h" - -namespace Swift { - class UnknownElement : public Element { - public: - UnknownElement() {} - }; -} - -#endif diff --git a/Swiften/Elements/VCard.h b/Swiften/Elements/VCard.h deleted file mode 100644 index a42d7e3..0000000 --- a/Swiften/Elements/VCard.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "Swiften/Base/String.h" -#include "Swiften/Base/ByteArray.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class VCard : public Payload { - public: - VCard() {} - - void setFullName(const String& fullName) { fullName_ = fullName; } - const String& getFullName() const { return fullName_; } - - void setFamilyName(const String& familyName) { familyName_ = familyName; } - const String& getFamilyName() const { return familyName_; } - - void setGivenName(const String& givenName) { givenName_ = givenName; } - const String& getGivenName() const { return givenName_; } - - void setEMail(const String& email) { email_ = email; } - const String& getEMail() const { return email_; } - - void setNickname(const String& nick) { nick_ = nick; } - const String& getNickname() const { return nick_; } - - void setPhoto(const ByteArray& photo) { photo_ = photo; } - const ByteArray& getPhoto() { return photo_; } - - void setPhotoType(const String& photoType) { photoType_ = photoType; } - const String& getPhotoType() { return photoType_; } - - private: - String fullName_; - String familyName_; - String givenName_; - String email_; - ByteArray photo_; - String photoType_; - String nick_; - }; -} diff --git a/Swiften/Elements/VCardUpdate.h b/Swiften/Elements/VCardUpdate.h deleted file mode 100644 index 6bb79cc..0000000 --- a/Swiften/Elements/VCardUpdate.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class VCardUpdate : public Payload { - public: - VCardUpdate(const String& photoHash = "") : photoHash_(photoHash) {} - - void setPhotoHash(const String& photoHash) { photoHash_ = photoHash; } - const String& getPhotoHash() { return photoHash_; } - - private: - String photoHash_; - }; -} diff --git a/Swiften/Elements/Version.h b/Swiften/Elements/Version.h deleted file mode 100644 index 327178e..0000000 --- a/Swiften/Elements/Version.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef SWIFTEN_STANZAS_VERSION_H -#define SWIFTEN_STANZAS_VERSION_H - -#include "Swiften/Base/String.h" -#include "Swiften/Elements/Payload.h" - -namespace Swift { - class Version : public Payload - { - public: - Version(const String& name = "", const String& version = "", const String& os = "") : name_(name), version_(version), os_(os) { } - - const String& getName() const { return name_; } - const String& getVersion() const { return version_; } - const String& getOS() const { return os_; } - - private: - String name_; - String version_; - String os_; - }; -} - -#endif |