Port things from MSN to WLM plugin:
[kdenetwork.git] / kopete / protocols / groupwise / gwprotocol.h
blobd8b07dc244bc11c9a92085c9a4c17b9b9d1399f5
1 /*
2 gwprotocol.h - Kopete GroupWise Protocol
4 Copyright (c) 2006,2007 Novell, Inc http://www.opensuse.org
5 Copyright (c) 2004 SUSE Linux AG http://www.suse.com
7 Based on Testbed
8 Copyright (c) 2003-2007 by Will Stephenson <wstephenson@kde.org>
9 rtfizeTest from nm_rtfize_text, from Gaim src/protocols/novell/nmuser.c
10 Copyright (c) 2004 Novell, Inc. All Rights Reserved
12 Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
14 *************************************************************************
15 * *
16 * This library is free software; you can redistribute it and/or *
17 * modify it under the terms of the GNU General Public *
18 * License as published by the Free Software Foundation; either *
19 * version 2 of the License, or (at your option) any later version. *
20 * *
21 *************************************************************************
24 #ifndef GWPROTOCOL_H
25 #define GWPROTOCOL_H
27 #include <kopeteprotocol.h>
28 #include <kopeteproperty.h>
29 #include <kopeteonlinestatus.h>
31 /**
32 * Encapsulates the generic actions associated with this protocol
33 * @author Will Stephenson
35 class GroupWiseProtocol : public Kopete::Protocol
37 Q_OBJECT
38 public:
39 GroupWiseProtocol(QObject *parent, const QVariantList &args);
40 ~GroupWiseProtocol();
41 /**
42 * Convert the serialised data back into a GroupWiseContact and add this
43 * to its Kopete::MetaContact
45 virtual Kopete::Contact *deserializeContact(
46 Kopete::MetaContact *metaContact,
47 const QMap< QString, QString > & serializedData,
48 const QMap< QString, QString > & addressBookData
50 /**
51 * Generate the widget needed to add GroupWiseContacts
53 virtual AddContactPage * createAddContactWidget( QWidget *parent, Kopete::Account *account );
54 /**
55 * Generate the widget needed to add/edit accounts for this protocol
57 virtual KopeteEditAccountWidget * createEditAccountWidget( Kopete::Account *account, QWidget *parent );
58 /**
59 * Generate a GroupWiseAccount
61 virtual Kopete::Account * createNewAccount( const QString &accountId );
62 /**
63 * Access the instance of this protocol
65 static GroupWiseProtocol *protocol();
66 /**
67 * Transform a GroupWise internal status into a Kopete::OnlineStatus
69 Kopete::OnlineStatus gwStatusToKOS( const int gwInternal );
70 /**
71 * Wrap unformatted text in RTF formatting so that other GroupWise clients will display it
72 * @param plain unformatted text
73 * @return RTF text (in UCS-4 encoding)
75 QString rtfizeText( const QString & plain );
76 /**
77 * Convert full DNs to dotted-untyped format
78 * Assumes the DN is normalised - comma separated, no spaces between elements
79 * eg cn=wstephenson,o=suse becomes wstephenson.suse
81 static QString dnToDotted( const QString & dn );
82 /**
83 * Online statuses used for contacts' presence
85 const Kopete::OnlineStatus groupwiseOffline;
86 const Kopete::OnlineStatus groupwiseAvailable;
87 const Kopete::OnlineStatus groupwiseBusy;
88 const Kopete::OnlineStatus groupwiseAway;
89 const Kopete::OnlineStatus groupwiseAwayIdle;
90 const Kopete::OnlineStatus groupwiseAppearOffline;
91 const Kopete::OnlineStatus groupwiseUnknown;
92 const Kopete::OnlineStatus groupwiseInvalid;
93 const Kopete::OnlineStatus groupwiseConnecting;
95 /**
96 * Contact properties
98 const Kopete::PropertyTmpl propGivenName;
99 const Kopete::PropertyTmpl propLastName;
100 const Kopete::PropertyTmpl propFullName;
101 const Kopete::PropertyTmpl propAutoReply;
102 const Kopete::PropertyTmpl propCN;
103 const Kopete::PropertyTmpl propPhoneWork;
104 const Kopete::PropertyTmpl propPhoneMobile;
105 const Kopete::PropertyTmpl propEmail;
108 protected:
109 static GroupWiseProtocol *s_protocol;
112 #endif // GWPROTOCOL_H