1// -*- Mode: c++-mode; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 2; -*-
2//
3// Copyright (C) 2003 Grzegorz Jaskiewicz <gj at pointblue.com.pl>
4// Copyright (C) 2002-2003 Zack Rusin <zack@kde.org>
5//
6// gaduprotocol.cpp
7//
8// This program is free software; you can redistribute it and/or
9// modify it under the terms of the GNU General Public License
10// as published by the Free Software Foundation; either version 2
11// of the License, or (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21// 02110-1301, USA.
22
23#ifndef GADUPROTOCOL_H
24#define GADUPROTOCOL_H
25
26#include <qmap.h>
27
28#include "kopeteonlinestatus.h"
29#include "kopeteonlinestatusmanager.h"
30#include "kopeteprotocol.h"
31#include "kopeteproperty.h"
32
33#include "gaducommands.h"
34
35class KAction;
36
37class QWidget;
38class QString;
39
40namespace Kopete { class Contact; }
41namespace Kopete { class MetaContact; }
42
43class GaduAccount;
44class GaduPreferences;
45
46#define GG_STATUS_CONNECTING 0x0100
47
48class GaduProtocol : public Kopete::Protocol
49{
50 Q_OBJECT
51
52public:
53 GaduProtocol( QObject* parent, const QVariantList& str);
54 ~GaduProtocol();
55
56 static GaduProtocol *protocol();
57
58 // Plugin reimplementation
59 // {
60 AddContactPage* createAddContactWidget( QWidget* parent, Kopete::Account* account );
61 Kopete::Account* createNewAccount( const QString& accountId );
62 KopeteEditAccountWidget *createEditAccountWidget( Kopete::Account* account, QWidget* parent );
63 bool canSendOffline() const { return true; }
64
65 virtual Kopete::Contact *deserializeContact( Kopete::MetaContact* metaContact,
66 const QMap<QString, QString>& serializedData,
67 const QMap<QString, QString>& addressBookData );
68 // }
69 //!Plugin reimplementation
70
71 Kopete::OnlineStatus convertStatus( uint ) const;
72 bool statusWithDescription( uint status );
73
74 uint statusToWithDescription( Kopete::OnlineStatus status );
75 uint statusToWithoutDescription( Kopete::OnlineStatus status );
76
77 const Kopete::PropertyTmpl propFirstName;
78 const Kopete::PropertyTmpl propLastName;
79 const Kopete::PropertyTmpl propEmail;
80 const Kopete::PropertyTmpl propPhoneNr;
81 //const Kopete::PropertyTmpl propIgnore;
82
83private slots:
84 void settingsChanged();
85
86private:
87 static GaduProtocol* protocolStatic_;
88 GaduAccount* defaultAccount_;
89 //GaduPreferences* prefs_;
90
91 const Kopete::OnlineStatus gaduStatusBlocked_;
92 const Kopete::OnlineStatus gaduStatusOffline_;
93 const Kopete::OnlineStatus gaduStatusOfflineDescr_;
94 const Kopete::OnlineStatus gaduStatusBusy_;
95 const Kopete::OnlineStatus gaduStatusBusyDescr_;
96 const Kopete::OnlineStatus gaduStatusInvisible_;
97 const Kopete::OnlineStatus gaduStatusInvisibleDescr_;
98 const Kopete::OnlineStatus gaduStatusAvail_;
99 const Kopete::OnlineStatus gaduStatusAvailDescr_;
100 const Kopete::OnlineStatus gaduConnecting_;
101
102};
103
104
105#endif
106