00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <vector>
00010 #include <boost/optional.hpp>
00011 #include <boost/shared_ptr.hpp>
00012
00013 #include <string>
00014 #include <Swiften/Elements/Payload.h>
00015 #include <Swiften/Elements/StreamInitiationFileInfo.h>
00016
00017 namespace Swift {
00018 class StreamInitiation : public Payload {
00019 public:
00020 typedef boost::shared_ptr<StreamInitiation> ref;
00021
00022 StreamInitiation() : isFileTransfer(true) {}
00023
00024 const std::string& getID() const {
00025 return id;
00026 }
00027
00028 void setID(const std::string& id) {
00029 this->id = id;
00030 }
00031
00032 const boost::optional<StreamInitiationFileInfo>& getFileInfo() const {
00033 return fileInfo;
00034 }
00035
00036 void setFileInfo(const StreamInitiationFileInfo& info) {
00037 fileInfo = info;
00038 }
00039
00040 const std::vector<std::string>& getProvidedMethods() const {
00041 return providedMethods;
00042 }
00043
00044 void addProvidedMethod(const std::string& method) {
00045 providedMethods.push_back(method);
00046 }
00047
00048 void setRequestedMethod(const std::string& method) {
00049 requestedMethod = method;
00050 }
00051
00052 const std::string& getRequestedMethod() const {
00053 return requestedMethod;
00054 }
00055
00056 bool getIsFileTransfer() const {
00057 return isFileTransfer;
00058 }
00059
00060 void setIsFileTransfer(bool b) {
00061 isFileTransfer = b;
00062 }
00063
00064 private:
00065 bool isFileTransfer;
00066 std::string id;
00067 boost::optional<StreamInitiationFileInfo> fileInfo;
00068 std::vector<std::string> providedMethods;
00069 std::string requestedMethod;
00070 };
00071 }