28 lines
941 B
C++
28 lines
941 B
C++
#ifndef MIDDLEMAN_H
|
|
#define MIDDLEMAN_H
|
|
|
|
#include <Window.h>
|
|
#include <gloox/connectionlistener.h>
|
|
#include <gloox/gloox.h>
|
|
#include <gloox/presence.h>
|
|
#include <gloox/presencehandler.h>
|
|
#include <gloox/client.h>
|
|
#define TITLE "Connecting..."
|
|
|
|
// Middleman is the "middle" window that sets up the XMPP connection and manages all windows that require one.
|
|
// Windows are designed to be opened up in a "flow"
|
|
// Main (login) window -> Middleman <-> Contacts List <-> Chatbox
|
|
// TODO: add client class to mm class for windows to send message
|
|
|
|
class Middleman : public BWindow, gloox::PresenceHandler, gloox::ConnectionListener {
|
|
public:
|
|
Middleman(const char* jid, const char* password);
|
|
virtual void handlePresence(const gloox::Presence &presence);
|
|
virtual bool onTLSConnect(const gloox::CertInfo &info);
|
|
virtual void onConnect();
|
|
virtual void onDisconnect(gloox::ConnectionError err);
|
|
private:
|
|
gloox::Client *client;
|
|
};
|
|
|
|
#endif
|