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
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 *************************************************************************
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. *
21 *************************************************************************
27 #include <kopeteprotocol.h>
28 #include <kopeteproperty.h>
29 #include <kopeteonlinestatus.h>
32 * Encapsulates the generic actions associated with this protocol
33 * @author Will Stephenson
35 class GroupWiseProtocol
: public Kopete::Protocol
39 GroupWiseProtocol(QObject
*parent
, const QVariantList
&args
);
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
51 * Generate the widget needed to add GroupWiseContacts
53 virtual AddContactPage
* createAddContactWidget( QWidget
*parent
, Kopete::Account
*account
);
55 * Generate the widget needed to add/edit accounts for this protocol
57 virtual KopeteEditAccountWidget
* createEditAccountWidget( Kopete::Account
*account
, QWidget
*parent
);
59 * Generate a GroupWiseAccount
61 virtual Kopete::Account
* createNewAccount( const QString
&accountId
);
63 * Access the instance of this protocol
65 static GroupWiseProtocol
*protocol();
67 * Transform a GroupWise internal status into a Kopete::OnlineStatus
69 Kopete::OnlineStatus
gwStatusToKOS( const int gwInternal
);
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
);
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
);
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
;
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
;
109 static GroupWiseProtocol
*s_protocol
;
112 #endif // GWPROTOCOL_H