summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--BuildTools/SCons/SConscript.boot2
-rw-r--r--Limber/Server/ServerFromClientSession.h4
-rw-r--r--Swift/QtUI/SConscript2
-rw-r--r--Swiften/AdHoc/OutgoingAdHocCommandSession.h3
-rw-r--r--Swiften/Avatars/AvatarStorage.h4
-rw-r--r--Swiften/Base/API.h23
-rw-r--r--Swiften/Base/ByteArray.h10
-rw-r--r--Swiften/Base/Error.h4
-rw-r--r--Swiften/Base/IDGenerator.h4
-rw-r--r--Swiften/Base/Log.h4
-rw-r--r--Swiften/Base/Paths.h4
-rw-r--r--Swiften/Base/SafeByteArray.h3
-rw-r--r--Swiften/Base/String.h12
-rw-r--r--Swiften/Base/sleep.h4
-rw-r--r--Swiften/Chat/ChatStateNotifier.h3
-rw-r--r--Swiften/Chat/ChatStateTracker.h3
-rw-r--r--Swiften/Client/Client.h4
-rw-r--r--Swiften/Client/ClientXMLTracer.h3
-rw-r--r--Swiften/Client/CoreClient.h5
-rw-r--r--Swiften/Client/NickResolver.h6
-rw-r--r--Swiften/Client/Storages.h4
-rw-r--r--Swiften/Component/Component.h3
-rw-r--r--Swiften/Component/ComponentXMLTracer.h3
-rw-r--r--Swiften/Component/CoreComponent.h3
-rw-r--r--Swiften/Disco/CapsStorage.h5
-rw-r--r--Swiften/Disco/ClientDiscoManager.h3
-rw-r--r--Swiften/Disco/DiscoServiceWalker.h3
-rw-r--r--Swiften/Elements/DiscoInfo.h3
-rw-r--r--Swiften/Elements/Element.h4
-rw-r--r--Swiften/Elements/Form.h3
-rw-r--r--Swiften/Elements/IQ.h3
-rw-r--r--Swiften/Elements/MUCOccupant.h5
-rw-r--r--Swiften/Elements/Payload.h4
-rw-r--r--Swiften/Elements/Presence.h3
-rw-r--r--Swiften/Elements/SecurityLabelsCatalog.h3
-rw-r--r--Swiften/Elements/SoftwareVersion.h3
-rw-r--r--Swiften/Elements/Stanza.h3
-rw-r--r--Swiften/Entity/Entity.h4
-rw-r--r--Swiften/Entity/PayloadPersister.h4
-rw-r--r--Swiften/EventLoop/DummyEventLoop.h3
-rw-r--r--Swiften/EventLoop/EventLoop.h4
-rw-r--r--Swiften/EventLoop/EventOwner.h4
-rw-r--r--Swiften/EventLoop/SimpleEventLoop.h3
-rw-r--r--Swiften/FileTransfer/FileReadBytestream.h3
-rw-r--r--Swiften/FileTransfer/FileWriteBytestream.h3
-rw-r--r--Swiften/JID/JID.h4
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h4
-rw-r--r--Swiften/MUC/MUC.h3
-rw-r--r--Swiften/MUC/MUCBookmarkManager.h3
-rw-r--r--Swiften/MUC/MUCManager.h3
-rw-r--r--Swiften/MUC/MUCRegistry.h3
-rw-r--r--Swiften/Network/BoostConnection.h3
-rw-r--r--Swiften/Network/BoostConnectionServer.h5
-rw-r--r--Swiften/Network/BoostIOServiceThread.h4
-rw-r--r--Swiften/Network/BoostNetworkFactories.h3
-rw-r--r--Swiften/Network/ConnectionServer.h5
-rw-r--r--Swiften/Network/DomainNameResolver.h5
-rw-r--r--Swiften/Network/HostAddress.h4
-rw-r--r--Swiften/Network/HostAddressPort.h3
-rw-r--r--Swiften/Network/PlatformDomainNameResolver.h3
-rw-r--r--Swiften/Parser/AttributeMap.h3
-rw-r--r--Swiften/Parser/PayloadParser.h6
-rw-r--r--Swiften/Parser/PayloadParserFactory.h3
-rw-r--r--Swiften/Parser/PayloadParserFactoryCollection.h3
-rw-r--r--Swiften/Parser/PayloadParsers/DiscoInfoParser.h3
-rw-r--r--Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h3
-rw-r--r--Swiften/Parser/PayloadParsers/RosterParser.h3
-rw-r--r--Swiften/Parser/PayloadParsers/VCardParser.h4
-rw-r--r--Swiften/Parser/PlatformXMLParserFactory.h3
-rw-r--r--Swiften/Parser/XMLParser.h5
-rw-r--r--Swiften/Parser/XMLParserClient.h10
-rw-r--r--Swiften/Parser/XMLParserFactory.h4
-rw-r--r--Swiften/Parser/XMPPParser.h3
-rw-r--r--Swiften/Parser/XMPPParserClient.h3
-rw-r--r--Swiften/Presence/PresenceOracle.h6
-rw-r--r--Swiften/Presence/SubscriptionManager.h3
-rw-r--r--Swiften/Queries/GenericRequest.h1
-rw-r--r--Swiften/Queries/GetResponder.h3
-rw-r--r--Swiften/Queries/IQHandler.h3
-rw-r--r--Swiften/Queries/IQRouter.h5
-rw-r--r--Swiften/Queries/Request.h5
-rw-r--r--Swiften/Queries/Responders/SoftwareVersionResponder.h3
-rw-r--r--Swiften/Roster/RosterStorage.h3
-rw-r--r--Swiften/SASL/PLAINMessage.h4
-rw-r--r--Swiften/SConscript13
-rw-r--r--Swiften/Serializer/PayloadSerializer.h4
-rw-r--r--Swiften/Serializer/PayloadSerializerCollection.h3
-rw-r--r--Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h3
-rw-r--r--Swiften/Serializer/PayloadSerializers/ErrorSerializer.h3
-rw-r--r--Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h3
-rw-r--r--Swiften/Serializer/PayloadSerializers/RosterSerializer.h3
-rw-r--r--Swiften/Serializer/PayloadSerializers/VCardSerializer.h4
-rw-r--r--Swiften/Serializer/XML/XMLElement.h3
-rw-r--r--Swiften/Serializer/XML/XMLNode.h4
-rw-r--r--Swiften/Session/Session.h3
-rw-r--r--Swiften/StreamStack/XMPPLayer.h3
-rw-r--r--Swiften/StringCodecs/Base64.h5
-rw-r--r--Swiften/StringCodecs/Hexify.h3
-rw-r--r--Swiften/StringCodecs/SHA1.h3
-rw-r--r--Swiften/StringCodecs/SHA1_Windows.h4
-rw-r--r--Swiften/TLS/CAPICertificate.h3
-rw-r--r--Swiften/TLS/CertificateTrustChecker.h7
-rw-r--r--Swiften/TLS/PlatformTLSFactories.h4
-rw-r--r--Swiften/VCards/VCardManager.h3
-rw-r--r--Swiften/VCards/VCardStorage.h3
105 files changed, 285 insertions, 139 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index d6d4e29..c246bf6 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -205,19 +205,19 @@ else :
if env.get("coverage", 0) :
assert(env["PLATFORM"] != "win32")
env.Append(CCFLAGS = ["-fprofile-arcs", "-ftest-coverage"])
env.Append(LINKFLAGS = ["-fprofile-arcs", "-ftest-coverage"])
if env["PLATFORM"] == "win32" :
env.Append(LIBS = ["user32", "crypt32", "dnsapi", "iphlpapi", "ws2_32", "wsock32", "Advapi32"])
env.Append(CCFLAGS = ["/EHsc", "/nologo"])
- env.Append(LINKFLAGS = ["/INCREMENTAL:no"])
+ env.Append(LINKFLAGS = ["/INCREMENTAL:no", "/NOLOGO"])
if int(env["MSVS_VERSION"].split(".")[0]) < 10 :
env["LINKCOM"] = [env["LINKCOM"], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;1']
env["SHLINKCOM"] = [env["SHLINKCOM"], 'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2']
if env["PLATFORM"] == "darwin" and not env["target"] in ["iphone-device", "iphone-simulator", "xcode"] :
env.Append(FRAMEWORKS = ["IOKit", "AppKit", "SystemConfiguration", "Security", "SecurityInterface"])
# Testing
env["TEST_TYPE"] = env["test"]
diff --git a/Limber/Server/ServerFromClientSession.h b/Limber/Server/ServerFromClientSession.h
index 34ea40e..e2754b9 100644
--- a/Limber/Server/ServerFromClientSession.h
+++ b/Limber/Server/ServerFromClientSession.h
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
-#include <Swiften/Base/boost_bsignals.h>
#include <boost/enable_shared_from_this.hpp>
-
#include <string>
+
+#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Session/Session.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Network/Connection.h>
#include <Swiften/Base/ByteArray.h>
namespace Swift {
class ProtocolHeader;
class Element;
class Stanza;
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index ef05a12..f935530 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -276,18 +276,20 @@ if env.get("SWIFT_INSTALLDIR", "") :
env.Install(os.path.join(env["SWIFT_INSTALLDIR"], "share", "swift", dir), resource)
if env["PLATFORM"] == "win32" :
if env["DIST"] :
commonResources[""] = commonResources.get("", []) + [
#os.path.join(env["OPENSSL_DIR"], "bin", "ssleay32.dll"),
#os.path.join(env["OPENSSL_DIR"], "bin", "libeay32.dll"),
"#/Swift/resources/images",
]
+ if env["SWIFTEN_DLL"] :
+ commonResources[""] = commonResources.get("", []) + ["#/Swiften/Swiften.dll"]
qtimageformats = ["gif", "ico", "jpeg", "mng", "svg", "tiff"]
qtlibs = ["QtCore4", "QtGui4", "QtNetwork4", "QtWebKit4", "QtXMLPatterns4", "phonon4"]
myenv.WindowsBundle("Swift",
resources = commonResources,
qtimageformats = qtimageformats,
qtlibs = qtlibs)
#myenv.Append(NSIS_OPTIONS = [
# "/DmsvccRedistributableDir=\"" + env["vcredist"] + "\"",
diff --git a/Swiften/AdHoc/OutgoingAdHocCommandSession.h b/Swiften/AdHoc/OutgoingAdHocCommandSession.h
index 7c7cc99..74d6c59 100644
--- a/Swiften/AdHoc/OutgoingAdHocCommandSession.h
+++ b/Swiften/AdHoc/OutgoingAdHocCommandSession.h
@@ -4,30 +4,31 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <string>
#include <map>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/Command.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <boost/signals/connection.hpp>
namespace Swift {
class IQRouter;
class MainWindow;
class UIEventStream;
- class OutgoingAdHocCommandSession {
+ class SWIFTEN_API OutgoingAdHocCommandSession {
public:
/**
* Availability of action.
*/
enum ActionState {
Absent /** Action isn't applicable to this command. */ = 0,
Present /** Action is applicable to this command */= 1,
Enabled /** Action is applicable and currently available */ = 2,
diff --git a/Swiften/Avatars/AvatarStorage.h b/Swiften/Avatars/AvatarStorage.h
index c33d38b..7f61ca2 100644
--- a/Swiften/Avatars/AvatarStorage.h
+++ b/Swiften/Avatars/AvatarStorage.h
@@ -2,24 +2,26 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/filesystem/path.hpp>
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
namespace Swift {
class JID;
- class AvatarStorage {
+ class SWIFTEN_API AvatarStorage {
public:
virtual ~AvatarStorage();
virtual bool hasAvatar(const std::string& hash) const = 0;
virtual void addAvatar(const std::string& hash, const ByteArray& avatar) = 0;
virtual ByteArray getAvatar(const std::string& hash) const = 0;
virtual boost::filesystem::path getAvatarPath(const std::string& hash) const = 0;
virtual void setAvatarForJID(const JID& jid, const std::string& hash) = 0;
diff --git a/Swiften/Base/API.h b/Swiften/Base/API.h
new file mode 100644
index 0000000..8f19446
--- /dev/null
+++ b/Swiften/Base/API.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2012 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Base/Platform.h>
+
+#ifdef SWIFTEN_STATIC
+# define SWIFTEN_API
+#else
+# ifdef SWIFTEN_PLATFORM_WINDOWS
+# ifdef SWIFTEN_BUILDING
+# define SWIFTEN_API __declspec(dllexport)
+# else
+# define SWIFTEN_API __declspec(dllimport)
+# endif
+# else
+# define SWIFTEN_API
+# endif
+#endif
diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h
index 01cd5d0..34b89d3 100644
--- a/Swiften/Base/ByteArray.h
+++ b/Swiften/Base/ByteArray.h
@@ -3,23 +3,25 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <string>
+#include <Swiften/Base/API.h>
+
namespace Swift {
typedef std::vector<unsigned char> ByteArray;
- ByteArray createByteArray(const std::string& s);
- ByteArray createByteArray(const char* c);
+ SWIFTEN_API ByteArray createByteArray(const std::string& s);
+ SWIFTEN_API ByteArray createByteArray(const char* c);
inline ByteArray createByteArray(const unsigned char* c, size_t n) {
return ByteArray(c, c + n);
}
inline ByteArray createByteArray(const char* c, size_t n) {
return ByteArray(c, c + n);
}
@@ -31,14 +33,14 @@ namespace Swift {
static const T* vecptr(const std::vector<T, A>& v) {
return v.empty() ? NULL : &v[0];
}
template<typename T, typename A>
static T* vecptr(std::vector<T, A>& v) {
return v.empty() ? NULL : &v[0];
}
- std::string byteArrayToString(const ByteArray& b);
+ SWIFTEN_API std::string byteArrayToString(const ByteArray& b);
- void readByteArrayFromFile(ByteArray&, const std::string& file);
+ SWIFTEN_API void readByteArrayFromFile(ByteArray&, const std::string& file);
}
diff --git a/Swiften/Base/Error.h b/Swiften/Base/Error.h
index e99f175..906c1d9 100644
--- a/Swiften/Base/Error.h
+++ b/Swiften/Base/Error.h
@@ -1,14 +1,16 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class Error {
+ class SWIFTEN_API Error {
public:
virtual ~Error();
};
};
diff --git a/Swiften/Base/IDGenerator.h b/Swiften/Base/IDGenerator.h
index 44eeb76..14ecfdc 100644
--- a/Swiften/Base/IDGenerator.h
+++ b/Swiften/Base/IDGenerator.h
@@ -2,17 +2,19 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class IDGenerator {
+ class SWIFTEN_API IDGenerator {
public:
IDGenerator();
std::string generateID();
};
}
diff --git a/Swiften/Base/Log.h b/Swiften/Base/Log.h
index 06f5b55..6d76dc6 100644
--- a/Swiften/Base/Log.h
+++ b/Swiften/Base/Log.h
@@ -2,20 +2,22 @@
* Copyright (c) 2010-2012 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <iostream>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- extern bool logging;
+ extern SWIFTEN_API bool logging;
namespace LogDetail {
// Only here to be able to statically check the correctness of the severity levers
namespace Severity {
enum {
debug, info, warning, error
};
}
}
}
diff --git a/Swiften/Base/Paths.h b/Swiften/Base/Paths.h
index 8ac4640..94e62d1 100644
--- a/Swiften/Base/Paths.h
+++ b/Swiften/Base/Paths.h
@@ -2,15 +2,17 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/filesystem/path.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class Paths {
+ class SWIFTEN_API Paths {
public:
static boost::filesystem::path getExecutablePath();
};
}
diff --git a/Swiften/Base/SafeByteArray.h b/Swiften/Base/SafeByteArray.h
index 1ef1d84..dda51fe 100644
--- a/Swiften/Base/SafeByteArray.h
+++ b/Swiften/Base/SafeByteArray.h
@@ -2,30 +2,31 @@
* Copyright (c) 2011 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeAllocator.h>
#include <Swiften/Base/ByteArray.h>
#include <boost/smart_ptr/make_shared.hpp>
namespace Swift {
typedef std::vector<unsigned char, SafeAllocator<unsigned char> > SafeByteArray;
inline SafeByteArray createSafeByteArray(const ByteArray& a) {
return SafeByteArray(a.begin(), a.end());
}
- SafeByteArray createSafeByteArray(const char* c);
+ SWIFTEN_API SafeByteArray createSafeByteArray(const char* c);
inline SafeByteArray createSafeByteArray(const std::string& s) {
return SafeByteArray(s.begin(), s.end());
}
inline boost::shared_ptr<SafeByteArray> createSafeByteArrayRef(const std::string& s) {
return boost::make_shared<SafeByteArray>(s.begin(), s.end());
}
diff --git a/Swiften/Base/String.h b/Swiften/Base/String.h
index db6c28b..26cc3f4 100644
--- a/Swiften/Base/String.h
+++ b/Swiften/Base/String.h
@@ -4,38 +4,40 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
#include <vector>
#include <sstream>
+#include <Swiften/Base/API.h>
+
#define SWIFTEN_STRING_TO_CFSTRING(a) \
CFStringCreateWithBytes(NULL, reinterpret_cast<const UInt8*>(a.c_str()), a.size(), kCFStringEncodingUTF8, false)
namespace Swift {
namespace String {
- std::vector<unsigned int> getUnicodeCodePoints(const std::string&);
- std::pair<std::string, std::string> getSplittedAtFirst(const std::string&, char c);
- std::vector<std::string> split(const std::string&, char c);
- void replaceAll(std::string&, char c, const std::string& s);
+ SWIFTEN_API std::vector<unsigned int> getUnicodeCodePoints(const std::string&);
+ SWIFTEN_API std::pair<std::string, std::string> getSplittedAtFirst(const std::string&, char c);
+ SWIFTEN_API std::vector<std::string> split(const std::string&, char c);
+ SWIFTEN_API void replaceAll(std::string&, char c, const std::string& s);
inline bool beginsWith(const std::string& s, char c) {
return s.size() > 0 && s[0] == c;
}
inline bool endsWith(const std::string& s, char c) {
return s.size() > 0 && s[s.size()-1] == c;
}
};
- class makeString {
+ class SWIFTEN_API makeString {
public:
template <typename T> makeString& operator<<(T const& v) {
stream << v;
return *this;
}
operator std::string() const {
return stream.str();
}
diff --git a/Swiften/Base/sleep.h b/Swiften/Base/sleep.h
index a95e907..afcf6c7 100644
--- a/Swiften/Base/sleep.h
+++ b/Swiften/Base/sleep.h
@@ -1,11 +1,13 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
- void sleep(unsigned int msecs);
+ SWIFTEN_API void sleep(unsigned int msecs);
}
diff --git a/Swiften/Chat/ChatStateNotifier.h b/Swiften/Chat/ChatStateNotifier.h
index c691092..5b99266 100644
--- a/Swiften/Chat/ChatStateNotifier.h
+++ b/Swiften/Chat/ChatStateNotifier.h
@@ -3,27 +3,28 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Base/boost_bsignals.h>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/ChatState.h>
#include <Swiften/JID/JID.h>
namespace Swift {
class StanzaChannel;
class EntityCapsProvider;
- class ChatStateNotifier {
+ class SWIFTEN_API ChatStateNotifier {
public:
ChatStateNotifier(StanzaChannel* stanzaChannel, const JID& contact, EntityCapsProvider* entityCapsManager);
~ChatStateNotifier();
void setContact(const JID& contact);
void addChatStateRequest(Message::ref message);
void setUserIsTyping();
diff --git a/Swiften/Chat/ChatStateTracker.h b/Swiften/Chat/ChatStateTracker.h
index b356644..e401b0a 100644
--- a/Swiften/Chat/ChatStateTracker.h
+++ b/Swiften/Chat/ChatStateTracker.h
@@ -2,25 +2,26 @@
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Base/boost_bsignals.h>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/Presence.h>
#include <Swiften/Elements/ChatState.h>
namespace Swift {
- class ChatStateTracker {
+ class SWIFTEN_API ChatStateTracker {
public:
ChatStateTracker();
void handleMessageReceived(boost::shared_ptr<Message> message);
void handlePresenceChange(boost::shared_ptr<Presence> newPresence);
boost::signal<void (ChatState::ChatStateType)> onChatStateChange;
private:
void changeState(ChatState::ChatStateType state);
ChatState::ChatStateType currentState_;
};
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index 940a526..9652b16 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -1,19 +1,19 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Client/CoreClient.h>
-
#include <Swiften/Base/SafeString.h>
namespace Swift {
class SoftwareVersionResponder;
class BlindCertificateTrustChecker;
class XMPPRoster;
class XMPPRosterImpl;
class MUCManager;
class XMPPRosterController;
@@ -37,19 +37,19 @@ namespace Swift {
class JingleSessionManager;
class FileTransferManager;
/**
* Provides the core functionality for writing XMPP client software.
*
* Besides connecting to an XMPP server, this class also provides interfaces for
* performing most tasks on the XMPP network.
*/
- class Client : public CoreClient {
+ class SWIFTEN_API Client : public CoreClient {
public:
/**
* Constructs a client for the given JID with the given password.
*
* \param storages The interfaces for storing cache information etc. If
* this is NULL,
* all data will be stored in memory (and be lost on shutdown)
*/
Client(const JID& jid, const SafeString& password, NetworkFactories* networkFactories, Storages* storages = NULL);
diff --git a/Swiften/Client/ClientXMLTracer.h b/Swiften/Client/ClientXMLTracer.h
index 67040c4..91cfe22 100644
--- a/Swiften/Client/ClientXMLTracer.h
+++ b/Swiften/Client/ClientXMLTracer.h
@@ -1,23 +1,24 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Client/CoreClient.h>
#include <Swiften/Client/XMLBeautifier.h>
#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
- class ClientXMLTracer {
+ class SWIFTEN_API ClientXMLTracer {
public:
ClientXMLTracer(CoreClient* client, bool bosh = false);
~ClientXMLTracer();
private:
void printData(char direction, const SafeByteArray& data);
void printLine(char c);
private:
XMLBeautifier *beautifier;
diff --git a/Swiften/Client/CoreClient.h b/Swiften/Client/CoreClient.h
index 4bb04e2..c9da0eb 100644
--- a/Swiften/Client/CoreClient.h
+++ b/Swiften/Client/CoreClient.h
@@ -2,20 +2,21 @@
* Copyright (c) 2010-2012 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
#include <boost/shared_ptr.hpp>
-#include <Swiften/Base/boost_bsignals.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Entity/Entity.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Client/ClientError.h>
#include <Swiften/Client/ClientOptions.h>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/TLS/CertificateWithKey.h>
namespace Swift {
class ChainedConnector;
@@ -39,19 +40,19 @@ namespace Swift {
* The central class for communicating with an XMPP server.
*
* This class is responsible for setting up the connection with the XMPP
* server, authenticating, and initializing the session.
*
* This class can be used directly in your application, although the Client
* subclass provides more functionality and interfaces, and is better suited
* for most needs.
*/
- class CoreClient : public Entity {
+ class SWIFTEN_API CoreClient : public Entity {
public:
/**
* Constructs a client for the given JID with the given password.
* The given eventLoop will be used to post events to.
*/
CoreClient(const JID& jid, const SafeByteArray& password, NetworkFactories* networkFactories);
~CoreClient();
/**
diff --git a/Swiften/Client/NickResolver.h b/Swiften/Client/NickResolver.h
index 584f2ce..306703e 100644
--- a/Swiften/Client/NickResolver.h
+++ b/Swiften/Client/NickResolver.h
@@ -1,28 +1,30 @@
/*
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <map>
#include <boost/shared_ptr.hpp>
+#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
-#include <string>
#include <Swiften/JID/JID.h>
#include <Swiften/Elements/VCard.h>
namespace Swift {
class XMPPRoster;
class MUCRegistry;
class VCardManager;
- class NickResolver {
+
+ class SWIFTEN_API NickResolver {
public:
NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManager* vcardManager, MUCRegistry* mucRegistry);
std::string jidToNick(const JID& jid);
boost::signal<void (const JID&, const std::string& /*previousNick*/)> onNickChanged;
private:
void handleVCardReceived(const JID& jid, VCard::ref vCard);
diff --git a/Swiften/Client/Storages.h b/Swiften/Client/Storages.h
index 1c5bbe9..89b770c 100644
--- a/Swiften/Client/Storages.h
+++ b/Swiften/Client/Storages.h
@@ -1,28 +1,30 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
class VCardStorage;
class AvatarStorage;
class CapsStorage;
class RosterStorage;
/**
* An interface to hold storage classes for different
* controllers.
*/
- class Storages {
+ class SWIFTEN_API Storages {
public:
virtual ~Storages();
virtual VCardStorage* getVCardStorage() const = 0;
virtual AvatarStorage* getAvatarStorage() const = 0;
virtual CapsStorage* getCapsStorage() const = 0;
virtual RosterStorage* getRosterStorage() const = 0;
};
}
diff --git a/Swiften/Component/Component.h b/Swiften/Component/Component.h
index 0b29ff7..f3ae9e8 100644
--- a/Swiften/Component/Component.h
+++ b/Swiften/Component/Component.h
@@ -1,29 +1,30 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Component/CoreComponent.h>
namespace Swift {
class SoftwareVersionResponder;
/**
* Provides the core functionality for writing XMPP component software.
*
* Besides connecting to an XMPP server, this class also provides interfaces for
* performing most component tasks on the XMPP network.
*/
- class Component : public CoreComponent {
+ class SWIFTEN_API Component : public CoreComponent {
public:
Component(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const std::string& secret);
~Component();
/**
* Sets the software version of the client.
*
* This will be used to respond to version queries from other entities.
*/
diff --git a/Swiften/Component/ComponentXMLTracer.h b/Swiften/Component/ComponentXMLTracer.h
index c12ec07..57b9dcf 100644
--- a/Swiften/Component/ComponentXMLTracer.h
+++ b/Swiften/Component/ComponentXMLTracer.h
@@ -1,20 +1,21 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Component/Component.h>
namespace Swift {
- class ComponentXMLTracer {
+ class SWIFTEN_API ComponentXMLTracer {
public:
ComponentXMLTracer(CoreComponent* component);
private:
static void printData(char direction, const SafeByteArray& data);
static void printLine(char c);
};
}
diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h
index e7945d1..4f39ffd 100644
--- a/Swiften/Component/CoreComponent.h
+++ b/Swiften/Component/CoreComponent.h
@@ -2,18 +2,19 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Base/Error.h>
#include <Swiften/Network/PlatformDomainNameResolver.h>
#include <Swiften/Component/ComponentConnector.h>
#include <Swiften/Component/ComponentSession.h>
#include <Swiften/Component/ComponentError.h>
#include <Swiften/Elements/Presence.h>
#include <Swiften/Elements/Message.h>
#include <Swiften/JID/JID.h>
@@ -34,19 +35,19 @@ namespace Swift {
* The central class for communicating with an XMPP server as a component.
*
* This class is responsible for setting up the connection with the XMPP
* server and authenticating the component.
*
* This class can be used directly in your application, although the Component
* subclass provides more functionality and interfaces, and is better suited
* for most needs.
*/
- class CoreComponent : public Entity {
+ class SWIFTEN_API CoreComponent : public Entity {
public:
CoreComponent(EventLoop* eventLoop, NetworkFactories* networkFactories, const JID& jid, const std::string& secret);
~CoreComponent();
void connect(const std::string& host, int port);
void disconnect();
void sendMessage(boost::shared_ptr<Message>);
void sendPresence(boost::shared_ptr<Presence>);
diff --git a/Swiften/Disco/CapsStorage.h b/Swiften/Disco/CapsStorage.h
index fb6e442..7420c28 100644
--- a/Swiften/Disco/CapsStorage.h
+++ b/Swiften/Disco/CapsStorage.h
@@ -3,21 +3,20 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <Swiften/Elements/DiscoInfo.h>
+#include <Swiften/Base/API.h>
namespace Swift {
-
-
- class CapsStorage {
+ class SWIFTEN_API CapsStorage {
public:
virtual ~CapsStorage();
virtual DiscoInfo::ref getDiscoInfo(const std::string&) const = 0;
virtual void setDiscoInfo(const std::string&, DiscoInfo::ref) = 0;
};
}
diff --git a/Swiften/Disco/ClientDiscoManager.h b/Swiften/Disco/ClientDiscoManager.h
index 6f126eb..0cae40e 100644
--- a/Swiften/Disco/ClientDiscoManager.h
+++ b/Swiften/Disco/ClientDiscoManager.h
@@ -1,17 +1,18 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/CapsInfo.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Presence/PayloadAddingPresenceSender.h>
namespace Swift {
class IQRouter;
class DiscoInfoResponder;
class PayloadAddingPresenceSender;
class PresenceSender;
@@ -20,19 +21,19 @@ namespace Swift {
* Class responsible for managing outgoing disco information for a client.
*
* The manager will respond to disco#info requests, and add entity capabilities information
* to outgoing presence.
*
* To use this class, call setCapsNode() once with the caps URI of the client. After this,
* call setDiscoInfo() with the capabilities for the client. This can be
* called whenever the capabilities change.
*/
- class ClientDiscoManager {
+ class SWIFTEN_API ClientDiscoManager {
public:
/**
* Constructs the manager
*
* \param iqRouter the router on which requests will be answered
* \param presenceSender the presence sender to which all outgoing presence
* (with caps information) will be sent.
*/
ClientDiscoManager(IQRouter* iqRouter, PresenceSender* presenceSender);
diff --git a/Swiften/Disco/DiscoServiceWalker.h b/Swiften/Disco/DiscoServiceWalker.h
index fd749fc..1853b57 100644
--- a/Swiften/Disco/DiscoServiceWalker.h
+++ b/Swiften/Disco/DiscoServiceWalker.h
@@ -3,35 +3,36 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <set>
+#include <Swiften/Base/API.h>
#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <string>
#include <Swiften/JID/JID.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/DiscoItems.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/Disco/GetDiscoInfoRequest.h>
#include <Swiften/Disco/GetDiscoItemsRequest.h>
namespace Swift {
class IQRouter;
/**
* Recursively walk service discovery trees to find all services offered.
* This stops on any disco item that's not reporting itself as a server.
*/
- class DiscoServiceWalker {
+ class SWIFTEN_API DiscoServiceWalker {
public:
DiscoServiceWalker(const JID& service, IQRouter* iqRouter, size_t maxSteps = 200);
/**
* Start the walk.
*
* Call this exactly once.
*/
void beginWalk();
diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h
index fec60d6..8add815 100644
--- a/Swiften/Elements/DiscoInfo.h
+++ b/Swiften/Elements/DiscoInfo.h
@@ -3,26 +3,27 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/Form.h>
namespace Swift {
/**
* disco#info from XEP-0030
*/
- class DiscoInfo : public Payload {
+ class SWIFTEN_API DiscoInfo : public Payload {
public:
typedef boost::shared_ptr<DiscoInfo> ref;
static const std::string ChatStatesFeature;
static const std::string SecurityLabelsFeature;
static const std::string SecurityLabelsCatalogFeature;
static const std::string JabberSearchFeature;
static const std::string CommandsFeature;
static const std::string MessageCorrectionFeature;
diff --git a/Swiften/Elements/Element.h b/Swiften/Elements/Element.h
index 1e6a9d0..638418d 100644
--- a/Swiften/Elements/Element.h
+++ b/Swiften/Elements/Element.h
@@ -1,14 +1,16 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class Element {
+ class SWIFTEN_API Element {
public:
virtual ~Element();
};
}
diff --git a/Swiften/Elements/Form.h b/Swiften/Elements/Form.h
index 2c6f963..bd4a2aa 100644
--- a/Swiften/Elements/Form.h
+++ b/Swiften/Elements/Form.h
@@ -3,29 +3,30 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/FormField.h>
#include <Swiften/JID/JID.h>
namespace Swift {
/**
* XEP-0004 Data form.
* For the relevant Fields, the parsers and serialisers protect the API user against
* the strange multi-value instead of newline thing by transforming them.
*/
- class Form : public Payload {
+ class SWIFTEN_API Form : public Payload {
public:
typedef boost::shared_ptr<Form> ref;
typedef std::vector<FormField::ref> FormItem;
enum Type { FormType, SubmitType, CancelType, ResultType };
public:
Form(Type type = FormType) : type_(type) {}
diff --git a/Swiften/Elements/IQ.h b/Swiften/Elements/IQ.h
index 99561f8..ff978b3 100644
--- a/Swiften/Elements/IQ.h
+++ b/Swiften/Elements/IQ.h
@@ -2,23 +2,24 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Stanza.h>
#include <Swiften/Elements/ErrorPayload.h>
namespace Swift {
- class IQ : public Stanza {
+ class SWIFTEN_API IQ : public Stanza {
public:
typedef boost::shared_ptr<IQ> ref;
enum Type { Get, Set, Result, Error };
IQ(Type type = Get) : type_(type) { }
Type getType() const { return type_; }
void setType(Type type) { type_ = type; }
diff --git a/Swiften/Elements/MUCOccupant.h b/Swiften/Elements/MUCOccupant.h
index 931f544..023643c 100644
--- a/Swiften/Elements/MUCOccupant.h
+++ b/Swiften/Elements/MUCOccupant.h
@@ -1,26 +1,27 @@
/*
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/optional.hpp>
-
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
namespace Swift {
class Client;
- class MUCOccupant {
+ class SWIFTEN_API MUCOccupant {
public:
enum Role {Moderator, Participant, Visitor, NoRole};
enum Affiliation {Owner, Admin, Member, Outcast, NoAffiliation};
MUCOccupant(const std::string &nick, Role role, Affiliation affiliation);
MUCOccupant(const MUCOccupant& other);
~MUCOccupant();
std::string getNick() const;
diff --git a/Swiften/Elements/Payload.h b/Swiften/Elements/Payload.h
index f994ebc..15a72d5 100644
--- a/Swiften/Elements/Payload.h
+++ b/Swiften/Elements/Payload.h
@@ -2,17 +2,19 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class Payload {
+ class SWIFTEN_API Payload {
public:
typedef boost::shared_ptr<Payload> ref;
public:
virtual ~Payload();
};
}
diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h
index 28a9ee5..2e9e224 100644
--- a/Swiften/Elements/Presence.h
+++ b/Swiften/Elements/Presence.h
@@ -2,23 +2,24 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/smart_ptr/make_shared.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Stanza.h>
#include <Swiften/Elements/StatusShow.h>
namespace Swift {
- class Presence : public Stanza {
+ class SWIFTEN_API Presence : public Stanza {
public:
typedef boost::shared_ptr<Presence> ref;
enum Type { Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed };
Presence();
Presence(const std::string& status);
virtual ~Presence();
diff --git a/Swiften/Elements/SecurityLabelsCatalog.h b/Swiften/Elements/SecurityLabelsCatalog.h
index 5498fcf..420cf6f 100644
--- a/Swiften/Elements/SecurityLabelsCatalog.h
+++ b/Swiften/Elements/SecurityLabelsCatalog.h
@@ -4,24 +4,25 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <string>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/SecurityLabel.h>
namespace Swift {
- class SecurityLabelsCatalog : public Payload {
+ class SWIFTEN_API SecurityLabelsCatalog : public Payload {
public:
typedef boost::shared_ptr<SecurityLabelsCatalog> ref;
class Item {
public:
Item() : default_(false) {}
SecurityLabel::ref getLabel() const {
return label_;
}
diff --git a/Swiften/Elements/SoftwareVersion.h b/Swiften/Elements/SoftwareVersion.h
index c49b47b..e0eeaa3 100644
--- a/Swiften/Elements/SoftwareVersion.h
+++ b/Swiften/Elements/SoftwareVersion.h
@@ -3,22 +3,23 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SoftwareVersion : public Payload {
+ class SWIFTEN_API SoftwareVersion : public Payload {
public:
typedef boost::shared_ptr<SoftwareVersion> ref;
SoftwareVersion(
const std::string& name = "",
const std::string& version = "",
const std::string& os = "") :
name_(name), version_(version), os_(os) {}
diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h
index 9e082cc..fbb0139 100644
--- a/Swiften/Elements/Stanza.h
+++ b/Swiften/Elements/Stanza.h
@@ -6,25 +6,26 @@
#pragma once
#include <vector>
#include <string>
#include <boost/shared_ptr.hpp>
#include <boost/optional/optional_fwd.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Element.h>
#include <Swiften/JID/JID.h>
namespace Swift {
class Payload;
- class Stanza : public Element {
+ class SWIFTEN_API Stanza : public Element {
public:
typedef boost::shared_ptr<Stanza> ref;
Stanza();
virtual ~Stanza();
template<typename T>
boost::shared_ptr<T> getPayload() const {
for (size_t i = 0; i < payloads_.size(); ++i) {
diff --git a/Swiften/Entity/Entity.h b/Swiften/Entity/Entity.h
index 65480d0..0dc2929 100644
--- a/Swiften/Entity/Entity.h
+++ b/Swiften/Entity/Entity.h
@@ -1,29 +1,31 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
class PayloadParserFactory;
class PayloadSerializer;
class FullPayloadParserFactoryCollection;
class FullPayloadSerializerCollection;
class PayloadParserFactoryCollection;
class PayloadSerializerCollection;
/**
* The base class for XMPP entities (Clients, Components).
*/
- class Entity {
+ class SWIFTEN_API Entity {
public:
Entity();
virtual ~Entity();
void addPayloadParserFactory(PayloadParserFactory* payloadParserFactory);
void removePayloadParserFactory(PayloadParserFactory* payloadParserFactory);
void addPayloadSerializer(PayloadSerializer* payloadSerializer);
void removePayloadSerializer(PayloadSerializer* payloadSerializer);
diff --git a/Swiften/Entity/PayloadPersister.h b/Swiften/Entity/PayloadPersister.h
index ea7c74c..bc406ab 100644
--- a/Swiften/Entity/PayloadPersister.h
+++ b/Swiften/Entity/PayloadPersister.h
@@ -3,24 +3,26 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <boost/filesystem/path.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
class Payload;
class PayloadSerializer;
class PayloadParser;
- class PayloadPersister {
+ class SWIFTEN_API PayloadPersister {
public:
PayloadPersister();
virtual ~PayloadPersister();
void savePayload(boost::shared_ptr<Payload>, const boost::filesystem::path&);
boost::shared_ptr<Payload> loadPayload(const boost::filesystem::path&);
protected:
diff --git a/Swiften/EventLoop/DummyEventLoop.h b/Swiften/EventLoop/DummyEventLoop.h
index 4c01c16..0e5e06d 100644
--- a/Swiften/EventLoop/DummyEventLoop.h
+++ b/Swiften/EventLoop/DummyEventLoop.h
@@ -2,22 +2,23 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <deque>
+#include <Swiften/Base/API.h>
#include <Swiften/EventLoop/EventLoop.h>
namespace Swift {
- class DummyEventLoop : public EventLoop {
+ class SWIFTEN_API DummyEventLoop : public EventLoop {
public:
DummyEventLoop();
~DummyEventLoop();
void processEvents() {
while (!events_.empty()) {
handleEvent(events_[0]);
events_.pop_front();
}
diff --git a/Swiften/EventLoop/EventLoop.h b/Swiften/EventLoop/EventLoop.h
index 9e47112..4a602ae 100644
--- a/Swiften/EventLoop/EventLoop.h
+++ b/Swiften/EventLoop/EventLoop.h
@@ -5,23 +5,25 @@
*/
#pragma once
#include <boost/function.hpp>
#include <boost/thread/mutex.hpp>
#include <list>
#include <deque>
+#include <Swiften/Base/API.h>
#include <Swiften/EventLoop/Event.h>
namespace Swift {
class EventOwner;
- class EventLoop {
+
+ class SWIFTEN_API EventLoop {
public:
EventLoop();
virtual ~EventLoop();
void postEvent(boost::function<void ()> event, boost::shared_ptr<EventOwner> owner = boost::shared_ptr<EventOwner>());
void removeEventsFromOwner(boost::shared_ptr<EventOwner> owner);
protected:
/**
diff --git a/Swiften/EventLoop/EventOwner.h b/Swiften/EventLoop/EventOwner.h
index 4bbd1c4..43a059b 100644
--- a/Swiften/EventLoop/EventOwner.h
+++ b/Swiften/EventLoop/EventOwner.h
@@ -1,14 +1,16 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class EventOwner {
+ class SWIFTEN_API EventOwner {
public:
virtual ~EventOwner();
};
}
diff --git a/Swiften/EventLoop/SimpleEventLoop.h b/Swiften/EventLoop/SimpleEventLoop.h
index 72bd6a6..da1c039 100644
--- a/Swiften/EventLoop/SimpleEventLoop.h
+++ b/Swiften/EventLoop/SimpleEventLoop.h
@@ -5,22 +5,23 @@
*/
#pragma once
#include <vector>
#include <boost/function.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/EventLoop/EventLoop.h>
namespace Swift {
- class SimpleEventLoop : public EventLoop {
+ class SWIFTEN_API SimpleEventLoop : public EventLoop {
public:
SimpleEventLoop();
~SimpleEventLoop();
void run() {
doRun(false);
}
void runUntilEvents() {
diff --git a/Swiften/FileTransfer/FileReadBytestream.h b/Swiften/FileTransfer/FileReadBytestream.h
index e9db2a4..4a2d738 100644
--- a/Swiften/FileTransfer/FileReadBytestream.h
+++ b/Swiften/FileTransfer/FileReadBytestream.h
@@ -3,22 +3,23 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/FileTransfer/ReadBytestream.h>
namespace Swift {
- class FileReadBytestream : public ReadBytestream {
+ class SWIFTEN_API FileReadBytestream : public ReadBytestream {
public:
FileReadBytestream(const boost::filesystem::path& file);
~FileReadBytestream();
virtual boost::shared_ptr< std::vector<unsigned char> > read(size_t size);
virtual bool isFinished() const;
private:
boost::filesystem::path file;
diff --git a/Swiften/FileTransfer/FileWriteBytestream.h b/Swiften/FileTransfer/FileWriteBytestream.h
index 82c4a65..f72ac17 100644
--- a/Swiften/FileTransfer/FileWriteBytestream.h
+++ b/Swiften/FileTransfer/FileWriteBytestream.h
@@ -3,22 +3,23 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/FileTransfer/WriteBytestream.h>
namespace Swift {
- class FileWriteBytestream : public WriteBytestream {
+ class SWIFTEN_API FileWriteBytestream : public WriteBytestream {
public:
FileWriteBytestream(const boost::filesystem::path& file);
~FileWriteBytestream();
virtual void write(const std::vector<unsigned char>&);
void close();
private:
boost::filesystem::path file;
diff --git a/Swiften/JID/JID.h b/Swiften/JID/JID.h
index a4461ba..08309d3 100644
--- a/Swiften/JID/JID.h
+++ b/Swiften/JID/JID.h
@@ -4,31 +4,33 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
//#include <iosfwd>
#include <iostream>
+#include <Swiften/Base/API.h>
+
namespace Swift {
/**
* This represents the JID used in XMPP
* (RFC6120 - http://tools.ietf.org/html/rfc6120 ).
* For a description of format, see the RFC or page 14 of
* XMPP: The Definitive Guide (Saint-Andre et al.)
*
* Particularly - a Bare JID is a JID without a resource part.
*
* A JID can be invalid (when isValid() returns false). No member methods are
* guaranteed to work correctly if they do.
*/
- class JID {
+ class SWIFTEN_API JID {
public:
enum CompareType {
WithResource, WithoutResource
};
/**
* Create a JID from its String representation.
*
* e.g.
diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
index ca5570f..2eb21ed 100644
--- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
+++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
@@ -2,23 +2,25 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
class DNSSDQuerier;
class EventLoop;
- class PlatformDNSSDQuerierFactory {
+ class SWIFTEN_API PlatformDNSSDQuerierFactory {
public:
PlatformDNSSDQuerierFactory(EventLoop* eventLoop);
boost::shared_ptr<DNSSDQuerier> createQuerier();
bool canCreate();
private:
EventLoop* eventLoop;
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index 60ed697..85f4564 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -1,18 +1,19 @@
/*
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
#include <string>
#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/Presence.h>
#include <Swiften/Elements/MUCOccupant.h>
#include <Swiften/MUC/MUCRegistry.h>
#include <Swiften/Elements/MUCOwnerPayload.h>
#include <Swiften/Elements/MUCAdminPayload.h>
#include <Swiften/Elements/Form.h>
@@ -21,19 +22,19 @@
#include <boost/signals/connection.hpp>
#include <map>
namespace Swift {
class StanzaChannel;
class IQRouter;
class DirectedPresenceSender;
- class MUC {
+ class SWIFTEN_API MUC {
public:
typedef boost::shared_ptr<MUC> ref;
enum JoinResult { JoinSucceeded, JoinFailed };
enum LeavingType { LeavePart, LeaveKick, LeaveBan, LeaveDestroy, LeaveNotMember, Disconnect };
public:
MUC(StanzaChannel* stanzaChannel, IQRouter* iqRouter, DirectedPresenceSender* presenceSender, const JID &muc, MUCRegistry* mucRegistry);
diff --git a/Swiften/MUC/MUCBookmarkManager.h b/Swiften/MUC/MUCBookmarkManager.h
index ccea46c..667caa4 100644
--- a/Swiften/MUC/MUCBookmarkManager.h
+++ b/Swiften/MUC/MUCBookmarkManager.h
@@ -6,26 +6,27 @@
#pragma once
#include <vector>
#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/MUC/MUCBookmark.h>
#include <Swiften/Elements/Storage.h>
#include <Swiften/Elements/ErrorPayload.h>
namespace Swift {
class IQRouter;
- class MUCBookmarkManager {
+ class SWIFTEN_API MUCBookmarkManager {
public:
MUCBookmarkManager(IQRouter* iqRouter);
void addBookmark(const MUCBookmark& bookmark);
void removeBookmark(const MUCBookmark& bookmark);
void replaceBookmark(const MUCBookmark& oldBookmark, const MUCBookmark& newBookmark);
const std::vector<MUCBookmark>& getBookmarks() const;
diff --git a/Swiften/MUC/MUCManager.h b/Swiften/MUC/MUCManager.h
index 36ae61e..cf9000b 100644
--- a/Swiften/MUC/MUCManager.h
+++ b/Swiften/MUC/MUCManager.h
@@ -1,26 +1,27 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/MUC/MUC.h>
namespace Swift {
class IQRouter;
class StanzaChannel;
class DirectedPresenceSender;
class MUCRegistry;
- class MUCManager {
+ class SWIFTEN_API MUCManager {
public:
MUCManager(StanzaChannel* stanzaChannel, IQRouter* iqRouter, DirectedPresenceSender* presenceSender, MUCRegistry* mucRegistry);
MUC::ref createMUC(const JID&);
private:
StanzaChannel* stanzaChannel;
IQRouter* iqRouter;
DirectedPresenceSender* presenceSender;
diff --git a/Swiften/MUC/MUCRegistry.h b/Swiften/MUC/MUCRegistry.h
index 0ed2d2e..6ad1b89 100644
--- a/Swiften/MUC/MUCRegistry.h
+++ b/Swiften/MUC/MUCRegistry.h
@@ -2,24 +2,25 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
namespace Swift {
class JID;
- class MUCRegistry {
+ class SWIFTEN_API MUCRegistry {
public:
~MUCRegistry();
bool isMUC(const JID& j) const;
void addMUC(const JID& j);
void removeMUC(const JID& j);
private:
std::vector<JID> mucs;
diff --git a/Swiften/Network/BoostConnection.h b/Swiften/Network/BoostConnection.h
index 0e29c54..636853a 100644
--- a/Swiften/Network/BoostConnection.h
+++ b/Swiften/Network/BoostConnection.h
@@ -5,33 +5,34 @@
*/
#pragma once
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/thread/mutex.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Network/Connection.h>
#include <Swiften/EventLoop/EventOwner.h>
#include <Swiften/Base/SafeByteArray.h>
namespace boost {
class thread;
namespace system {
class error_code;
}
}
namespace Swift {
class EventLoop;
- class BoostConnection : public Connection, public EventOwner, public boost::enable_shared_from_this<BoostConnection> {
+ class SWIFTEN_API BoostConnection : public Connection, public EventOwner, public boost::enable_shared_from_this<BoostConnection> {
public:
typedef boost::shared_ptr<BoostConnection> ref;
~BoostConnection();
static ref create(boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
return ref(new BoostConnection(ioService, eventLoop));
}
diff --git a/Swiften/Network/BoostConnectionServer.h b/Swiften/Network/BoostConnectionServer.h
index 56dc8bd..66af2a4 100644
--- a/Swiften/Network/BoostConnectionServer.h
+++ b/Swiften/Network/BoostConnectionServer.h
@@ -4,26 +4,27 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/enable_shared_from_this.hpp>
-#include <Swiften/Base/boost_bsignals.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/BoostConnection.h>
#include <Swiften/Network/ConnectionServer.h>
#include <Swiften/EventLoop/EventOwner.h>
namespace Swift {
- class BoostConnectionServer : public ConnectionServer, public EventOwner, public boost::enable_shared_from_this<BoostConnectionServer> {
+ class SWIFTEN_API BoostConnectionServer : public ConnectionServer, public EventOwner, public boost::enable_shared_from_this<BoostConnectionServer> {
public:
typedef boost::shared_ptr<BoostConnectionServer> ref;
enum Error {
Conflict,
UnknownError
};
static ref create(int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
diff --git a/Swiften/Network/BoostIOServiceThread.h b/Swiften/Network/BoostIOServiceThread.h
index 00fb397..d1a5f37 100644
--- a/Swiften/Network/BoostIOServiceThread.h
+++ b/Swiften/Network/BoostIOServiceThread.h
@@ -4,20 +4,22 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/asio/io_service.hpp>
#include <boost/thread/thread.hpp>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class BoostIOServiceThread {
+ class SWIFTEN_API BoostIOServiceThread {
public:
BoostIOServiceThread();
~BoostIOServiceThread();
boost::shared_ptr<boost::asio::io_service> getIOService() const {
return ioService_;
}
private:
diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h
index c9b12da..1968acd 100644
--- a/Swiften/Network/BoostNetworkFactories.h
+++ b/Swiften/Network/BoostNetworkFactories.h
@@ -1,26 +1,27 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Network/NetworkFactories.h>
#include <Swiften/Network/BoostIOServiceThread.h>
namespace Swift {
class EventLoop;
class NATTraverser;
class PlatformTLSFactories;
- class BoostNetworkFactories : public NetworkFactories {
+ class SWIFTEN_API BoostNetworkFactories : public NetworkFactories {
public:
BoostNetworkFactories(EventLoop* eventLoop);
~BoostNetworkFactories();
virtual TimerFactory* getTimerFactory() const {
return timerFactory;
}
virtual ConnectionFactory* getConnectionFactory() const {
diff --git a/Swiften/Network/ConnectionServer.h b/Swiften/Network/ConnectionServer.h
index 00703a4..e644d90 100644
--- a/Swiften/Network/ConnectionServer.h
+++ b/Swiften/Network/ConnectionServer.h
@@ -1,25 +1,26 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
-#include <Swiften/Base/boost_bsignals.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/Connection.h>
#include <Swiften/Network/HostAddressPort.h>
namespace Swift {
- class ConnectionServer {
+ class SWIFTEN_API ConnectionServer {
public:
virtual ~ConnectionServer();
virtual HostAddressPort getAddressPort() const = 0;
virtual void start() = 0;
virtual void stop() = 0;
diff --git a/Swiften/Network/DomainNameResolver.h b/Swiften/Network/DomainNameResolver.h
index b0ebc35..491586a 100644
--- a/Swiften/Network/DomainNameResolver.h
+++ b/Swiften/Network/DomainNameResolver.h
@@ -1,25 +1,26 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
-
#include <string>
+#include <Swiften/Base/API.h>
+
namespace Swift {
class DomainNameServiceQuery;
class DomainNameAddressQuery;
- class DomainNameResolver {
+ class SWIFTEN_API DomainNameResolver {
public:
virtual ~DomainNameResolver();
virtual boost::shared_ptr<DomainNameServiceQuery> createServiceQuery(const std::string& name) = 0;
virtual boost::shared_ptr<DomainNameAddressQuery> createAddressQuery(const std::string& name) = 0;
};
}
diff --git a/Swiften/Network/HostAddress.h b/Swiften/Network/HostAddress.h
index 0b3bdda..621aa5d 100644
--- a/Swiften/Network/HostAddress.h
+++ b/Swiften/Network/HostAddress.h
@@ -2,20 +2,22 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
#include <boost/asio/ip/address.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class HostAddress {
+ class SWIFTEN_API HostAddress {
public:
HostAddress();
HostAddress(const std::string&);
HostAddress(const unsigned char* address, int length);
HostAddress(const boost::asio::ip::address& address);
std::string toString() const;
boost::asio::ip::address getRawAddress() const;
diff --git a/Swiften/Network/HostAddressPort.h b/Swiften/Network/HostAddressPort.h
index e3c0413..68f3a1c 100644
--- a/Swiften/Network/HostAddressPort.h
+++ b/Swiften/Network/HostAddressPort.h
@@ -2,22 +2,23 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/asio/ip/tcp.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Network/HostAddress.h>
namespace Swift {
- class HostAddressPort {
+ class SWIFTEN_API HostAddressPort {
public:
HostAddressPort(const HostAddress& address = HostAddress(), int port = -1);
HostAddressPort(const boost::asio::ip::tcp::endpoint& endpoint);
const HostAddress& getAddress() const {
return address_;
}
int getPort() const {
diff --git a/Swiften/Network/PlatformDomainNameResolver.h b/Swiften/Network/PlatformDomainNameResolver.h
index 295ecc5..0617d9e 100644
--- a/Swiften/Network/PlatformDomainNameResolver.h
+++ b/Swiften/Network/PlatformDomainNameResolver.h
@@ -5,28 +5,29 @@
*/
#pragma once
#include <deque>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Network/DomainNameResolver.h>
#include <Swiften/Network/PlatformDomainNameQuery.h>
#include <Swiften/Network/DomainNameServiceQuery.h>
#include <Swiften/Network/DomainNameAddressQuery.h>
namespace Swift {
class EventLoop;
- class PlatformDomainNameResolver : public DomainNameResolver {
+ class SWIFTEN_API PlatformDomainNameResolver : public DomainNameResolver {
public:
PlatformDomainNameResolver(EventLoop* eventLoop);
~PlatformDomainNameResolver();
virtual DomainNameServiceQuery::ref createServiceQuery(const std::string& name);
virtual DomainNameAddressQuery::ref createAddressQuery(const std::string& name);
private:
void run();
diff --git a/Swiften/Parser/AttributeMap.h b/Swiften/Parser/AttributeMap.h
index 31df606..77b9c23 100644
--- a/Swiften/Parser/AttributeMap.h
+++ b/Swiften/Parser/AttributeMap.h
@@ -5,22 +5,23 @@
*/
#pragma once
#include <vector>
#include <string>
#include <map>
#include <boost/optional/optional_fwd.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Parser/Attribute.h>
namespace Swift {
- class AttributeMap {
+ class SWIFTEN_API AttributeMap {
public:
class Entry {
public:
Entry(const Attribute& attribute, const std::string& value) : attribute(attribute), value(value) {
}
const Attribute& getAttribute() const {
return attribute;
}
diff --git a/Swiften/Parser/PayloadParser.h b/Swiften/Parser/PayloadParser.h
index 8a9a290..bb1ae3c 100644
--- a/Swiften/Parser/PayloadParser.h
+++ b/Swiften/Parser/PayloadParser.h
@@ -1,34 +1,36 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
-#include <Swiften/Parser/AttributeMap.h>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Parser/AttributeMap.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
/**
* A parser for XMPP stanza payloads.
*
* The parser is event driven: handleStartElement, handleEndElement, and handleCharacterData will be called
* when the parser detects start and end of XML elements, or character data.
* After the data for the given top-level element is processed, getPayload() will be called to retrieve the
* payload.
*/
- class PayloadParser {
+ class SWIFTEN_API PayloadParser {
public:
virtual ~PayloadParser();
/**
* Handle the start of an XML element.
*/
virtual void handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) = 0;
/**
diff --git a/Swiften/Parser/PayloadParserFactory.h b/Swiften/Parser/PayloadParserFactory.h
index 5619d21..e265e5b 100644
--- a/Swiften/Parser/PayloadParserFactory.h
+++ b/Swiften/Parser/PayloadParserFactory.h
@@ -1,27 +1,28 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Parser/AttributeMap.h>
namespace Swift {
class PayloadParser;
/**
* A factory for PayloadParsers.
*/
- class PayloadParserFactory {
+ class SWIFTEN_API PayloadParserFactory {
public:
virtual ~PayloadParserFactory();
/**
* Checks whether this factory can parse the given top-level element in the given namespace (with the given attributes).
*/
virtual bool canParse(const std::string& element, const std::string& ns, const AttributeMap& attributes) const = 0;
/**
diff --git a/Swiften/Parser/PayloadParserFactoryCollection.h b/Swiften/Parser/PayloadParserFactoryCollection.h
index 6407641..1dbdd32 100644
--- a/Swiften/Parser/PayloadParserFactoryCollection.h
+++ b/Swiften/Parser/PayloadParserFactoryCollection.h
@@ -3,23 +3,24 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <Swiften/Parser/AttributeMap.h>
+#include <Swiften/Base/API.h>
namespace Swift {
class PayloadParserFactory;
- class PayloadParserFactoryCollection {
+ class SWIFTEN_API PayloadParserFactoryCollection {
public:
PayloadParserFactoryCollection();
void addFactory(PayloadParserFactory* factory);
void removeFactory(PayloadParserFactory* factory);
void setDefaultFactory(PayloadParserFactory* factory);
PayloadParserFactory* getPayloadParserFactory(const std::string& element, const std::string& ns, const AttributeMap& attributes);
diff --git a/Swiften/Parser/PayloadParsers/DiscoInfoParser.h b/Swiften/Parser/PayloadParsers/DiscoInfoParser.h
index df1441c..1f93a88 100644
--- a/Swiften/Parser/PayloadParsers/DiscoInfoParser.h
+++ b/Swiften/Parser/PayloadParsers/DiscoInfoParser.h
@@ -1,22 +1,23 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
- class DiscoInfoParser : public GenericPayloadParser<DiscoInfo> {
+ class SWIFTEN_API DiscoInfoParser : public GenericPayloadParser<DiscoInfo> {
public:
DiscoInfoParser();
virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
virtual void handleEndElement(const std::string& element, const std::string&);
virtual void handleCharacterData(const std::string& data);
private:
enum Level {
diff --git a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
index 46b692b..91302b1 100644
--- a/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
+++ b/Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h
@@ -3,23 +3,24 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/Parser/PayloadParserFactoryCollection.h>
#include <Swiften/Parser/PayloadParserFactory.h>
namespace Swift {
- class FullPayloadParserFactoryCollection : public PayloadParserFactoryCollection {
+ class SWIFTEN_API FullPayloadParserFactoryCollection : public PayloadParserFactoryCollection {
public:
FullPayloadParserFactoryCollection();
~FullPayloadParserFactoryCollection();
private:
std::vector< boost::shared_ptr<PayloadParserFactory> > factories_;
PayloadParserFactory* defaultFactory_;
};
}
diff --git a/Swiften/Parser/PayloadParsers/RosterParser.h b/Swiften/Parser/PayloadParsers/RosterParser.h
index c29064f..3b62f0b 100644
--- a/Swiften/Parser/PayloadParsers/RosterParser.h
+++ b/Swiften/Parser/PayloadParsers/RosterParser.h
@@ -1,24 +1,25 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/RosterPayload.h>
#include <Swiften/Parser/GenericPayloadParser.h>
namespace Swift {
class SerializingParser;
- class RosterParser : public GenericPayloadParser<RosterPayload> {
+ class SWIFTEN_API RosterParser : public GenericPayloadParser<RosterPayload> {
public:
RosterParser();
virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
virtual void handleEndElement(const std::string& element, const std::string&);
virtual void handleCharacterData(const std::string& data);
private:
enum Level {
diff --git a/Swiften/Parser/PayloadParsers/VCardParser.h b/Swiften/Parser/PayloadParsers/VCardParser.h
index 1475277..b1c47a3 100644
--- a/Swiften/Parser/PayloadParsers/VCardParser.h
+++ b/Swiften/Parser/PayloadParsers/VCardParser.h
@@ -3,22 +3,24 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Elements/VCard.h>
#include <Swiften/Parser/GenericPayloadParser.h>
+#include <Swiften/Base/API.h>
+
namespace Swift {
class SerializingParser;
- class VCardParser : public GenericPayloadParser<VCard> {
+ class SWIFTEN_API VCardParser : public GenericPayloadParser<VCard> {
public:
VCardParser();
virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
virtual void handleEndElement(const std::string& element, const std::string&);
virtual void handleCharacterData(const std::string& data);
private:
std::string getElementHierarchy() const;
diff --git a/Swiften/Parser/PlatformXMLParserFactory.h b/Swiften/Parser/PlatformXMLParserFactory.h
index 16756ee..70355d0 100644
--- a/Swiften/Parser/PlatformXMLParserFactory.h
+++ b/Swiften/Parser/PlatformXMLParserFactory.h
@@ -1,18 +1,19 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Parser/XMLParserFactory.h>
+#include <Swiften/Base/API.h>
namespace Swift {
- class PlatformXMLParserFactory : public XMLParserFactory {
+ class SWIFTEN_API PlatformXMLParserFactory : public XMLParserFactory {
public:
PlatformXMLParserFactory();
virtual XMLParser* createXMLParser(XMLParserClient*);
};
}
diff --git a/Swiften/Parser/XMLParser.h b/Swiften/Parser/XMLParser.h
index 1b866e3..6ecc626 100644
--- a/Swiften/Parser/XMLParser.h
+++ b/Swiften/Parser/XMLParser.h
@@ -2,23 +2,24 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
+
namespace Swift {
-
class XMLParserClient;
- class XMLParser {
+ class SWIFTEN_API XMLParser {
public:
XMLParser(XMLParserClient* client);
virtual ~XMLParser();
virtual bool parse(const std::string& data) = 0;
XMLParserClient* getClient() const {
return client_;
}
diff --git a/Swiften/Parser/XMLParserClient.h b/Swiften/Parser/XMLParserClient.h
index ff706a0..956eacf 100644
--- a/Swiften/Parser/XMLParserClient.h
+++ b/Swiften/Parser/XMLParserClient.h
@@ -1,25 +1,21 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
-#ifndef XMLPARSERCLIENT_H
-#define XMLPARSERCLIENT_H
+#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Parser/AttributeMap.h>
namespace Swift {
-
-
- class XMLParserClient {
+ class SWIFTEN_API XMLParserClient {
public:
virtual ~XMLParserClient();
virtual void handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) = 0;
virtual void handleEndElement(const std::string& element, const std::string& ns) = 0;
virtual void handleCharacterData(const std::string& data) = 0;
};
}
-
-#endif
diff --git a/Swiften/Parser/XMLParserFactory.h b/Swiften/Parser/XMLParserFactory.h
index 32665cb..6979ea4 100644
--- a/Swiften/Parser/XMLParserFactory.h
+++ b/Swiften/Parser/XMLParserFactory.h
@@ -1,19 +1,21 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
class XMLParser;
class XMLParserClient;
- class XMLParserFactory {
+ class SWIFTEN_API XMLParserFactory {
public:
virtual ~XMLParserFactory();
virtual XMLParser* createXMLParser(XMLParserClient*) = 0;
};
}
diff --git a/Swiften/Parser/XMPPParser.h b/Swiften/Parser/XMPPParser.h
index 6cce2bd..757ee22 100644
--- a/Swiften/Parser/XMPPParser.h
+++ b/Swiften/Parser/XMPPParser.h
@@ -3,29 +3,30 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Parser/XMLParserClient.h>
#include <Swiften/Parser/AttributeMap.h>
namespace Swift {
class XMLParser;
class XMPPParserClient;
class XMLParserFactory;
class ElementParser;
class PayloadParserFactoryCollection;
- class XMPPParser : public XMLParserClient, boost::noncopyable {
+ class SWIFTEN_API XMPPParser : public XMLParserClient, boost::noncopyable {
public:
XMPPParser(
XMPPParserClient* parserClient,
PayloadParserFactoryCollection* payloadParserFactories,
XMLParserFactory* xmlParserFactory);
~XMPPParser();
bool parse(const std::string&);
diff --git a/Swiften/Parser/XMPPParserClient.h b/Swiften/Parser/XMPPParserClient.h
index e613f8e..85e0f86 100644
--- a/Swiften/Parser/XMPPParserClient.h
+++ b/Swiften/Parser/XMPPParserClient.h
@@ -2,24 +2,25 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Element.h>
namespace Swift {
class ProtocolHeader;
- class XMPPParserClient {
+ class SWIFTEN_API XMPPParserClient {
public:
virtual ~XMPPParserClient();
virtual void handleStreamStart(const ProtocolHeader&) = 0;
virtual void handleElement(boost::shared_ptr<Element>) = 0;
virtual void handleStreamEnd() = 0;
};
}
diff --git a/Swiften/Presence/PresenceOracle.h b/Swiften/Presence/PresenceOracle.h
index 09126ea..fcf974f 100644
--- a/Swiften/Presence/PresenceOracle.h
+++ b/Swiften/Presence/PresenceOracle.h
@@ -5,23 +5,25 @@
*/
#pragma once
#include <map>
#include <string>
#include <Swiften/Elements/Presence.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
-class StanzaChannel;
- class PresenceOracle {
+ class StanzaChannel;
+
+ class SWIFTEN_API PresenceOracle {
public:
PresenceOracle(StanzaChannel* stanzaChannel);
~PresenceOracle();
Presence::ref getLastPresence(const JID&) const;
Presence::ref getHighestPriorityPresence(const JID& bareJID) const;
std::vector<Presence::ref> getAllPresence(const JID& bareJID) const;
public:
diff --git a/Swiften/Presence/SubscriptionManager.h b/Swiften/Presence/SubscriptionManager.h
index efa3e1c..5fabb04 100644
--- a/Swiften/Presence/SubscriptionManager.h
+++ b/Swiften/Presence/SubscriptionManager.h
@@ -6,23 +6,24 @@
#pragma once
#include <map>
#include <string>
#include <Swiften/JID/JID.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Elements/Presence.h>
+#include <Swiften/Base/API.h>
namespace Swift {
class StanzaChannel;
- class SubscriptionManager {
+ class SWIFTEN_API SubscriptionManager {
public:
SubscriptionManager(StanzaChannel* stanzaChannel);
~SubscriptionManager();
void cancelSubscription(const JID& jid);
void confirmSubscription(const JID& jid);
void requestSubscription(const JID& jid);
/**
diff --git a/Swiften/Queries/GenericRequest.h b/Swiften/Queries/GenericRequest.h
index b9cc6fc..68c86c5 100644
--- a/Swiften/Queries/GenericRequest.h
+++ b/Swiften/Queries/GenericRequest.h
@@ -1,19 +1,18 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Base/boost_bsignals.h>
-
#include <Swiften/Queries/Request.h>
namespace Swift {
/**
* GenericRequest is used for managing the sending of, and handling of replies to, iq stanzas that do not have their own Request types.
*
* To create an iq stanza, call a constructor with the type of the iq that needs to be sent (either Set or Get), addressing information (clients should use the constructor that doesn't specify a sender), the payload that should be sent in the iq, and the IQRouter for the connection, obtained through the Client or CoreClient object.
*
* Having created a GenericRequest, connect to the onResponse signal to be told when a response (either a result or an error) has been received by Swiften.
diff --git a/Swiften/Queries/GetResponder.h b/Swiften/Queries/GetResponder.h
index bca507a..213a52f 100644
--- a/Swiften/Queries/GetResponder.h
+++ b/Swiften/Queries/GetResponder.h
@@ -1,20 +1,21 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Queries/Responder.h>
namespace Swift {
template<typename T>
- class GetResponder : public Responder<T> {
+ class SWIFTEN_API GetResponder : public Responder<T> {
public:
GetResponder(IQRouter* router) : Responder<T>(router) {}
private:
virtual bool handleSetRequest(const JID&, const JID&, const std::string&, boost::shared_ptr<T>) { return false; }
};
}
diff --git a/Swiften/Queries/IQHandler.h b/Swiften/Queries/IQHandler.h
index c9af5ea..19e16a7 100644
--- a/Swiften/Queries/IQHandler.h
+++ b/Swiften/Queries/IQHandler.h
@@ -2,21 +2,22 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/IQ.h>
namespace Swift {
class IQRouter;
- class IQHandler {
+ class SWIFTEN_API IQHandler {
public:
virtual ~IQHandler();
virtual bool handleIQ(boost::shared_ptr<IQ>) = 0;
};
}
diff --git a/Swiften/Queries/IQRouter.h b/Swiften/Queries/IQRouter.h
index de2822b..0655035 100644
--- a/Swiften/Queries/IQRouter.h
+++ b/Swiften/Queries/IQRouter.h
@@ -2,27 +2,28 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <vector>
-
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/IQ.h>
namespace Swift {
class IQChannel;
class IQHandler;
- class IQRouter {
+ class SWIFTEN_API IQRouter {
public:
IQRouter(IQChannel* channel);
~IQRouter();
/**
* Sets the JID of this IQ router.
*
* This JID is used by requests to check whether incoming
* results are addressed correctly.
diff --git a/Swiften/Queries/Request.h b/Swiften/Queries/Request.h
index 668ed04..5e3a4b8 100644
--- a/Swiften/Queries/Request.h
+++ b/Swiften/Queries/Request.h
@@ -3,31 +3,32 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
#include <boost/enable_shared_from_this.hpp>
-
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Queries/IQHandler.h>
#include <Swiften/Elements/IQ.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
/**
* An IQ get/set request query.
*/
- class Request : public IQHandler, public boost::enable_shared_from_this<Request> {
+ class SWIFTEN_API Request : public IQHandler, public boost::enable_shared_from_this<Request> {
public:
void send();
const JID& getReceiver() const {
return receiver_;
}
protected:
/**
diff --git a/Swiften/Queries/Responders/SoftwareVersionResponder.h b/Swiften/Queries/Responders/SoftwareVersionResponder.h
index a2929df..4957c0f 100644
--- a/Swiften/Queries/Responders/SoftwareVersionResponder.h
+++ b/Swiften/Queries/Responders/SoftwareVersionResponder.h
@@ -1,24 +1,25 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Queries/GetResponder.h>
#include <Swiften/Elements/SoftwareVersion.h>
namespace Swift {
class IQRouter;
- class SoftwareVersionResponder : public GetResponder<SoftwareVersion> {
+ class SWIFTEN_API SoftwareVersionResponder : public GetResponder<SoftwareVersion> {
public:
SoftwareVersionResponder(IQRouter* router);
void setVersion(const std::string& client, const std::string& version, const std::string& os = "");
private:
virtual bool handleGetRequest(const JID& from, const JID& to, const std::string& id, boost::shared_ptr<SoftwareVersion> payload);
private:
diff --git a/Swiften/Roster/RosterStorage.h b/Swiften/Roster/RosterStorage.h
index ba24cb3..7f0f20b 100644
--- a/Swiften/Roster/RosterStorage.h
+++ b/Swiften/Roster/RosterStorage.h
@@ -2,20 +2,21 @@
* Copyright (c) 2011 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/RosterPayload.h>
namespace Swift {
- class RosterStorage {
+ class SWIFTEN_API RosterStorage {
public:
virtual ~RosterStorage();
virtual boost::shared_ptr<RosterPayload> getRoster() const = 0;
virtual void setRoster(boost::shared_ptr<RosterPayload>) = 0;
};
}
diff --git a/Swiften/SASL/PLAINMessage.h b/Swiften/SASL/PLAINMessage.h
index 46ee8f7..3811b31 100644
--- a/Swiften/SASL/PLAINMessage.h
+++ b/Swiften/SASL/PLAINMessage.h
@@ -3,22 +3,24 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
// TODO: Get rid of this
//
#pragma once
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
- class PLAINMessage {
+ class SWIFTEN_API PLAINMessage {
public:
PLAINMessage(const std::string& authcid, const SafeByteArray& password, const std::string& authzid = "");
PLAINMessage(const SafeByteArray& value);
SafeByteArray getValue() const;
const std::string& getAuthenticationID() const {
return authcid;
}
diff --git a/Swiften/SConscript b/Swiften/SConscript
index de67983..105a7f4 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -3,44 +3,47 @@ import os, re, Version, os.path
Import("env")
################################################################################
# Flags
################################################################################
swiften_dep_modules = ["BOOST", "GCONF", "ICU", "LIBIDN", "ZLIB", "OPENSSL", "LIBXML", "EXPAT", "AVAHI", "LIBMINIUPNPC", "LIBNATPMP"]
if env["SCONS_STAGE"] == "flags" :
+ env["SWIFTEN_DLL"] = ARGUMENTS.get("swiften_dll")
env["SWIFTEN_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift")
version_match = re.match("(\d+)\.(\d+).*", env["SWIFTEN_VERSION"])
if version_match :
env["SWIFTEN_VERSION_MAJOR"] = int(version_match.group(1))
env["SWIFTEN_VERSION_MINOR"] = int(version_match.group(2))
else :
env["SWIFTEN_VERSION_MAJOR"] = 0
env["SWIFTEN_VERSION_MINOR"] = 0
env["SWIFTEN_VERSION_PATCH"] = 0
env["SWIFTEN_LIBRARY"] = "Swiften"
env["SWIFTEN_LIBRARY_FILE"] = "Swiften"
env["SWIFTEN_LIBRARY_ALIASES"] = []
- if ARGUMENTS.get("swiften_dll", False) :
+ if env["SWIFTEN_DLL"] :
if env["PLATFORM"] == "win32" :
- pass
+ env["SWIFTEN_LIBRARY_FILE"] = "Swiften.dll"
elif env["PLATFORM"] == "darwin" :
env["SWIFTEN_LIBRARY_FILE"] = env.subst("Swiften.${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}")
env["SWIFTEN_LIBRARY_ALIASES"] = ["libSwiften.dylib", env.subst("libSwiften.${SWIFTEN_VERSION_MAJOR}.dylib")]
else :
env["SWIFTEN_LIBRARY_FILE"] = env.subst("libSwiften.so.${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}")
env["SWIFTEN_LIBRARY_ALIASES"] = ["libSwiften.so", env.subst("libSwiften.so.${SWIFTEN_VERSION_MAJOR}")]
swiften_env = env.Clone()
swiften_env["LIBPATH"] = [Dir(".")]
swiften_env["LIBS"] = [swiften_env["SWIFTEN_LIBRARY"]]
+ if not env["SWIFTEN_DLL"] :
+ swiften_env["CPPDEFINES"] = ["SWIFTEN_STATIC"]
dep_env = env.Clone()
for module in swiften_dep_modules :
if env.get(module + "_BUNDLED", False) :
swiften_env.UseFlags(env.get(module + "_FLAGS", {}))
else :
dep_env.UseFlags(env.get(module + "_FLAGS", {}))
dep_env.UseFlags(dep_env["PLATFORM_FLAGS"])
if env.get("HAVE_SCHANNEL", 0) :
@@ -57,23 +60,24 @@ if env["SCONS_STAGE"] == "flags" :
"FRAMEWORKS": e.get("FRAMEWORKS", []),
}
################################################################################
# Build
################################################################################
if env["SCONS_STAGE"] == "build" :
swiften_env = env.Clone()
+ swiften_env.Append(CPPDEFINES = ["SWIFTEN_BUILDING"])
for module in swiften_dep_modules :
swiften_env.UseFlags(swiften_env.get(module + "_FLAGS", {}))
swiften_env.UseFlags(swiften_env["PLATFORM_FLAGS"])
- if ARGUMENTS.get("swiften_dll", False) :
+ if swiften_env["SWIFTEN_DLL"] :
swiften_env.AddMethod(lambda e,s : e.SharedObject(s), "SwiftenObject")
swiften_env.AddMethod(lambda e,l,o : e.SharedLibrary(l,o), "SwiftenLibrary")
else :
swiften_env.AddMethod(lambda e,s : e.StaticObject(s), "SwiftenObject")
swiften_env.AddMethod(lambda e,l,o : e.StaticLibrary(l,o), "SwiftenLibrary")
Export("swiften_env")
# TODO: Move all this to a submodule SConscript
sources = [
@@ -227,28 +231,27 @@ if env["SCONS_STAGE"] == "build" :
if env["build_examples"] :
SConscript(dirs = [
"Config",
"Examples"
])
env.SConscript(test_only = True, dirs = [
"QA",
])
-
myenv = swiften_env.Clone()
if myenv["PLATFORM"] == "win32":
sources.append("StringCodecs/SHA1_Windows.cpp")
else:
sources.append("StringCodecs/SHA1.cpp")
if myenv["PLATFORM"] != "darwin" and myenv["PLATFORM"] != "win32" and myenv.get("HAVE_GCONF", 0) :
env.MergeFlags(env["GCONF_FLAGS"])
- if ARGUMENTS.get("swiften_dll", False) :
+ if myenv["SWIFTEN_DLL"] :
if myenv["PLATFORM"] == "posix" :
myenv.Append(LINKFLAGS = ["-Wl,-soname,libSwiften.so.$SWIFTEN_VERSION_MAJOR"])
myenv["SHLIBSUFFIX"] = ""
elif myenv["PLATFORM"] == "darwin" :
myenv.Append(LINKFLAGS = ["-Wl,-install_name,libSwiften.so.$SWIFTEN_VERSION_MAJOR", "-Wl,-compatibility_version,${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}", "-Wl,-current_version,${SWIFTEN_VERSION_MAJOR}.${SWIFTEN_VERSION_MINOR}"])
swiften_lib = myenv.SwiftenLibrary(swiften_env["SWIFTEN_LIBRARY_FILE"], sources + swiften_env["SWIFTEN_OBJECTS"])
def symlink(env, target, source) :
if os.path.exists(str(target[0])) :
os.unlink(str(target[0]))
diff --git a/Swiften/Serializer/PayloadSerializer.h b/Swiften/Serializer/PayloadSerializer.h
index c4ad23b..46132fc 100644
--- a/Swiften/Serializer/PayloadSerializer.h
+++ b/Swiften/Serializer/PayloadSerializer.h
@@ -3,20 +3,22 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
+
namespace Swift {
class Payload;
- class PayloadSerializer {
+ class SWIFTEN_API PayloadSerializer {
public:
virtual ~PayloadSerializer();
virtual bool canSerialize(boost::shared_ptr<Payload>) const = 0;
virtual std::string serialize(boost::shared_ptr<Payload>) const = 0;
};
}
diff --git a/Swiften/Serializer/PayloadSerializerCollection.h b/Swiften/Serializer/PayloadSerializerCollection.h
index f922a45..78f8808 100644
--- a/Swiften/Serializer/PayloadSerializerCollection.h
+++ b/Swiften/Serializer/PayloadSerializerCollection.h
@@ -3,25 +3,26 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
class PayloadSerializer;
- class PayloadSerializerCollection {
+ class SWIFTEN_API PayloadSerializerCollection {
public:
PayloadSerializerCollection();
void addSerializer(PayloadSerializer* factory);
void removeSerializer(PayloadSerializer* factory);
PayloadSerializer* getPayloadSerializer(boost::shared_ptr<Payload>) const;
private:
std::vector<PayloadSerializer*> serializers_;
diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
index 3e028e1..233d752 100644
--- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h
@@ -1,19 +1,20 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Serializer/GenericPayloadSerializer.h>
#include <Swiften/Elements/DiscoInfo.h>
namespace Swift {
- class DiscoInfoSerializer : public GenericPayloadSerializer<DiscoInfo> {
+ class SWIFTEN_API DiscoInfoSerializer : public GenericPayloadSerializer<DiscoInfo> {
public:
DiscoInfoSerializer();
virtual std::string serializePayload(boost::shared_ptr<DiscoInfo>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
index 41e35a9..f41d585 100644
--- a/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/ErrorSerializer.h
@@ -1,24 +1,25 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Serializer/GenericPayloadSerializer.h>
#include <Swiften/Elements/ErrorPayload.h>
namespace Swift {
class PayloadSerializerCollection;
- class ErrorSerializer : public GenericPayloadSerializer<ErrorPayload> {
+ class SWIFTEN_API ErrorSerializer : public GenericPayloadSerializer<ErrorPayload> {
public:
ErrorSerializer(PayloadSerializerCollection* serializers);
virtual std::string serializePayload(boost::shared_ptr<ErrorPayload> error) const;
private:
PayloadSerializerCollection* serializers;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h
index bfe7d76..eaae742 100644
--- a/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h
+++ b/Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h
@@ -2,21 +2,22 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/Serializer/PayloadSerializerCollection.h>
namespace Swift {
- class FullPayloadSerializerCollection : public PayloadSerializerCollection {
+ class SWIFTEN_API FullPayloadSerializerCollection : public PayloadSerializerCollection {
public:
FullPayloadSerializerCollection();
~FullPayloadSerializerCollection();
private:
std::vector<PayloadSerializer*> serializers_;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
index 52fdb2a..9e7ea1b 100644
--- a/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/RosterSerializer.h
@@ -1,19 +1,20 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Serializer/GenericPayloadSerializer.h>
#include <Swiften/Elements/RosterPayload.h>
namespace Swift {
- class RosterSerializer : public GenericPayloadSerializer<RosterPayload> {
+ class SWIFTEN_API RosterSerializer : public GenericPayloadSerializer<RosterPayload> {
public:
RosterSerializer();
virtual std::string serializePayload(boost::shared_ptr<RosterPayload>) const;
};
}
diff --git a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
index c73ff18..04c1843 100644
--- a/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/VCardSerializer.h
@@ -3,17 +3,19 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <Swiften/Serializer/GenericPayloadSerializer.h>
#include <Swiften/Elements/VCard.h>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class VCardSerializer : public GenericPayloadSerializer<VCard> {
+ class SWIFTEN_API VCardSerializer : public GenericPayloadSerializer<VCard> {
public:
VCardSerializer();
virtual std::string serializePayload(boost::shared_ptr<VCard>) const;
};
}
diff --git a/Swiften/Serializer/XML/XMLElement.h b/Swiften/Serializer/XML/XMLElement.h
index 6eacb82..305932a 100644
--- a/Swiften/Serializer/XML/XMLElement.h
+++ b/Swiften/Serializer/XML/XMLElement.h
@@ -6,22 +6,23 @@
#pragma once
#include <boost/shared_ptr.hpp>
#include <vector>
#include <map>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Serializer/XML/XMLNode.h>
namespace Swift {
- class XMLElement : public XMLNode {
+ class SWIFTEN_API XMLElement : public XMLNode {
public:
typedef boost::shared_ptr<XMLElement> ref;
XMLElement(const std::string& tag, const std::string& xmlns = "", const std::string& text = "");
void setAttribute(const std::string& attribute, const std::string& value);
void addNode(boost::shared_ptr<XMLNode> node);
virtual std::string serialize();
diff --git a/Swiften/Serializer/XML/XMLNode.h b/Swiften/Serializer/XML/XMLNode.h
index d222faf..9d9e1a0 100644
--- a/Swiften/Serializer/XML/XMLNode.h
+++ b/Swiften/Serializer/XML/XMLNode.h
@@ -2,17 +2,19 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class XMLNode {
+ class SWIFTEN_API XMLNode {
public:
virtual ~XMLNode();
virtual std::string serialize() = 0;
};
}
diff --git a/Swiften/Session/Session.h b/Swiften/Session/Session.h
index c937430..4becebf 100644
--- a/Swiften/Session/Session.h
+++ b/Swiften/Session/Session.h
@@ -5,35 +5,36 @@
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <boost/optional.hpp>
#include <boost/enable_shared_from_this.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Elements/Element.h>
#include <Swiften/Network/Connection.h>
#include <Swiften/StreamStack/ConnectionLayer.h>
#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
class ProtocolHeader;
class StreamStack;
class JID;
class Element;
class PayloadParserFactoryCollection;
class PayloadSerializerCollection;
class XMPPLayer;
class XMLParserFactory;
- class Session : public boost::enable_shared_from_this<Session> {
+ class SWIFTEN_API Session : public boost::enable_shared_from_this<Session> {
public:
enum SessionError {
ConnectionReadError,
ConnectionWriteError,
XMLError,
AuthenticationFailedError,
NoSupportedAuthMechanismsError,
UnexpectedElementError,
ResourceBindError,
diff --git a/Swiften/StreamStack/XMPPLayer.h b/Swiften/StreamStack/XMPPLayer.h
index 81f0457..f0e88aa 100644
--- a/Swiften/StreamStack/XMPPLayer.h
+++ b/Swiften/StreamStack/XMPPLayer.h
@@ -4,34 +4,35 @@
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <boost/noncopyable.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/StreamStack/HighLayer.h>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/Elements/Element.h>
#include <Swiften/Elements/StreamType.h>
#include <Swiften/Parser/XMPPParserClient.h>
namespace Swift {
class ProtocolHeader;
class XMPPParser;
class PayloadParserFactoryCollection;
class XMPPSerializer;
class PayloadSerializerCollection;
class XMLParserFactory;
class BOSHSessionStream;
- class XMPPLayer : public XMPPParserClient, public HighLayer, boost::noncopyable {
+ class SWIFTEN_API XMPPLayer : public XMPPParserClient, public HighLayer, boost::noncopyable {
friend class BOSHSessionStream;
public:
XMPPLayer(
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers,
XMLParserFactory* xmlParserFactory,
StreamType streamType);
~XMPPLayer();
diff --git a/Swiften/StringCodecs/Base64.h b/Swiften/StringCodecs/Base64.h
index 2d67971..7d5ab51 100644
--- a/Swiften/StringCodecs/Base64.h
+++ b/Swiften/StringCodecs/Base64.h
@@ -1,23 +1,24 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <vector>
-
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
- class Base64 {
+ class SWIFTEN_API Base64 {
public:
static std::string encode(const ByteArray& s);
static SafeByteArray encode(const SafeByteArray& s);
static ByteArray decode(const std::string &s);
};
}
diff --git a/Swiften/StringCodecs/Hexify.h b/Swiften/StringCodecs/Hexify.h
index c016448..3b9a751 100644
--- a/Swiften/StringCodecs/Hexify.h
+++ b/Swiften/StringCodecs/Hexify.h
@@ -1,18 +1,19 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
namespace Swift {
- class Hexify {
+ class SWIFTEN_API Hexify {
public:
static std::string hexify(unsigned char byte);
static std::string hexify(const ByteArray& data);
static ByteArray unhexify(const std::string& hexstring);
};
}
diff --git a/Swiften/StringCodecs/SHA1.h b/Swiften/StringCodecs/SHA1.h
index 9edcbb2..30e757c 100644
--- a/Swiften/StringCodecs/SHA1.h
+++ b/Swiften/StringCodecs/SHA1.h
@@ -7,23 +7,24 @@
#pragma once
#ifdef SWIFTEN_PLATFORM_WIN32
#include "SHA1_Windows.h"
#else
#include <vector>
#include <boost/cstdint.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
- class SHA1 {
+ class SWIFTEN_API SHA1 {
public:
SHA1();
SHA1& update(const std::vector<unsigned char>& data);
std::vector<unsigned char> getHash() const;
/**
* Equivalent of:
* SHA1().update(data),getHash(), but slightly more efficient and
diff --git a/Swiften/StringCodecs/SHA1_Windows.h b/Swiften/StringCodecs/SHA1_Windows.h
index a24779f..c485040 100644
--- a/Swiften/StringCodecs/SHA1_Windows.h
+++ b/Swiften/StringCodecs/SHA1_Windows.h
@@ -6,23 +6,23 @@
#pragma once
#include <vector>
#include <Windows.h>
#define SECURITY_WIN32
#include <security.h>
#include <Wincrypt.h>
-
+#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
namespace Swift {
- class SHA1 {
+ class SWIFTEN_API SHA1 {
public:
SHA1();
~SHA1();
SHA1& update(const std::vector<unsigned char>& data);
std::vector<unsigned char> getHash() const;
static ByteArray getHash(const ByteArray& data);
static ByteArray getHash(const SafeByteArray& data);
diff --git a/Swiften/TLS/CAPICertificate.h b/Swiften/TLS/CAPICertificate.h
index 5f24b7e..aebfb41 100644
--- a/Swiften/TLS/CAPICertificate.h
+++ b/Swiften/TLS/CAPICertificate.h
@@ -1,33 +1,34 @@
/*
* Copyright (c) 2012 Isode Limited, London, England.
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Base/SafeByteArray.h>
#include <Swiften/TLS/CertificateWithKey.h>
#include <Swiften/Network/Timer.h>
#define SECURITY_WIN32
#include <Windows.h>
#include <WinCrypt.h>
#include <Winscard.h>
#define SMARTCARD_EJECTION_CHECK_FREQUENCY_MILLISECONDS 1000
namespace Swift {
class TimerFactory;
- class CAPICertificate : public Swift::CertificateWithKey {
+ class SWIFTEN_API CAPICertificate : public Swift::CertificateWithKey {
public:
CAPICertificate(const std::string& capiUri, TimerFactory* timerFactory);
virtual ~CAPICertificate();
virtual bool isNull() const;
const std::string& getCertStoreName() const;
diff --git a/Swiften/TLS/CertificateTrustChecker.h b/Swiften/TLS/CertificateTrustChecker.h
index 2ba6b40..4ec0b39 100644
--- a/Swiften/TLS/CertificateTrustChecker.h
+++ b/Swiften/TLS/CertificateTrustChecker.h
@@ -1,28 +1,29 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <boost/shared_ptr.hpp>
-
#include <string>
-#include <Swiften/TLS/Certificate.h>
#include <vector>
+#include <Swiften/Base/API.h>
+#include <Swiften/TLS/Certificate.h>
+
namespace Swift {
/**
* A class to implement a check for certificate trust.
*/
- class CertificateTrustChecker {
+ class SWIFTEN_API CertificateTrustChecker {
public:
virtual ~CertificateTrustChecker();
/**
* This method is called to find out whether a certificate (chain) is
* trusted. This usually happens when a certificate's validation
* fails, to check whether to proceed with the connection or not.
*
* certificateChain contains the chain of certificates. The first certificate
diff --git a/Swiften/TLS/PlatformTLSFactories.h b/Swiften/TLS/PlatformTLSFactories.h
index 605db31..850d6f9 100644
--- a/Swiften/TLS/PlatformTLSFactories.h
+++ b/Swiften/TLS/PlatformTLSFactories.h
@@ -1,22 +1,24 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
+
namespace Swift {
class TLSContextFactory;
class CertificateFactory;
- class PlatformTLSFactories {
+ class SWIFTEN_API PlatformTLSFactories {
public:
PlatformTLSFactories();
~PlatformTLSFactories();
TLSContextFactory* getTLSContextFactory() const;
CertificateFactory* getCertificateFactory() const;
private:
TLSContextFactory* contextFactory;
diff --git a/Swiften/VCards/VCardManager.h b/Swiften/VCards/VCardManager.h
index 29fe32c..b7e3c32 100644
--- a/Swiften/VCards/VCardManager.h
+++ b/Swiften/VCards/VCardManager.h
@@ -2,30 +2,31 @@
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <set>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Elements/VCard.h>
#include <Swiften/Elements/ErrorPayload.h>
#include <Swiften/VCards/SetVCardRequest.h>
#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
class JID;
class VCardStorage;
class IQRouter;
- class VCardManager : public boost::bsignals::trackable {
+ class SWIFTEN_API VCardManager : public boost::bsignals::trackable {
public:
VCardManager(const JID& ownJID, IQRouter* iqRouter, VCardStorage* vcardStorage);
~VCardManager();
VCard::ref getVCard(const JID& jid) const;
VCard::ref getVCardAndRequestWhenNeeded(const JID& jid);
void requestVCard(const JID& jid);
void requestOwnVCard();
diff --git a/Swiften/VCards/VCardStorage.h b/Swiften/VCards/VCardStorage.h
index 977a40c..5fba915 100644
--- a/Swiften/VCards/VCardStorage.h
+++ b/Swiften/VCards/VCardStorage.h
@@ -3,24 +3,25 @@
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#pragma once
#include <string>
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/VCard.h>
namespace Swift {
class JID;
- class VCardStorage {
+ class SWIFTEN_API VCardStorage {
public:
virtual ~VCardStorage();
virtual VCard::ref getVCard(const JID& jid) const = 0;
virtual void setVCard(const JID&, VCard::ref) = 0;
virtual std::string getPhotoHash(const JID&) const;
};
}