diff --git a/include/transport/Frontend.h b/include/transport/Frontend.h new file mode 100644 index 0000000000000000000000000000000000000000..72d099a488ae2762be4ed556f227653360d34ca4 --- /dev/null +++ b/include/transport/Frontend.h @@ -0,0 +1,95 @@ +/** + * XMPP - libpurple transport + * + * Copyright (C) 2009, Jan Kaluza + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + */ + +#pragma once + +#include +#include +#include +#include +#include "Swiften/Elements/RosterPayload.h" +#include "Swiften/Elements/VCard.h" +#include "Swiften/Elements/Message.h" +#include "Swiften/Elements/IQ.h" +#include "Swiften/Elements/DiscoInfo.h" +#include "Swiften/Elements/Presence.h" + +#include + +namespace Transport { + +class Config; +class UserRegistry; +class Component; +class User; +class Buddy; +class RosterManager; +class UserManager; +class StorageBackend; + +struct UserInfo; + +class Frontend { + public: + Frontend() {} + + virtual ~Frontend() {} + + virtual void init(Component *component, Swift::EventLoop *loop, Swift::NetworkFactories *factories, Config *config, UserRegistry *userRegistry) = 0; + + virtual void connectToServer() = 0; + + virtual void disconnectFromServer() = 0; + + virtual void sendPresence(Swift::Presence::ref presence) = 0; + + virtual void sendVCard(Swift::VCard::ref vcard, Swift::JID to) = 0; + + virtual void sendRosterRequest(Swift::RosterPayload::ref, Swift::JID to) = 0; + + virtual void sendMessage(boost::shared_ptr message) = 0; + + virtual void sendIQ(boost::shared_ptr) = 0; + + virtual boost::shared_ptr sendCapabilitiesRequest(Swift::JID to) = 0; + + virtual void reconnectUser(const std::string &user) = 0; + + virtual RosterManager *createRosterManager(User *user, Component *component) = 0; + + virtual User *createUser(const Swift::JID &jid, UserInfo &userInfo, Component *component, UserManager *userManager) = 0; + + virtual UserManager *createUserManager(Component *component, UserRegistry *userRegistry, StorageBackend *storageBackend = NULL) = 0; + + virtual void clearRoomList() = 0; + virtual void addRoomToRoomList(const std::string &handle, const std::string &name) = 0; + + boost::signal onVCardRequired; + boost::signal vcard)> onVCardUpdated; + boost::signal onBuddyUpdated; + boost::signal onBuddyRemoved; + boost::signal onBuddyAdded; + boost::signal onMessageReceived; + boost::signal onAvailableChanged; + boost::signal) > onPresenceReceived; + boost::signal info)> onCapabilitiesReceived; +}; + +}