Chat-O-Matic/protocols/aim/AIM.h

75 lines
1.8 KiB
C
Raw Normal View History

/*
* Copyright 2010, Alexander Botero-Lowry. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _AIM_H
#define _AIM_H
#include <List.h>
#include <Messenger.h>
#include <String.h>
#include <Notification.h>
#include "CayaProtocol.h"
#include "CayaConstants.h"
#include "imcomm.h"
class AIMProtocol : public CayaProtocol {
public:
AIMProtocol();
virtual ~AIMProtocol();
virtual status_t Init(CayaProtocolMessengerInterface* messenger);
virtual status_t Shutdown();
virtual status_t Process(BMessage*);
virtual const char* Signature() const;
virtual const char* FriendlySignature() const;
virtual status_t UpdateSettings(BMessage*);
virtual uint32 GetEncoding();
virtual CayaProtocolMessengerInterface*
MessengerInterface() const;
2010-07-10 14:28:29 -05:00
virtual uint32 Version() const;
static int32 WaitForData(void*);
static void GotMessage(void*, char*, int, char*);
static void BuddyOnline(void*, char*);
static void BuddyOffline(void*, char*);
static void BuddyAway(void*, char*);
static void BuddyBack(void*, char*);
static void BuddyAwayMsg(void*, char*, char*);
static void BuddyIdle(void*, char*, long);
static void BuddyProfile(void*, char*, char*);
protected:
status_t A_LogOn();
status_t LogOff();
void UnsupportedOperation();
static char* strip_html(const char* message);
private:
BString fUsername;
BString fPassword;
bool fOnline;
thread_id fIMCommThread;
void* fIMCommHandle;
void _NotifyProgress(const char* title,
const char* message, float progress);
void _Notify(notification_type type,
const char* title, const char* message);
void _SendMessage(BMessage* msg);
};
extern const char* kProtocolSignature;
extern const char* kProtocolName;
#endif // _AIM_H