diff options
| author | Edwin Mons <edwin.mons@isode.com> | 2014-05-23 09:01:23 (GMT) |
|---|---|---|
| committer | Swift Review <review@swift.im> | 2014-06-22 12:35:26 (GMT) |
| commit | bd7f30aec53fc776be678577dbe4f9afec5898a6 (patch) | |
| tree | 66afad4382dc16f7405a856dd0b5abc38db51653 /Swiften/Component/CoreComponent.h | |
| parent | 1eb14b6bde145ca54ac9b981df339fb8c56d3930 (diff) | |
| download | swift-contrib-bd7f30aec53fc776be678577dbe4f9afec5898a6.zip swift-contrib-bd7f30aec53fc776be678577dbe4f9afec5898a6.tar.bz2 | |
Sluift component support
Change-Id: Ib8af01c04c866e198c04d35236dea4da464c9116
Diffstat (limited to 'Swiften/Component/CoreComponent.h')
| -rw-r--r-- | Swiften/Component/CoreComponent.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Swiften/Component/CoreComponent.h b/Swiften/Component/CoreComponent.h index 63b68f6..e9fdd88 100644 --- a/Swiften/Component/CoreComponent.h +++ b/Swiften/Component/CoreComponent.h @@ -19,70 +19,71 @@ #include <Swiften/JID/JID.h> #include <string> #include <Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h> #include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h> #include <Swiften/Component/ComponentSessionStanzaChannel.h> #include <Swiften/Entity/Entity.h> #include <Swiften/Base/SafeByteArray.h> namespace Swift { class EventLoop; class IQRouter; class NetworkFactories; class ComponentSession; class BasicSessionStream; /** * 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 SWIFTEN_API CoreComponent : public Entity { public: CoreComponent(const JID& jid, const std::string& secret, NetworkFactories* networkFactories); ~CoreComponent(); void connect(const std::string& host, int port); void disconnect(); void sendMessage(boost::shared_ptr<Message>); void sendPresence(boost::shared_ptr<Presence>); + void sendData(const std::string& data); IQRouter* getIQRouter() const { return iqRouter_; } StanzaChannel* getStanzaChannel() const { return stanzaChannel_; } bool isAvailable() const { return stanzaChannel_->isAvailable(); } /** * Returns the JID of the component */ const JID& getJID() const { return jid_; } public: boost::signal<void (const ComponentError&)> onError; boost::signal<void ()> onConnected; boost::signal<void (const SafeByteArray&)> onDataRead; boost::signal<void (const SafeByteArray&)> onDataWritten; boost::signal<void (boost::shared_ptr<Message>)> onMessageReceived; boost::signal<void (boost::shared_ptr<Presence>) > onPresenceReceived; private: void handleConnectorFinished(boost::shared_ptr<Connection>); void handleStanzaChannelAvailableChanged(bool available); void handleSessionFinished(boost::shared_ptr<Error>); void handleDataRead(const SafeByteArray&); void handleDataWritten(const SafeByteArray&); |
Swift