Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / skype / skypeprotocol.h
blob09253ac8a144d3bd72d3997f8c0d41eaf6745abe
1 /* This file is part of the KDE project
2 Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
3 Copyright (C) 2008-2009 Pali Rohár <pali.rohar@gmail.com>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
19 #ifndef SKYPEPROTOCOL_H
20 #define SKYPEPROTOCOL_H
22 #include "kopeteprotocol.h"
23 #include "kopeteproperty.h"
24 #include <qstring.h>
26 class SkypeAccount;
27 class SkypeProtocolPrivate;
29 namespace Kopete {
30 class OnlineStatus;
33 #define LAUNCH_ALLWAYS 0
34 #define LAUNCH_NEEDED 1
35 #define LAUNCH_NEVER 2
37 /**
38 * @author Michal Vaner
39 * @author Pali Rohár
40 * @short Protocol to use external skype
41 * This protocol is only binding for exteral skype program. The reason to write this was I did not like the skype as it was.
43 class SkypeProtocol : public Kopete::Protocol
45 Q_OBJECT
46 private:
47 SkypeProtocolPrivate *d;
48 public:
49 const Kopete::OnlineStatus Offline;
50 const Kopete::OnlineStatus Online;
51 const Kopete::OnlineStatus SkypeMe;
52 const Kopete::OnlineStatus Away;
53 const Kopete::OnlineStatus NotAvailable;
54 const Kopete::OnlineStatus DoNotDisturb;
55 const Kopete::OnlineStatus Invisible;
56 const Kopete::OnlineStatus Connecting;
57 const Kopete::OnlineStatus NotInList;
58 const Kopete::OnlineStatus NoAuth;
59 const Kopete::OnlineStatus Phone;
60 // contact properties
61 /* const Kopete::ContactPropertyTmpl propAwayMessage;
62 const Kopete::ContactPropertyTmpl propFirstName;
63 const Kopete::ContactPropertyTmpl propLastName;*/
64 const Kopete::PropertyTmpl propFullName;
65 // const Kopete::ContactPropertyTmpl propEmailAddress;
66 const Kopete::PropertyTmpl propPrivatePhone;
67 const Kopete::PropertyTmpl propPrivateMobilePhone;
68 const Kopete::PropertyTmpl propWorkPhone;
69 // const Kopete::ContactPropertyTmpl propWorkMobilePhone;
70 const Kopete::PropertyTmpl propLastSeen;
71 /**
72 * Constructor. This is called automatically on library load.
73 * @param parent Parent of the object.
74 * @param name Name of the object.
75 * @param args Arguments to allow creation by KGenericFactory.
76 * @see KGenericFactory
78 SkypeProtocol(QObject *parent, const QVariantList &);
79 /**
80 * Destructor.
82 ~SkypeProtocol();
83 /**
84 * Reimplementation of the methot that creates a new skype account.
85 * @param accountID ID of the account.
86 * @return At the moment NULL, but it will change soon.
88 virtual Kopete::Account *createNewAccount(const QString &accountID);
89 /**
90 * Reimplementation of the method that creates widget for adding contact to skype account.
91 * @param parent Parent widget. It will be showed inside.
92 * @param account Account to witch it aplies.
93 * @return At the moment NULL, but it will change soon.
95 virtual AddContactPage *createAddContactWidget(QWidget *parent, Kopete::Account *account);
96 /**
97 * Reimplementation of the method that creates widget for editing/creation of the skype account.
98 * @param account Account to what it applies. (0 means we create a new one)
99 * @param parent Parent widget. It will be showed inside it.
100 * @return NULL at the moment, but it will change soon.
102 virtual KopeteEditAccountWidget* createEditAccountWidget(Kopete::Account *account, QWidget *parent);
104 * Skype plugin allows only one skype account at once. This answers weather one exists or not.
105 * @return true if some account exists and false if not
107 bool hasAccount() const;
109 * Tells skype to remember this account
110 * @param account Pointer to the instance of the account
112 void registerAccount(SkypeAccount *account);
114 * Removes account is some exists
116 void unregisterAccount();
118 * Creates a contact from provided data
119 * @param metaContact Metacontact to add the contact into
120 * @param serializedData Some data to store the contact
121 * @param addressBookData Data inside the address book
122 * @return Brand new loaded contact
124 virtual Kopete::Contact *deserializeContact(Kopete::MetaContact *metaContact, const QMap<QString, QString> &serializedData, const QMap<QString, QString> &addressBokkData);
126 * Access the instance of this protocol
128 static SkypeProtocol *protocol();
129 public slots:
131 * This enables or disables the "Call by skype" action depending on weather a contact(s) are selected and have skype contacts
133 void updateCallActionStatus();
135 * This calls all selected skype contacts
137 void callContacts();
138 protected:
139 static SkypeProtocol *s_protocol;
142 #endif