summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/sms/smsaccount.h
blob: db7d0f9a37c3e5910fd2f8df06f901529d95d124 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*  *************************************************************************
    *   copyright: (C) 2003 Richard Lärkäng <nouseforaname@home.se>         *
    *   copyright: (C) 2003 Gav Wood <gav@kde.org>                          *
    *************************************************************************
*/

/*  *************************************************************************
    *                                                                       *
    * 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.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef SMSACCOUNT_H
#define SMSACCOUNT_H

#include "kopeteaccount.h"

class KActionMenu;
class SMSProtocol;
class SMSContact;
class SMSService;
class KProcess;

enum SMSMsgAction { ACT_ASK = 0, ACT_CANCEL, ACT_SPLIT };

class SMSAccount : public Kopete::Account
{
	Q_OBJECT
  TQ_OBJECT

public:
	SMSAccount( SMSProtocol *parent, const TQString &accountID, const char *name = 0L );
	~SMSAccount();

	virtual KActionMenu* actionMenu();			// Per-protocol actions for the systray and the status bar

	virtual void setAway( bool away, const TQString & );

	void translateNumber(TQString &theNumber);

	/**
	 * Checks to see if the message should be split or not, in case it is too long.
	 *
	 * Only ever call in case of message being too long - may result in user interaction.
	 */
	const bool splitNowMsgTooLong(int msgLength);

	SMSService* service();

public slots:
	void loadConfig();
	void setOnlineStatus( const Kopete::OnlineStatus& status , const TQString &reason = TQString());

public slots:
	virtual void connect(const Kopete::OnlineStatus& initial= Kopete::OnlineStatus());
	virtual void disconnect();
	virtual void slotSendMessage(Kopete::Message &msg);

protected slots:
	virtual void slotSendingSuccess(const Kopete::Message &msg);
	virtual void slotSendingFailure(const Kopete::Message &msg, const TQString &error);
	virtual void slotConnected();
	virtual void slotDisconnected();
	

protected:
	bool createContact(const TQString &contactId,  Kopete::MetaContact *parentContact);

private:
	bool theSubEnable;
	TQString theSubCode;
	SMSMsgAction theLongMsgAction;
	SMSService* theService;
};

#endif