[prev in list] [next in list] [prev in thread] [next in thread]
List: kopete-devel
Subject: Re: [kopete-devel] Skype plugin for kopete kde4
From: Pali Rohár <pali.rohar () gmail ! com>
Date: 2008-10-09 10:44:01
Message-ID: 48EDE071.40805 () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
Hello,
Now, I'm sending skype protocol (patch) on svn kdenetwork.
--
Pali Rohár
pali.rohar@gmail.com
Olivier Goffart wrote / napísal(a):
> Le mercredi 8 octobre 2008, Pali Rohár a écrit :
>
>> [...]
>> Where I can send my ported skype protocol source (I dont have svn
>> account)? Maybe someone found bug here and fix it.
>>
>
> Hi,
> If you are interested, you can get a svn account.
>
> Read http://techbase.kde.org/Contribute
> and http://techbase.kde.org/Contribute/Get_a_SVN_Account
>
>
>
["skype.patch" (text/x-patch)]
Index: kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp
===================================================================
--- kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp (revision 869463)
+++ kopete/protocols/winpopup/libwinpopup/libwinpopup.cpp (working copy)
@@ -323,7 +323,7 @@
QProcess *sender = new QProcess(this);
QStringList args;
args << "-M" << Destination << "-N" << "-";
- sender->start(smbClientBin);
+ sender->start(smbClientBin, args);
sender->write(Body.toLocal8Bit());
sender->closeWriteChannel();
}
Index: kopete/protocols/skype/skypechatsession.cpp
===================================================================
--- kopete/protocols/skype/skypechatsession.cpp (revision 0)
+++ kopete/protocols/skype/skypechatsession.cpp (revision 0)
@@ -0,0 +1,242 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include "skypechatsession.h"
+#include "skypeaccount.h"
+#include "skypeprotocol.h"
+#include "skypecontact.h"
+
+#include <kdebug.h>
+#include <kopetechatsessionmanager.h>
+#include <kopetemetacontact.h>
+#include <qstring.h>
+#include <kaction.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+
+static Kopete::MetaContact *dummyContacts = new Kopete::MetaContact();
+
+class ChatDummyContact : public Kopete::Contact {
+ public:
+ ChatDummyContact(SkypeAccount *account, const QString &name) : \
Kopete::Contact(account, name, dummyContacts) {}; + virtual Kopete::ChatSession \
*manager (CanCreateFlags canCreate) {return 0L;}; +};
+
+class SkypeChatSessionPrivate {
+ private:
+ ///Dummy contact representing this chat
+ Kopete::Contact *dummyContact;
+ public:
+ ///Referenco to the protocol
+ SkypeProtocol *protocol;
+ ///Reference to the account
+ SkypeAccount *account;
+ ///Am I connected to the messageSent signal?
+ bool connectedSent;
+ ///ID of this chat session
+ QString chatId;
+ /**
+ * Constructor
+ * @param _protocol Reference to the Skype protocol
+ * @param _account Reference to the account this chat belongs to
+ */
+ SkypeChatSessionPrivate(SkypeProtocol *_protocol, SkypeAccount *_account) {
+ kDebug() << k_funcinfo << endl;//some debug info
+ //save given values
+ account = _account;
+ protocol = _protocol;
+
+ connectedSent = false;
+ chatId = "";
+ dummyContact = 0L;
+ };
+ ///Is it multi-user chat?
+ bool isMulti;
+ ///Please give me a contact that stands for the whole chat so I can send it to it
+ Kopete::Contact *getDummyContact() {
+ if (dummyContact)
+ return dummyContact;
+ else {
+ return dummyContact = new ChatDummyContact(account, chatId);
+ }
+ };
+ ///The action to call the user(s)
+ KAction *callAction;
+ ///The contact if any (and one)
+ SkypeContact *contact;
+};
+
+static Kopete::ContactPtrList constructList(SkypeContact *contact) {
+ Kopete::ContactPtrList list;//create the contact
+ list.append(contact);//add there the contact
+
+ return list;//and return the list
+}
+
+SkypeChatSession::SkypeChatSession(SkypeAccount *account, SkypeContact *contact) :
+ Kopete::ChatSession(account->myself(), constructList(contact), \
account->protocol(), Kopete::ChatSession::Form()) { + kDebug() << k_funcinfo << \
endl;//some debug info +
+ //TODO: Port to kde4
+ //setInstance(KGenericFactory<SkypeProtocol>::instance());
+
+ //create the D-pointer
+ d = new SkypeChatSessionPrivate(account->protocol(), account);
+ Kopete::ChatSessionManager::self()->registerChatSession( this );
+ connect(this, SIGNAL(messageSent(Kopete::Message&, Kopete::ChatSession*)), this, \
SLOT(message(Kopete::Message& )));//this will send the messages from this user going \
out + account->prepareChatSession(this);
+ d->isMulti = false;
+
+ //TODO: Port to kde4
+ //d->callAction = new KAction(i18n("Call"), QString::fromLatin1("call"), 0, this, \
SLOT(callChatSession()), actionCollection(), "callSkypeContactFromChat"); \
+ d->callAction = new KAction(this); + d->callAction->setText(i18n("Call"));
+ d->callAction->setIcon(KIcon("call"));
+ connect(d->callAction, SIGNAL(triggered()), SLOT(callChatSession()));
+
+ connect(contact, SIGNAL(setCallPossible(bool )), d->callAction, \
SLOT(setEnabled(bool ))); + connect(this, SIGNAL(becameMultiChat(const QString&, \
SkypeChatSession* )), this, SLOT(disallowCall())); +
+ d->contact = contact;
+
+ setMayInvite(true);//It is possible to invite people to chat with Skype
+ setXMLFile("skypechatui.rc");
+}
+
+SkypeChatSession::SkypeChatSession(SkypeAccount *account, const QString &session, \
const Kopete::ContactPtrList &users) : + Kopete::ChatSession(account->myself(), \
users, account->protocol(), Kopete::ChatSession::Form()) { + kDebug() << k_funcinfo \
<< endl;//some debug info +
+ //TODO: Port to kde4
+ //setInstance(KGenericFactory<SkypeProtocol>::instance());
+
+ d = new SkypeChatSessionPrivate(account->protocol(), account);
+ Kopete::ChatSessionManager::self()->registerChatSession(this);
+ connect(this, SIGNAL(messageSent(Kopete::Message&, Kopete::ChatSession*)), this, \
SLOT(message(Kopete::Message& ))); + account->prepareChatSession(this);
+ d->isMulti = true;
+ d->chatId = session;
+ emit updateChatId("", session, this);
+
+
+ //TODO: Port to kde4
+ //d->callAction = new KAction(i18n("Call"), QString::fromLatin1("call"), 0, this, \
SLOT(callChatSession()), actionCollection(), "callSkypeContactFromChat"); +
+ d->callAction = new KAction(this);
+ d->callAction->setText(i18n("Call"));
+ d->callAction->setIcon(KIcon("call"));
+ connect(d->callAction, SIGNAL(triggered()), SLOT(callChatSession()));
+
+ disallowCall();//TODO I hope it will not be needed in future
+
+ setMayInvite(true);//It is possible to invite people to chat with Skype
+ setXMLFile("skypechatui.rc");
+}
+
+SkypeChatSession::~SkypeChatSession() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->account->leaveOnExit() && (d->isMulti))
+ emit leaveChat(d->chatId);
+ emit updateChatId(d->chatId, "", this);
+ delete d;//remove the D pointer
+}
+
+void SkypeChatSession::message(Kopete::Message &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->account->registerLastSession(this);
+ d->account->sendMessage(message, (d->isMulti) ? (d->chatId) : "");//send it
+ messageSucceeded();
+}
+
+void SkypeChatSession::setTopic(const QString &chat, const QString &topic) {
+ ///TODO This function
+}
+
+void SkypeChatSession::joinUser(const QString &chat, const QString &userId) {
+ kDebug() << k_funcinfo << "Chat: " << chat << endl;//some debug info
+
+ if (chat == d->chatId) {
+ addContact(d->account->getContact(userId));
+ d->isMulti = true;
+ emit becameMultiChat(d->chatId, this);
+ }
+}
+
+void SkypeChatSession::leftUser(const QString &chat, const QString &userId, const \
QString &reason) { + kDebug() << "User: " << userId<< k_funcinfo << endl;//some debug \
info +
+ if (chat == d->chatId) {
+ removeContact(d->account->getContact(userId), reason);
+ }
+}
+
+void SkypeChatSession::setChatId(const QString &chatId) {
+ kDebug() << k_funcinfo << "ID: " << chatId << endl;//some debug info
+
+ if (d->chatId != chatId) {
+ emit updateChatId(d->chatId, chatId, this);
+ d->chatId = chatId;
+ emit wantTopic(chatId);
+ }
+}
+
+void SkypeChatSession::sentMessage(const QList<Kopete::Contact*> *recv, const \
QString &body) { + Kopete::Message *mes;
+ if (recv->count() == 1) {
+ mes = new Kopete::Message(d->account->myself(), *recv->begin());
+ mes->setDirection(Kopete::Message::Outbound);
+ mes->setPlainBody(body);
+ } else {
+ mes = new Kopete::Message(d->account->myself(), d->account->myself());
+ mes->setDirection(Kopete::Message::Outbound);
+ mes->setPlainBody(body);
+ }
+ mes = new Kopete::Message(d->account->myself(), *recv);
+ mes->setDirection(Kopete::Message::Outbound);
+ mes->setPlainBody(body);
+ appendMessage(*mes);
+ delete mes;
+}
+
+void SkypeChatSession::disallowCall() {
+ d->callAction->setEnabled(false);
+
+ if (d->contact) {
+ disconnect(d->contact, SIGNAL(setCallPossible(bool )), d->callAction, \
SLOT(setEnabled(bool ))); + d->contact = 0L;
+ }
+}
+
+void SkypeChatSession::callChatSession() {
+ if (d->contact)///@todo find a better way to do it later to allow multiple people \
to call + d->contact->call();
+}
+
+void SkypeChatSession::inviteContact(const QString &contactId) {
+ if (d->chatId.isEmpty()) {
+ d->chatId = d->account->createChat(d->contact->contactId());
+ emit updateChatId("", d->chatId, this);
+ }
+
+ emit inviteUserToChat(d->chatId, contactId);
+}
+
+#include "skypechatsession.moc"
Index: kopete/protocols/skype/skypedetails.cpp
===================================================================
--- kopete/protocols/skype/skypedetails.cpp (revision 0)
+++ kopete/protocols/skype/skypedetails.cpp (revision 0)
@@ -0,0 +1,91 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include "skypedetails.h"
+#include "skypeaccount.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+
+SkypeDetails::SkypeDetails() : QDialog() {
+//SkypeDetails::SkypeDetails() : Ui::SkypeDetailsBase() {
+ kDebug() << k_funcinfo << endl;
+}
+
+
+SkypeDetails::~SkypeDetails() {
+ kDebug() << k_funcinfo << endl;
+}
+
+void SkypeDetails::closeEvent(QCloseEvent *) {
+ kDebug() << k_funcinfo << endl;
+ deleteLater();
+}
+
+void SkypeDetails::changeAuthor(int item) {
+ kDebug() << k_funcinfo << endl;
+ switch (item) {
+ case 0:
+ account->authorizeUser(idEdit->text());
+ break;
+ case 1:
+ account->disAuthorUser(idEdit->text());
+ break;
+ case 2:
+ account->blockUser(idEdit->text());
+ break;
+ }
+}
+
+SkypeDetails &SkypeDetails::setNames(const QString &id, const QString &nick, const \
QString &name) { + //TODO: Port to kde4
+ //setCaption(i18n("Details for User %1").arg(id));
+ idEdit->setText(id);
+ nickEdit->setText(nick);
+ nameEdit->setText(name);
+ return *this;
+}
+
+SkypeDetails &SkypeDetails::setPhones(const QString &priv, const QString &mobile, \
const QString &work) { + privatePhoneEdit->setText(priv);
+ mobilePhoneEdit->setText(mobile);
+ workPhoneEdit->setText(work);
+ return *this;
+}
+
+SkypeDetails &SkypeDetails::setHomepage(const QString &homepage) {
+ homepageEdit->setText(homepage);
+ return *this;
+}
+
+SkypeDetails &SkypeDetails::setAuthor(int author, SkypeAccount *account) {
+ //TODO: Port ot kde4
+ //authorCombo->setCurrentItem(author);
+ this->account = account;
+ return *this;
+}
+
+SkypeDetails &SkypeDetails::setSex(const QString &sex) {
+ sexEdit->setText(sex);
+ return *this;
+}
+
+#include "skypedetails.moc"
Index: kopete/protocols/skype/libskype/skype.h
===================================================================
--- kopete/protocols/skype/libskype/skype.h (revision 0)
+++ kopete/protocols/skype/libskype/skype.h (revision 0)
@@ -0,0 +1,466 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPE_H
+#define SKYPE_H
+
+#include <qobject.h>
+
+class SkypePrivate;
+class SkypeAccount;
+
+/**
+ * This class is internal backend for skype. It provides slots for such things like \
"send a IM" and so + * @author Kopete Developers
+ */
+class Skype : public QObject
+{
+ Q_OBJECT
+ private:
+ ///The d pointer for private things
+ SkypePrivate *d;
+ /**
+ * Will try to hitchhike a message. It will hitchhike it, show it in the proper \
chat session and so on, but just when it is enabled by hitchhike mode and will maker \
it as read if enabled + * @param messageId ID of the message to hitchHike
+ */
+ void hitchHike(const QString &messageId);
+ private slots:
+ /**
+ * Adds new message do be sent to skype (normaly is sent imediatelly).
+ * If there is no connection to skype, it is created before it is sent.
+ * @param message Message to send to skype
+ * @param deleteQueue If this is true, all message waiting to be sent are deleted \
and only this one stays in the queue + */
+ void queueSkypeMessage(const QString &message, bool deleteQueue);
+ /**
+ * Listens for closed skype connection
+ */
+ void closed(int reason);
+ /**
+ * Listens for finishing the connecting attempt and sending the queue if it was \
successful + * @param error - Did it work or was there some error?
+ * @param protocolVer - Version of protocol used by this connection
+ */
+ void connectionDone(int error, int protocolVer);
+ /**
+ * This one showes an error message
+ * @param message What to write on the dialog box
+ */
+ void error(const QString &message);
+ /**
+ * This one scans messages from Skype API and acts acordingly to them (changing \
online status, showing messages.... + * @param message What the skype said
+ */
+ void skypeMessage(const QString &message);
+ /**
+ * This one resets the online status showed on the icon in kopete depending on \
last values from skype. + * Used when the status changes
+ */
+ void resetStatus();
+ /**
+ * Makes the Skype search for something and saves what it was to decide later, \
what to do with it + * @param what What are we searching for
+ */
+ void search(const QString &what);
+ public:
+ /**
+ * Constructor
+ * @param account The account that this connection belongs to
+ */
+ Skype(SkypeAccount &account);
+ /**
+ * Destructor
+ */
+ ~Skype();
+ ///Can we comunicate with the skype program right now?
+ bool canComunicate();
+ /**
+ * Enables or disables hitchhake mode of incoming messages
+ * @see SkypeAccount::setHitchHike
+ */
+ void setHitchMode(bool value);
+ /**
+ * Enables or disables mark read messages mode
+ * @see SkypeAccount::setMarkRead
+ */
+ void setMarkMode(bool value);
+ /**
+ * Enables/disables scanning for unread messages after login
+ * @see SkypeAccount::setScanForUnread
+ */
+ void setScanForUnread(bool value);
+ /**
+ * Is that call incoming call?
+ * @param callId What call you mean?
+ * @return true if the call is incoming
+ */
+ bool isCallIncoming(const QString &callId);
+ /**
+ * Returns ID of chat to what given message belongs
+ * @param messageId Id of the wanted message
+ * @return ID of the chat. For unexisten message the result is not defined.
+ */
+ QString getMessageChat(const QString &messageId);
+ /**
+ * Returns list of users in that chat without actual user
+ * @param chat ID of that chat you want to know
+ */
+ QStringList getChatUsers(const QString &chat);
+ /**
+ * This will return ID of the actual user this one that uses this skype)
+ */
+ QString getMyself();
+ /**
+ * Create a chat with that members
+ * @param users List of users separated by coma (user_1, user_2, user...)
+ * @return Id of the new chat
+ */
+ QString createChat(const QString &users);
+ /**
+ * Says if the contact should be authorize, not authorized or blocked
+ */
+ enum AuthorType {
+ Author,
+ Deny,
+ Block
+ };
+ /**
+ * Ask if the user how is the user authorized
+ * @param contactId What user are you interested in?
+ */
+ AuthorType getAuthor(const QString &contactId);
+ /**
+ * Is this version of protocol able to create conference calls?
+ */
+ bool ableConference();
+ public slots:
+ /**
+ * Tell the skype to go online
+ */
+ void setOnline();
+ /**
+ * Tell the skype to go offline
+ */
+ void setOffline();
+ /**
+ * Tell the skype to go offline
+ */
+ void setAway();
+ /**
+ * Tell the skype to go not available
+ */
+ void setNotAvailable();
+ /**
+ * Tell the skype to go to Do not disturb
+ */
+ void setDND();
+ /**
+ * Tell the skype to go to Skype me mode
+ */
+ void setSkypeMe();
+ /**
+ * Tell the skype to go invisible
+ */
+ void setInvisible();
+ /**
+ * This sets the values of the account.
+ * @see SkypeAccount
+ */
+ void setValues(int launchType, const QString &appName);
+ /**
+ * Retrieve info of that contact
+ * @param contact What contact wants it
+ */
+ void getContactInfo(const QString &contact);
+ /**
+ * Asks skype for buddy status of some contact. Buddystatus is some property that \
ondicates, weather it is in contact list, awaiting authorization, just been mentioned \
or what exactly happened with it.. + * After skype responses, you will get the \
response by emiting the received signal + * @param contact It is the contact id of \
the user you want to check. + */
+ void getContactBuddy(const QString &contact);
+ /**
+ * Sends a message trough skype
+ * @param user To who it should be sent
+ * @param body What to send
+ */
+ void send(const QString &user, const QString &body);
+ /**
+ * Send a message to a given chat
+ * @param chat What chat to send it in
+ * @param body Text of that message
+ */
+ void sendToChat(const QString &chat, const QString &body);
+ /**
+ * Begins new call.
+ * @param userId ID of user to call (or multiple users separated by comas)
+ * @see acceptCall
+ * @see hangUp
+ * @see holdCall
+ * @see callStatus
+ * @see callError
+ */
+ void makeCall(const QString &userId);
+ /**
+ * Accept an incoming call
+ * @param callId ID of call to accept.
+ * @see makeCall
+ * @see hangUp
+ * @see holdCall
+ * @see callStatus
+ * @see callError
+ * @see newCall
+ */
+ void acceptCall(const QString &callId);
+ /**
+ * Hang up (finish) call in progress or deny an incoming call
+ * @param callId Which one
+ * @see makeCall
+ * @see acceptCall
+ * @see holdCall
+ * @see callStatus
+ * @see callError
+ * @see newCall
+ */
+ void hangUp(const QString &callId);
+ /**
+ * Hold call in progress or resume holded call. That call will not finish, you \
just leave it for later. + * @param callId Which call
+ * @see makeCall
+ * @see acceptCall
+ * @see hangUp
+ * @see callStatus
+ * @see callError
+ * @see newCall
+ */
+ void toggleHoldCall(const QString &callId);
+ /**
+ * Get the skoype out balance
+ */
+ void getSkypeOut();
+ /**
+ * Sets if the Skype is checked in short intervals by pings. If you turn that off, \
you will not know when skype exits. + * @param enabled Ping or not?
+ */
+ void enablePings(bool enabled);
+ /**
+ * Sends one ping and takes actions if it can not be delivered (skype is down)
+ */
+ void ping();
+ /**
+ * What DBus bus is used?
+ */
+ void setBus(int bus);
+ /**
+ * Start DBus if not wunning?
+ */
+ void setStartDBus(bool value);
+ /**
+ * Set the launch timeout - after that launch of Skype will be considered as \
unsuccessfull if connection can not be established + */
+ void setLaunchTimeout(int seconds);
+ /**
+ * Set a command to start skype by
+ */
+ void setSkypeCommand(const QString &command);
+ /**
+ * Sets if we wait a bit before connecting to Skype after it's start-up
+ */
+ void setWaitConnect(int value);
+ /**
+ * This gets a topic for given chat session
+ * @param chat What chat wants that
+ */
+ void getTopic(const QString &chat);
+ /**
+ * Invites a user to a chat
+ * @param chatId What chat
+ * @param userId What user
+ */
+ void inviteUser(const QString &chatId, const QString &userId);
+ /**
+ * Closes/leaves a chat
+ * @param chatId What chat
+ */
+ void leaveChat(const QString &chatId);
+ /**
+ * Removes a contact from the contact list
+ * @param contactId Id of the contact you want to remove
+ */
+ void removeContact(const QString &contactId);
+ /**
+ * Adds a contact to the list
+ * @param contactId Id of the contact to add
+ * @param contactId
+ */
+ void addContact(const QString &contactId);
+ /**
+ * Sets users authorization
+ * @param contactId ID of that user
+ * @param author for what is he authorized
+ */
+ void setAuthor(const QString &contactId, AuthorType author);
+ signals:
+ /**
+ * Emitted when the skype changes to online (or says it goes online)
+ */
+ void wentOnline();
+ /**
+ * Emitted when the skype goes offline
+ */
+ void wentOffline();
+ /**
+ * Emitted when the skype goes away
+ */
+ void wentAway();
+ /**
+ * Emitted when the skype goes to Not awailable
+ */
+ void wentNotAvailable();
+ /**
+ * Emitted when the skype goes to DND mode
+ */
+ void wentDND();
+ /**
+ * Emitted when skype changes to skype me mode
+ */
+ void wentSkypeMe();
+ /**
+ * Emitted when skype becomes invisible
+ */
+ void wentInvisible();
+ /**
+ * Emitted when atempt to connect started
+ */
+ void statusConnecting();
+ /**
+ * Emitted when new user should be added to the list
+ * @param name The skype name of the user
+ */
+ void newUser(const QString &name);
+ /**
+ * All contacts should be asked to request update of their information. This is \
emitted after the connection to skype is made. + */
+ void updateAllContacts();
+ /**
+ * This is emitted whenever some contact should be notified of info change
+ * @param contact What contact is it
+ * @param change The change. The syntax is [property (displayname, \
onlinestatus..)] [value] + */
+ void contactInfo(const QString &contact, const QString &change);
+ /**
+ * This is emitted when a new message is received
+ * @param user Contact ID of user that sent it. It is NOT guaranteed that the user \
is in list! + * @param body The message body that was received
+ * @param messageId ID of that message
+ */
+ void receivedIM(const QString &user, const QString &body, const QString \
&messageId); + /**
+ * This is emitted when a new message from multi-user chat is received
+ * @param chat Id of the chat
+ * @param body Tect of the message
+ * @param messageId Id of this message to get information about it if needed
+ * @param user Who sent it to that chat (ID)
+ */
+ void receivedMultiIM(const QString &chat, const QString &body, const QString \
&messageId, const QString &user); + /**
+ * This is emitted when an Id of the last outgoing message is known
+ * @param id The ID of that message
+ */
+ void gotMessageId(const QString &id);
+ /**
+ * This slot notifies about call status (onhold, in progress, routing, finished..)
+ * @param callId WHat call is it?
+ * @param status New status of the call.
+ * @see makeCall
+ * @see acceptCall
+ * @see hangUp
+ * @see holdCall
+ * @see callError
+ * @see newCall
+ */
+ void callStatus(const QString &callId, const QString &status);
+ /**
+ * This slot informs of error that happened to the call. It is translated error \
and can be directly showed to user. + * @param callId ID of the call that has an \
error. + * @param message The error text
+ * @see makeCall
+ * @see acceptCall
+ * @see hangUp
+ * @see holdCall
+ * @see callStatus
+ * @see newCall
+ */
+ void callError(const QString &callId, const QString &message);
+ /**
+ * Indicates a new call is established (is being established, incoming or so). In \
short, there is some new call. + * @param callId ID of the new call
+ * @param userId ID of the other user, or list of users (if more than one) divided \
by spaces + * @see makeCall
+ * @see acceptCall
+ * @see hangUp
+ * @see holdCall]
+ * @see callStatus
+ * @see callError
+ */
+ void newCall(const QString &callId, const QString &userId);
+ /**
+ * Skype out balance info
+ * @param balance How much does the user have
+ * @param currency And what is it that he has
+ */
+ void skypeOutInfo(int balance, const QString ¤cy);
+ /**
+ * Tells that my name is known or changed
+ * @param name The new name
+ */
+ void setMyselfName(const QString &name);
+ /**
+ * Some topic has to be set
+ * @param chat What chat should change its topic
+ * @param topic The new topic
+ */
+ void setTopic(const QString &chat, const QString &topic);
+ /**
+ * This is emitted when a new user joins a chat
+ * @param chat What chat he joined
+ * @param userId ID of the new user
+ */
+ void joinUser(const QString &chat, const QString &userId);
+ /**
+ * This is emitted when user leaves a chat
+ * @param chat What chat did he leave
+ * @param userId ID of that user
+ * @param reason Reason why he left
+ */
+ void leftUser(const QString &chat, const QString &userd, const QString &reason);
+ /**
+ * Emitted when some message is being sent out right now
+ * @param body Text of the message
+ * @param chat Id of the chat it has been sent to
+ */
+ void outgoingMessage(const QString &body, const QString &chat);
+ /**
+ * Put this call into a group, where other calls are (will be), used with \
conference calls + * @param callId Id of the call
+ * @param groupId The id of a group
+ * Note: the group should be closed when all it's calls are closed
+ */
+ void groupCall(const QString &callId, const QString &groupId);
+};
+
+#endif
Index: kopete/protocols/skype/libskype/skypedbus/skypeconnection.h
===================================================================
--- kopete/protocols/skype/libskype/skypedbus/skypeconnection.h (revision 0)
+++ kopete/protocols/skype/libskype/skypedbus/skypeconnection.h (revision 0)
@@ -0,0 +1,172 @@
+//
+// C++ Interface: skypeconnection
+//
+// Description:
+//
+//
+// Author: Kopete Developers <kopete-devel@kde.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef SKYPECONNECTION_H
+#define SKYPECONNECTION_H
+
+#include <qobject.h>
+#include <QtDBus>
+
+typedef enum {
+ ///The connection was successful
+ seSuccess = 0,
+ ///No runnign DBUS found
+ seNoDBus,
+ ///No running skype found and launching disabled or did not worked
+ seNoSkype,
+ ///User did not accept this app
+ seAuthorization,
+ ///Some other error
+ seUnknown,
+ ///It was canceled (by disconnectSkype)
+ seCanceled
+} skypeConnectionError;
+
+///This describes why was the connection closed
+typedef enum {
+ ///It was closed by this application
+ crLocalClosed,
+ ///It was closed by skype (reserverd for future versions of protocol, does not work \
yet) + crRemoteClosed,
+ ///The connection was lost, skype does not respond for the ping command or messages \
can not be sent + crLost,
+} skypeCloseReason;
+
+class SkypeConnectionPrivate;
+namespace DBusQt {
+ class Message;
+};
+class KProcess;
+
+/**
+ * This class is classs wrapping DBUS so it can be used easilly to connect to skype, \
disconnect send and receive messages from it. + * @author Kopete Developers
+*/
+class SkypeConnection : public QObject
+{
+ Q_OBJECT
+ private:
+ ///The D-pointer for internal things
+ SkypeConnectionPrivate *d;
+ private slots:
+ ///This one listens for incoming messages
+ void gotMessage(const QDBusMessage &);
+ ///This one takes care of incoming messages if they have some sence for the \
connection (protocol, pings and so on) + void parseMessage(const QString &message);
+ ///Set environment variables set from dbus-launch command (private DBus session)
+ void setEnv(KProcess *, char *buff, int len);
+ ///Starts logging into skype
+ void startLogOn();
+ ///Another interval try to connect to just started Skype
+ void tryConnect();
+ public slots:
+ /**
+ * Connects to skype
+ * After connection (both successful or unsuccessful) connectionDone is emitted
+ * @see connectionDone
+ * @param start By what command start Skype if it is not running (empty string \
means nothing is started) + * @param appName tells as what application it should \
authorise itself (this will user see on the "do you want to allow" dialog box) + * \
@param protocolVer Maximal protocol version that this app manages + * @param bus 0 \
- session bus, 1 - system bus + * @param startDbus Start session DBUs if needed \
(etc. not running and session DBus should be used) + * @param launchTimeout How \
long max. should wait to tell that launching skype did not work + * @param \
waitBeforeConnect Do we need to wait a while after skype starts? + */
+ void connectSkype(const QString &start, const QString &appName, int protocolVer, \
int bus, bool startDBus, int launchTimeout, int waitBeforeConnect); + /**
+ * Disconnects from skype
+ * @see connectionClosed
+ */
+ void disconnectSkype(skypeCloseReason reason = crLocalClosed);
+ /**
+ * Sends a message to skype. You must be connected before !
+ * @param message Contains the message to send
+ */
+ void send(const QString &message);
+ public:
+ /**
+ * Constructor. Creates UNCONECTED connection (sounds oddly ?)
+ */
+ SkypeConnection();
+ /**
+ * Destructor
+ */
+ ~SkypeConnection();
+ /**
+ * This enables/disables pings to skype and sets interval of the pings and timeout
+ * @param enable Enable or not the pings? If this is false, no pings are done and \
the rest of parameters has no effect + * @param interval Interval in witch pings \
should be sent, in miliseconds + * @param timeout When the ping should be \
considered unanwsered? (should be shorter than interval), in miliseconds + */
+ void setPing(bool enable, int interval, int timeout);
+ /**
+ * @return Are the pings enabled?
+ */
+ bool getPing() const;
+ /**
+ * @return What is the interval of pings? (ms)
+ */
+ int getPingInterval() const;
+ /**
+ * @return What is the timeout od pings? (ms)
+ */
+ int getPingTimeout() const;
+ /**
+ * @return Are we connected to the skype?
+ */
+ bool connected() const;
+ /**
+ * @return What is the protocol version?
+ */
+ int protocolVer() const;
+ /**
+ * This operator makes it possible to just send messages by writing connection << \
SomeString << anotherString. They are sent as separate objects; + * @param message \
What will be sent + */
+ SkypeConnection &operator<<(const QString &message);
+ /**
+ * This operator sends a message to skype and returns the response from it. Note \
that this one blocks. + * @param message What should be sent to skype
+ * @return The response from skype
+ */
+ QString operator%(const QString &message);
+ signals:
+ /**
+ * This signal is emitted when an attempt to connect to skype application is done. \
It is done in both cases, success or not. + * @param error Indicates error code. \
seSuccess means there was no error and the connection was successful. + * @param \
protocolVer Protocol version used by this connection. Is less or equal to the version \
set in connect + * @see connect
+ */
+ void connectionDone(int error, int protocolVer);
+ /**
+ * This signal is emitted when the connection is closed due to error or because it \
was disconnetcted + * @param reason Describes why it was closed (you can typecast \
it to skypeCloseReason if you are interested, or just use the numeric values) + */
+ void connectionClosed(int reason);
+ /**
+ * This slot is emitted when something is coming from skype.
+ * It contains pongs as well (responses to ping) and if you do not care about \
them, you should ignore them. + * @param message The message that arrived
+ */
+ void received(const QString &message);
+ /**
+ * This is emitted when some error occurs
+ * @param message Describes the error
+ */
+ void error(const QString &message);
+ /**
+ * This is provided for debugging so you can see what you have sent to skype
+ * @param message The message that was sent to skype
+ */
+ void sent(const QString &message);
+};
+
+#endif
Index: kopete/protocols/skype/libskype/skypedbus/skypeconnection.cpp
===================================================================
--- kopete/protocols/skype/libskype/skypedbus/skypeconnection.cpp (revision 0)
+++ kopete/protocols/skype/libskype/skypedbus/skypeconnection.cpp (revision 0)
@@ -0,0 +1,424 @@
+//
+// C++ Implementation: skypeconnection
+//
+// Description:
+//
+//
+// Author: Kopete Developers <kopete-devel@kde.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include "skypeconnection.h"
+
+///@todo When QT 4 is used, the signal-slot wrapper will be better, replace it
+#include <QtDBus>
+//#include <iterator.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <kprocess.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+
+typedef enum {
+ cfConnected,
+ cfNotConnected,
+ cfNameSent,
+ cfProtocolSent,
+ cfWaitingStart
+} connFase;
+
+class SkypeConnectionPrivate {
+ public:
+ ///Are we connected/connecting?
+ connFase fase;
+ ///How will we be known to skype?
+ QString appName;
+ ///What is the protocol version used (wanted if not connected yet)
+ int protocolVer;
+ ///The connection to DBus
+ QDBusConnection::QDBusConnection *conn;
+ ///This timer will keep trying until Skype starts
+ QTimer *startTimer;
+ ///How much time rest? (until I say starting skype did not work)
+ int timeRemaining;
+ ///Wait a while before we conect to just-started skype?
+ int waitBeforeConnect;
+};
+
+SkypeConnection::SkypeConnection() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d = new SkypeConnectionPrivate;//create the d pointer
+ d->fase = cfNotConnected;//not connected yet
+ d->conn = 0L;//No connetion created
+ d->startTimer = 0L;
+
+ connect(this, SIGNAL(received(const QString&)), this, SLOT(parseMessage(const \
QString&)));//look into all messages +}
+
+SkypeConnection::~SkypeConnection() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ disconnectSkype();//disconnect before you leave
+ delete d;//Remove the D pointer
+}
+
+void SkypeConnection::startLogOn() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->startTimer) {
+ d->startTimer->deleteLater();
+ d->startTimer = 0L;
+ }
+
+// DBusQt::Message ping("com.Skype.API", "/com/Skype", "com.Skype.API", \
"Ping");//create a ping message +
+ QDBusMessage ping = \
QDBusMessage::createMethodCall(QString("com.Skype.API"),QString("/com/Skype"),QString("com.Skype.API"),QString("Invoke"));
+ //DBusQt::Message ping("com.Skype.API", "/com/Skype", "com.Skype.API", "Invoke");
+ ping << QString("Ping");
+
+ //ping.setAutoActivation(true);
+ QDBusMessage reply = d->conn->call(ping);//send it there
+ //DBusQt::Message reply = d->conn->sendWithReplyAndBlock(ping);//send it there
+
+ //DBusQt::Message::iterator it = reply.begin();
+
+ QStringList replylist = reply.arguments().at(0).toStringList();
+ QStringList::iterator it = replylist.begin();
+
+ if (it == replylist.end()) {
+ emit error(i18n("Could not ping Skype"));
+ disconnectSkype(crLost);
+ emit connectionDone(seNoSkype, 0);
+ return;
+ }
+
+ d->fase = cfNameSent;
+ send(QString("NAME %1").arg(d->appName));
+}
+
+void SkypeConnection::gotMessage(const QDBusMessage &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (message.member() == "Ping") {//Skype wants to know if we are alive
+ kDebug() << "Skype sent us ping, responding" << endl;
+ QDBusMessage reply(message);//Create the reply
+ reply << getpid();//respond with our PID
+ d->conn->send(reply);//send it
+ //d->conn->flush();
+ return;//It is enough
+ }
+
+ if (message.member() == "Notify") {//Something importatnt?
+ QStringList messagelist = message.arguments().at(0).toStringList();
+ for (QStringList::iterator it = messagelist.begin(); it != messagelist.end(); \
++it) {//run trough the whole message + //emit received((*it).toString());//Take \
out the string and use it + emit received((*it));
+ }
+
+ if (message.isReplyRequired()) {
+ kDebug() << "Message expects reply, sending a dummy one" << endl;
+ QDBusMessage *reply = new QDBusMessage(message);//generate a reply for that \
message + (*reply) << QString("ERROR 2");//write there seme error
+ d->conn->send(*reply);//send the message
+ //d->conn->flush();
+ }
+ }
+}
+
+void SkypeConnection::parseMessage(const QString &message) {
+ kDebug() << k_funcinfo << QString("(message: %1)").arg(message) << endl;//some \
debug info +
+ switch (d->fase) {
+ case cfNameSent: {
+
+ if (message == "OK") {//Accepted by skype
+ d->fase = cfProtocolSent;//Sending the protocol
+ send(QString("PROTOCOL %1").arg(d->protocolVer));//send the protocol version
+ } else {//Not accepted by skype
+ emit error(i18n("Skype did not accept this application"));//say there is an \
error + emit connectionDone(seAuthorization, 0);//Problem with authorization
+ disconnectSkype(crLost);//Lost the connection
+ }
+ break;
+ }
+ case cfProtocolSent: {
+ if (message.contains(QString("PROTOCOL"), Qt::CaseSensitivity(false))) {//This \
one inform us what protocol do we use + bool ok;
+ int version = message.section(' ', 1, 1).toInt(&ok, 0);//take out the protocol \
version and make it int + if (!ok) {
+ emit error(i18n("Skype API syntax error"));
+ emit connectionDone(seUnknown, 0);
+ disconnectSkype(crLost);//lost the connection
+ return;//I have enough
+ }
+ d->protocolVer = version;//this will be the used version of protocol
+ d->fase = cfConnected;
+ emit connectionDone(seSuccess, version);//tell him that we are connected at last
+ } else {//the API is not ready yet, try later
+ emit error(i18n("Skype API not ready yet, wait a bit longer"));
+ emit connectionDone(seUnknown, 0);
+ disconnectSkype(crLost);
+ return;
+ }
+ break;//Other messages are ignored, waiting for the protocol response
+ }
+ }
+}
+
+void SkypeConnection::connectSkype(const QString &start, const QString &appName, int \
protocolVer, int bus, bool startDBus, int launchTimeout, int waitBeforeConnect) { \
+ kDebug() << k_funcinfo << endl;//some debug info +
+ if (d->fase != cfNotConnected)
+ return;
+
+ d->appName = appName;
+ d->protocolVer = protocolVer;
+
+ if (bus == 0)
+ d->conn = new QDBusConnection::QDBusConnection(QString("SessionBus"));
+ else
+ d->conn = new QDBusConnection::QDBusConnection(QString("SystemBus"));
+
+ if ((!d->conn) || (!d->conn->isConnected())) {
+ if ((bus == 0) && (startDBus)) {
+ KProcess bus_launch;
+ bus_launch << "dbus_launch";
+ bus_launch << "--exit-with-session";
+ connect(&bus_launch, SIGNAL(receivedStdout(KProcess *, char *, int)), this, \
SLOT(setEnv(KProcess *, char*, int ))); + //bus_launch.start(KProcess::Block, \
KProcess::Stdout); + bus_launch.start();
+ connectSkype(start, appName, protocolVer, bus, false, launchTimeout, \
waitBeforeConnect);//try it once again, but if the dbus start did not work, it won't \
work that time ether, so do not cycle + return;
+ }
+ emit error(i18n("Could not connect to DBus"));
+ disconnectSkype(crLost);
+ emit connectionDone(seNoDBus, 0);
+ return;
+ }
+
+ //d->conn->registerObject(QString("org.kde.kopete.skype"), \
&(QString("/com/Skype/Client"))); +
+ //connect(d->conn, SIGNAL(messageArrived(const QDBusMessage&)), this, \
SLOT(gotMessage(const QDBusMessage &))); + //connect(d->conn, \
SIGNAL(messageArrived(const QDBusMessage&)), this, SLOT(gotMessage(const QDBusMessage \
&)), Qt::AutoConnection); +
+ {
+/* DBusQt::Message m("org.freedesktop.DBus", "/org/freedesktop/DBus", \
"org.freedesktop.DBus", "ServiceExists"); + m << QString("com.Skype.API"); */
+
+ QDBusMessage m = QDBusMessage::createMethodCall(QString("com.Skype.API"), \
QString("/com/Skype"), QString("com.Skype.API"), QString("Invoke")); + m << \
QString("Ping"); +
+ //m.setAutoActivation(true);
+
+ QDBusMessage reply = d->conn->call(m);
+
+ QStringList replylist = reply.arguments().at(0).toStringList();
+ QStringList::iterator it = replylist.begin();
+ if ((it == replylist.end()) || (bool)((*it).toInt() != true)) {
+ if (!start.isEmpty()) {//try starting Skype by the given command
+ KProcess sk;
+ QStringList args = start.split(' ');
+ //QStringList args = QStringList::split(' ', start);
+ for (QStringList::iterator i = args.begin(); i != args.end(); ++i) {
+ sk << (*i);
+ }
+ //if (!sk.start(KProcess::DontCare, KProcess::NoCommunication)) {
+ /*if (!sk.start()) {
+ emit error(i18n("Could not launch Skype"));
+ disconnectSkype(crLost);
+ emit connectionDone(seNoSkype, 0);
+ return;
+ }*/
+ d->fase = cfWaitingStart;
+ d->startTimer = new QTimer();
+ connect(d->startTimer, SIGNAL(timeout()), this, SLOT(tryConnect()));
+ d->startTimer->start(1000);
+ d->timeRemaining = launchTimeout;
+ d->waitBeforeConnect = waitBeforeConnect;
+ return;
+ }
+ emit error(i18n("Could not find Skype"));
+ disconnectSkype(crLost);
+ emit connectionDone(seNoSkype, 0);
+ return;
+ }
+ }
+
+ startLogOn();
+}
+
+void SkypeConnection::disconnectSkype(skypeCloseReason reason) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (!d->conn) //nothing to disconnect
+ return;
+ //d->conn->disconne();//close the connection
+ delete d->conn;//destroy it
+ d->conn = 0L;//andmark it as empty
+ if (d->startTimer) {
+ d->startTimer->stop();
+ d->startTimer->deleteLater();
+ d->startTimer = 0L;
+ }
+
+ d->fase = cfNotConnected;//No longer connected
+ emit connectionDone(seCanceled, 0);
+ emit connectionClosed(reason);//we disconnect
+}
+
+void SkypeConnection::send(const QString &message) {
+ kDebug() << k_funcinfo << QString("(message: %1)").arg(message) << endl;//some \
debug info +
+ if (d->fase == cfNotConnected)
+ return;//not connected, posibly because of earlier error, do not show it again
+
+ QDBusMessage m = QDBusMessage::createMethodCall("com.Skype.API", "/com/Skype", \
"com.Skype.API", "Invoke"); + //QDBusMessage m("com.Skype.API", "/com/Skype", \
"com.Skype.API", "Invoke"); + m << message;
+ //m.setAutoActivation(true);
+ QDBusMessage reply = d->conn->call(m);
+
+ //d->conn->flush();
+ /*if (d->conn->error()) {//There was some error
+ emit error(i18n("Error while sending a message to skype \
(%1)").arg(d->conn->getError()));//say there was the error + if (d->fase != \
cfConnected) + emit connectionDone(seUnknown, 0);//Connection attempt finished with \
error + disconnectSkype(crLost);//lost the connection
+
+ return;//this is enough, no more errors please..
+ }*/ /// Implement this
+
+ QStringList replylist = reply.arguments().at(0).toStringList();
+
+ for (QStringList::iterator it = replylist.begin(); it != replylist.end(); ++it) {
+ //emit received((*it).toString());//use the message
+ emit received((*it));
+ }
+// d->conn->send(m);
+}
+
+bool SkypeConnection::connected() const {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ return d->fase == cfConnected;
+}
+
+int SkypeConnection::protocolVer() const {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ return d->protocolVer;//just give him the protocol version
+}
+
+SkypeConnection &SkypeConnection::operator <<(const QString &message) {
+ send(message);//just send it
+ return *this;//and return yourself
+}
+
+QString SkypeConnection::operator %(const QString &message) {
+ kDebug() << k_funcinfo << "message: " << message << endl;//some debug info
+
+ if (d->fase == cfNotConnected)
+ return "";//not connected, posibly because of earlier error, do not show it again
+
+ QDBusMessage m = QDBusMessage::createMethodCall("com.Skype.API", "/com/Skype", \
"com.Skype.API", "Invoke"); + //QDBusMessage m("com.Skype.API", "/com/Skype", \
"com.Skype.API", "Invoke"); + m << message;
+ //m.setAutoActivation(true);
+ QDBusMessage reply = d->conn->call(m);
+
+ //d->conn->flush();
+ /*if (d->conn->error()) {//There was some error
+ emit error(i18n("Error while sending a message to skype \
(%1)").arg(d->conn->getError()));//say there was the error + if (d->fase != \
cfConnected) + emit connectionDone(seUnknown, 0);//Connection attempt finished with \
error + disconnectSkype(crLost);//lost the connection
+ return "";//this is enough, no more errors please..
+ }*/ /// Implement this
+
+ QStringList replylist = reply.arguments().at(0).toStringList();
+
+ for (QStringList::iterator it = replylist.begin(); it != replylist.end(); ++it) {
+ //kDebug() << (*it).toString() << endl;//show what we have received
+ //return (*it).toString();//ok, just return it
+ kDebug() << (*it) << endl;
+ return (*it);
+ }
+
+ return "";//the skype did not respond, which is unusual but what can I do..
+}
+
+void SkypeConnection::setEnv(KProcess *, char *buffer, int length) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ char *myBuff = new char[length + 1];
+ myBuff[length] = '\0';
+ memcpy(myBuff, buffer, length);//copy the output from there
+
+ char *next;
+
+ for (char *c = myBuff; *c; c++) if (*c == '=') {
+ *c = '\0';//Split the string
+ next = c + 1;//This is the next one
+ break;
+ }
+
+ if (strcmp(myBuff, "DBUS_SESSION_BUS_ADDRESS") != 0) {
+ delete[] myBuff;
+ return;//something I'm not interested in
+ }
+
+ //strip the apostrophes or quotes given by the dbus-launch command
+ if ((next[0] == '\'') || (next[0] == '"')) ++next;
+ int len = strlen(next);
+ if ((next[len - 1] == '\'') || (next[len - 1] == '"')) next[len - 1] = '\0';
+
+ setenv(myBuff, next, false);//and set the environment variable
+
+ delete[] myBuff;
+}
+
+void SkypeConnection::tryConnect() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ /*{
+ QDBusMessage m = QDBusMessage::createMethodCall("com.Skype.API", "/com/Skype", \
"com.Skype.API", "Invoke"); + m << QString("Ping");
+ //QDBusMessage m("org.freedesktop.DBus", "/org/freedesktop/DBus", \
"org.freedesktop.DBus", "ServiceExists"); + //m << QString("com.Skype.API");
+ m.setAutoActivation(true);
+
+ QDBusMessage reply = d->conn->call(m);
+
+ QDBusMessage::iterator it = reply.begin();
+ if ((it == reply.end()) || ((*it).toBool() != true)) {
+ if (--d->timeRemaining == 0) {
+ d->startTimer->stop();
+ d->startTimer->deleteLater();
+ d->startTimer = 0L;
+ emit error(i18n("Could not find Skype"));
+ disconnectSkype(crLost);
+ emit connectionDone(seNoSkype, 0);
+ return;
+ }
+ return;//Maybe next time
+ }
+ }*/
+
+ d->startTimer->stop();
+ d->startTimer->deleteLater();
+ d->startTimer = 0L;
+ if (d->waitBeforeConnect) {
+ QTimer::singleShot(1000 * d->waitBeforeConnect, this, SLOT(startLogOn()));
+ //Skype does not like being bothered right after it's start, give it a while to \
breathe + } else
+ startLogOn();//OK, it's your choise
+}
+
+#include "skypeconnection.moc"
Index: kopete/protocols/skype/libskype/skype.cpp
===================================================================
--- kopete/protocols/skype/libskype/skype.cpp (revision 0)
+++ kopete/protocols/skype/libskype/skype.cpp (revision 0)
@@ -0,0 +1,798 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#include "skype.h"
+#include <skypeconnection.h>
+#include <skypeaccount.h>
+
+#include <kdebug.h>
+//#include <qvaluelist.h>
+#include <qstring.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <qtimer.h>
+
+#define PROTOCOL_MAX 5
+#define PROTOCOL_MIN 5
+#define TEST_QUIT if (!d->connection.connected()) return;
+
+///This one indicates, weather the Skype is connected (does not mean weather it is \
marked as online, just if it has connection to the site) +typedef enum {
+ csOffline,
+ csConnecting,
+ csPausing,
+ csOnline,
+ csLoggedOut
+} connectionStatus;
+
+///This describes what the user is marked as. If online here and not connected to \
skype site, he is probably offline +typedef enum {
+ usUnknown,
+ usOffline,
+ usOnline,
+ usSkypeMe,
+ usAway,
+ usNA,
+ usDND,
+ usInvisible
+} userStatus;
+
+class SkypePrivate {
+ public:
+ ///The connection
+ SkypeConnection connection;
+ ///The queue
+ QStringList messageQueue;
+ ///How do we start skype?
+ int launchType;
+ ///What is our name?
+ QString appName;
+ ///Should the skypeconnection start skype automatically if it is not running?
+ bool start;
+ ///Is the skype connected?
+ connectionStatus connStatus;
+ ///What is the online status for the user?
+ userStatus onlineStatus;
+ ///This contains last search request to know, what we were searching for
+ QString searchFor;
+ ///Is the hitch-mode enabled?
+ bool hitch;
+ ///Is the mark read messages mode enabled?
+ bool mark;
+ ///The skype account this connection belongs to
+ SkypeAccount &account;
+ ///Should we show the message that Skype died? It if off when going offline, this \
removes that onnoying message when logging off and skype finishes first. + bool \
showDeadMessage; + ///Do we automatically scan for unread messages on login?
+ bool scanForUnread;
+ ///Constructor
+ SkypePrivate(SkypeAccount &_account) : account(_account) {};//initialize all that \
needs it + ///List of known calls, so they are not showed twice
+ QStringList knownCalls;
+ ///Are the pings enabled?
+ bool pings;
+ ///Pinging timer
+ QTimer *pingTimer;
+ ///What bus is used now?
+ int bus;
+ ///Do we start DBus as well if needed?
+ bool startDBus;
+ ///The launch timeout (after that no connection -> unsuccessfull -> error)
+ int launchTimeout;
+ ///By what command is skype started?
+ QString skypeCommand;
+ ///Do we wait before connecting?
+ int waitBeforeConnect;
+ ///List of alredy received messages (IDs)
+ QStringList recvMessages;
+};
+
+Skype::Skype(SkypeAccount &account) : QObject() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d = new SkypePrivate(account);//create the d-pointer
+
+ //initial values
+ d->connStatus = csOffline;
+ d->onlineStatus = usOffline;
+ d->searchFor = "";
+ d->pings = false;
+ d->pingTimer = new QTimer;
+
+ connect(&d->connection, SIGNAL(connectionClosed(int)), this, \
SLOT(closed(int)));//tell me if you close/lose the connection \
+ connect(&d->connection, SIGNAL(connectionDone(int, int)), this, \
SLOT(connectionDone(int, int)));//Do something whe he finishes connecting \
+ connect(&d->connection, SIGNAL(error(const QString&)), this, SLOT(error(const \
QString&)));//Listen for errors + connect(&d->connection, SIGNAL(received(const \
QString&)), this, SLOT(skypeMessage(const QString&)));//Take all incoming messages \
+ connect(d->pingTimer, SIGNAL(timeout()), this, SLOT(ping())); +}
+
+
+Skype::~Skype() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->connection.connected())
+ d->connection << QString("SET USERSTATUS OFFLINE");
+
+ d->pingTimer->stop();
+ d->pingTimer->deleteLater();
+
+ delete d;//release the memory
+}
+
+void Skype::setOnline() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = true;
+
+ if ((d->onlineStatus == usOnline) && (d->connStatus == csOnline) && \
(d->connection.connected())) + return;//Already online
+
+ queueSkypeMessage("SET USERSTATUS ONLINE", true);//just send the message
+}
+
+void Skype::setOffline() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = false;
+
+ d->connection << QString("SET USERSTATUS OFFLINE");//this one special, do not \
connect to skype because of that + d->connection.disconnectSkype();
+}
+
+void Skype::setAway() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = true;
+
+ queueSkypeMessage("SET USERSTATUS AWAY", true);
+}
+
+void Skype::setNotAvailable() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = true;
+
+ queueSkypeMessage("SET USERSTATUS NA", true);
+}
+
+void Skype::setDND() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = true;
+
+ queueSkypeMessage("SET USERSTATUS DND", true);
+}
+
+void Skype::setInvisible() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = true;
+
+ queueSkypeMessage("SET USERSTATUS INVISIBLE", true);
+}
+
+void Skype::setSkypeMe() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ d->showDeadMessage = true;
+
+ queueSkypeMessage("SET USERSTATUS SKYPEME", true);
+}
+
+void Skype::queueSkypeMessage(const QString &message, bool deleteQueue) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->connection.connected()) {//we are connected, so just send it
+ d->connection << message;//just send it
+ } else {
+ emit statusConnecting();//Started connecting to skype
+ if (deleteQueue)
+ d->messageQueue.clear();//delete all old messages
+ d->messageQueue << message;//add the new one
+ d->connection.connectSkype((d->start) ? d->skypeCommand : "", d->appName, \
PROTOCOL_MAX, d->bus, d->startDBus, d->launchTimeout, d->waitBeforeConnect);//try to \
connect + }
+}
+
+void Skype::setValues(int launchType, const QString &appName) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->appName = appName;
+ if (d->appName.isEmpty()) //The defaut one?
+ d->appName = "Kopete";
+ d->launchType = launchType;
+ switch (launchType) {
+ case 0: //start the skype if it is needed
+ d->start = true;//just set autostart
+ break;
+ case 1: //do not start
+ d->start = false;//do not start
+ break;
+ }
+}
+
+void Skype::closed(int) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ emit wentOffline();//No longer connected
+ d->messageQueue.clear();//no messages will wait, it was lost
+ d->pingTimer->stop();
+}
+
+void Skype::connectionDone(int error, int protocolVer) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->pings) {
+ d->pingTimer->start(1000);
+ }
+
+ if (error == seSuccess) {//It worked
+ if (protocolVer < PROTOCOL_MIN) {//The protocol is too old, it is not useable
+ this->error(i18n("This version of Skype is too old, consider upgrading"));
+ connectionDone(seUnknown, 0);//So act like there was an error
+ return;//and it is all fo now
+ }
+
+ while (d->messageQueue.size()) {//It isn't empty yet?
+ QStringList::iterator it = d->messageQueue.begin();//take the first one
+ d->connection << (*it);//send the message
+ //d->messageQueue.remove(it);//remove this one
+ d->messageQueue.removeFirst();
+ }
+ emit updateAllContacts();//let all contacts update their information
+ search("FRIENDS");//search for friends - to add them all
+ TEST_QUIT;//if it failed, do not continue
+ d->connection.send("GET USERSTATUS");
+ TEST_QUIT;
+ d->connection.send("GET CONNSTATUS");//
+ } else {
+ closed(crLost);//OK, this is wrong, justclose the connection/atempt and delete the \
queue + }
+}
+
+void Skype::error(const QString &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ disconnect(&d->connection, SIGNAL(error(const QString&)), this, SLOT(error(const \
QString&)));//One arror at a time is enough, stop flooding the user +
+ if (d->showDeadMessage)//just skip the error message if we are going offline, none \
ever cares. + KMessageBox::error(0L, message, i18n("Skype protocol"));//Show the \
message +
+ connect(&d->connection, SIGNAL(error(const QString&)), this, SLOT(error(const \
QString&)));//Continue showing more errors in future +}
+
+void Skype::skypeMessage(const QString &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ QString messageType = message.section(' ', 0, 0).toUpper();//get the first part of \
the message + if (messageType == "CONNSTATUS") {//the connection status
+ QString value = message.section(' ', 1, 1).toUpper();//get the second part of the \
message + if (value == "OFFLINE")
+ d->connStatus = csOffline;
+ else if (value == "CONNECTING")
+ d->connStatus = csConnecting;
+ else if (value == "PAUSING")
+ d->connStatus = csPausing;
+ else if (value == "ONLINE")
+ d->connStatus = csOnline;
+ else if (value == "LOGGEDOUT")
+ d->connStatus = csLoggedOut;
+
+ resetStatus();//set new status
+ } else if (messageType == "USERSTATUS") {//Status of this user
+ QString value = message.section(' ', 1, 1).toUpper();//get the second part
+ if (value == "UNKNOWN")
+ d->onlineStatus = usUnknown;
+ else if (value == "OFFLINE")
+ d->onlineStatus = usOffline;
+ else if (value == "ONLINE")
+ d->onlineStatus = usOnline;
+ else if (value == "SKYPEME")
+ d->onlineStatus = usSkypeMe;
+ else if (value == "AWAY")
+ d->onlineStatus = usAway;
+ else if (value == "NA")
+ d->onlineStatus = usNA;
+ else if (value == "DND")
+ d->onlineStatus = usDND;
+ else if (value == "INVISIBLE")
+ d->onlineStatus = usInvisible;
+
+ resetStatus();
+ } else if (messageType == "USERS") {//some user info
+ QString theRest = message.section(' ', 1).toUpper();//take the rest
+ if (d->searchFor == "FRIENDS") {//it was initial search for al users
+ QStringList names = theRest.split(",");//divide it into names by comas
+ kDebug() << "Names: " << names << endl;//write what you have done with that
+ for (QStringList::iterator it = names.begin(); it != names.end(); ++it) {//run \
trough the names + QString name = (*it).toUpper();//get the name only
+ if (name.isEmpty())
+ continue;//just skip the empty names
+ emit newUser(name);//add the user to list
+ }
+ if (d->scanForUnread)
+ search("MISSEDMESSAGES");
+ }
+ } else if (messageType == "USER") {//This is for some contact
+ const QString &contactId = message.section(' ', 1, 1);//take the second part, it \
is the user name + const QString &type = message.section(' ', 2, 2).toUpper();//get \
what it is + if ((type == "FULLNAME") || (type == "DISPLAYNAME") || (type == "SEX") \
|| + (type == "PHONE_HOME") || (type == "PHONE_OFFICE") ||
+ (type == "PHONE_MOBILE") ||
+ (type == "ONLINESTATUS") || (type == "BUDDYSTATUS") || (type == "HOMEPAGE")) {
+ const QString &info = message.section(' ', 2);//and the rest is just the message \
for that contact + emit contactInfo(contactId, info);//and let the contact know
+ } else kDebug() << "Unknown message for contact, ignored" << endl;
+ } else if (messageType == "CHATMESSAGE") {//something with message, maebe \
incoming/sent + QString messageId = message.section(' ', 1, 1).toUpper();//get the \
second part of message - it is the message ID + QString type = message.section(' ', \
2, 2).toUpper();//This part significates what about the message are we talking about \
(status, body, etc..) + QString chatMessageType = (d->connection % QString("GET \
CHATMESSAGE %1 TYPE").arg(messageId)).section(' ', 3, 3).toUpper(); + if \
(chatMessageType == "ADDEDMEMBERS") { + QString status = message.section(' ', 3, \
3).toUpper(); + if (d->recvMessages.indexOf(messageId) != \
d->recvMessages.lastIndexOf(QRegExp(messageId))) + return;
+ d->recvMessages << messageId;
+ const QString &users = (d->connection % QString("GET CHATMESSAGE %1 \
USERS").arg(messageId)).section(' ', 3).toUpper(); + QStringList splitUsers = \
users.split(' '); + const QString &chatId = (d->connection % QString("GET \
CHATMESSAGE %1 CHATNAME").arg(messageId)).section(' ', 3, 3).toUpper(); + for \
(QStringList::iterator it = splitUsers.begin(); it != splitUsers.end(); ++it) { \
+ if ((*it).toUpper() == getMyself().toUpper()) + continue;
+ emit joinUser(chatId, *it);
+ }
+ return;
+ } else if (chatMessageType == "LEFT") {
+ QString status = message.section(' ', 3, 3).toUpper();
+ if (d->recvMessages.indexOf(messageId) != \
d->recvMessages.lastIndexOf(QRegExp(messageId))) + return;
+ d->recvMessages << messageId;
+ const QString &chatId = (d->connection % QString("GET CHATMESSAGE %1 \
CHATNAME").arg(messageId)).section(' ', 3, 3).toUpper(); + const QString &chatType \
= (d->connection % QString("GET CHAT %1 STATUS").arg(chatId)).section(' ', 3, \
3).toUpper(); + if ((chatType == "DIALOG") || (chatType == "LEGACY_DIALOG"))
+ return;
+ const QString &user = (d->connection % QString("GET CHATMESSAGE %1 \
FROM_HANDLE").arg(messageId)).section(' ', 3, 3).toUpper(); + const QString &reason \
= (d->connection % QString("GET CHATMESSAGE %1 \
LEAVEREASON").arg(messageId)).section(' ', 3, 3).toUpper(); + QString showReason = \
i18n("Unknown"); + if (reason == "USER_NOT_FOUND") {
+ showReason = i18n("User not found");
+ } else if (reason == "USER_INCAPABLE") {
+ showReason = i18n("Does not have multi-user chat capability");
+ } else if ((reason == "ADDER_MUST_BE_FRIEND") || ("ADDER_MUST_BE_AUTHORIZED")) {
+ showReason = i18n("Chat denied");
+ } else if (reason == "UNSUBSCRIBE") {
+ showReason = "";
+ }
+ if (user.toUpper() == getMyself().toUpper())
+ return;
+ emit leftUser(chatId, user, showReason);
+ return;
+ }
+ if (type == "STATUS") {//OK, status of some message has changed, check what is it
+ QString value = message.section(' ', 3, 3).toUpper();//get the last part, what \
status it is + if (value == "RECEIVED") {//OK, received new message, possibly read \
it + if (chatMessageType == "SAID") {//OK, it is some IM
+ hitchHike(messageId);//receive the message
+ }
+ } else if (value == "SENDING") {
+ if ((d->connection % QString("GET CHATMESSAGE %1 \
TYPE").arg(messageId)).section(' ', 3, 3).toUpper() == "SAID") { + emit \
gotMessageId(messageId); + }
+ } else if (value == "SENT") {//Sendign out some message, that means it is a new \
one + if ((d->connection % QString("GET CHATMESSAGE %1 \
TYPE").arg(messageId)).section(' ', 3, 3).toUpper() == "SAID")//it is some message \
I'm interested in + emit gotMessageId(messageId);//Someone may be interested in \
its ID + if (d->recvMessages.indexOf(messageId) != \
d->recvMessages.lastIndexOf(QRegExp(messageId))) + return;//we already got this \
one + d->recvMessages << messageId;
+ const QString &chat = (d->connection % QString("GET CHATMESSAGE %1 \
CHATNAME").arg(messageId)).section(' ', 3, 3).toUpper(); + const QString &body = \
(d->connection % QString("GET CHATMESSAGE %1 BODY").arg(messageId)).section(' ', 3); \
+ if (!body.isEmpty())//sometimes skype shows empty messages, just ignore them \
+ emit outgoingMessage(body, chat); + }
+ }
+ } else if (messageType == "CHATMESSAGES") {
+ if (d->searchFor == "MISSEDMESSAGES") {//Theese are messages we did not read yet
+ QStringList messages = message.section(' ', 1).split(' ');//get the meassage IDs
+ for (QStringList::iterator it = messages.begin(); it != messages.end(); ++it) {
+ QString Id = (*it).toUpper();
+ if (Id.isEmpty())
+ continue;
+ skypeMessage(QString("CHATMESSAGE %1 STATUS RECEIVED").arg(Id));//simulate \
incoming message notification + }
+ }
+ } else if (messageType == "CALL") {
+ const QString &callId = message.section(' ', 1, 1).toUpper();
+ if (message.section(' ', 2, 2).toUpper() == "CONF_ID") {
+ if (d->knownCalls.indexOf(callId) == -1) {//new call
+ d->knownCalls << callId;
+ const QString &userId = (d->connection % QString("GET CALL %1 \
PARTNER_HANDLE").arg(callId)).section(' ', 3, 3).toUpper(); + emit newCall(callId, \
userId); + }
+ const QString &confId = message.section(' ', 3, 3).toUpper();
+ if (confId != "0") {//It is an conference
+ emit groupCall(callId, confId);
+ }
+ }
+ if (message.section(' ', 2, 2).toUpper() == "STATUS") {
+ if (d->knownCalls.indexOf(callId) == -1) {//new call
+ d->knownCalls << callId;
+ const QString &userId = (d->connection % QString("GET CALL %1 \
PARTNER_HANDLE").arg(callId)).section(' ', 3, 3).toUpper(); + emit newCall(callId, \
userId); + }
+ const QString &status = message.section(' ', 3, 3).toUpper();
+ if (status == "FAILED") {
+ int reason = (d->connection % QString("GET CALL %1 \
FAILUREREASON").arg(callId)).section(' ', 3, 3).toUpper().toInt(); + QString \
errorText = i18n("Unknown error"); + switch (reason) {
+ case 1:
+ errorText = i18n("Misc error");
+ break;
+ case 2:
+ errorText = i18n("User or phone number does not exist");
+ break;
+ case 3:
+ errorText = i18n("User is offline");
+ break;
+ case 4:
+ errorText = i18n("No proxy found");
+ break;
+ case 5:
+ errorText = i18n("Session terminated");
+ break;
+ case 6:
+ errorText = i18n("No common codec found");
+ break;
+ case 7:
+ errorText = i18n("Sound I/O error");
+ break;
+ case 8:
+ errorText = i18n("Problem with remote sound device");
+ break;
+ case 9:
+ errorText = i18n("Call blocked by recipient");
+ break;
+ case 10:
+ errorText = i18n("Recipient not a friend");
+ break;
+ case 11:
+ errorText = i18n("User not authorized by recipient");
+ break;
+ case 12:
+ errorText = i18n("Sound recording error");
+ break;
+ }
+ emit callError(callId, errorText);
+ }
+ emit callStatus(callId, status);
+ }
+ } else if (messageType == "CURRENTUSERHANDLE") {
+ QString user = message.section(' ', 1, 1).toUpper();
+ QString name = (d->connection % QString("GET USER %1 \
DISPLAYNAME").arg(user)).section(' ', 3).toUpper(); + if (name.isEmpty())
+ name = (d->connection % QString("GET USER %1 FULLNAME").arg(user)).section(' ', \
3).toUpper(); + if (name.isEmpty())
+ name = user;
+ emit setMyselfName(name);
+ }
+}
+
+void Skype::getContactBuddy(const QString &contact) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("GET USER %1 BUDDYSTATUS").arg(contact);//just make a \
message asking for the buddystatus of user and send it +}
+
+void Skype::resetStatus() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ switch (d->connStatus) {
+ case csOffline:
+ case csLoggedOut:
+ emit wentOffline();//Do not care what is the user marked as, this is more \
importatnt + return;
+ case csConnecting:
+ if (d->onlineStatus == usOffline)//not connecting, user wants to be offline
+ break;
+ emit statusConnecting();//still connecting, wait a minute
+ return;
+ default://just remove the compile-time warning about not handled value
+ break;
+ }
+
+ switch (d->onlineStatus) {
+ case usUnknown:
+ emit statusConnecting();
+ break;
+ case usOffline:
+ emit wentOffline();
+ break;
+ case usOnline:
+ emit wentOnline();
+ break;
+ case usSkypeMe:
+ emit wentSkypeMe();
+ break;
+ case usAway:
+ emit wentAway();
+ break;
+ case usNA:
+ emit wentNotAvailable();
+ break;
+ case usDND:
+ emit wentDND();
+ break;
+ case usInvisible:
+ emit wentInvisible();
+ break;
+ }
+}
+
+void Skype::search(const QString &what) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->searchFor = what.section(' ', 0, 0).toUpper();
+ d->connection << QString("SEARCH %1").arg(what.toUpper());//search for that
+}
+
+void Skype::getContactInfo(const QString &contact) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("GET USER %1 FULLNAME").arg(contact)//ask for full name
+ << QString("GET USER %1 SEX").arg(contact)//ask for sex
+ << QString("GET USER %1 DISPLAYNAME").arg(contact)
+ << QString("GET USER %1 PHONE_HOME").arg(contact)
+ << QString("GET USER %1 PHONE_OFFICE").arg(contact)
+ << QString("GET USER %1 PHONE_MOBILE").arg(contact)
+ << QString("GET USER %1 ONLINESTATUS").arg(contact)
+ << QString("GET USER %1 HOMEPAGE").arg(contact)
+ << QString("GET USER %1 BUDDYSTATUS").arg(contact);//and the rest of info
+}
+
+bool Skype::canComunicate() {
+ return d->connection.connected();
+}
+
+void Skype::setHitchMode(bool value) {
+ d->hitch = value;
+}
+
+void Skype::setMarkMode(bool value) {
+ d->mark = value;
+}
+
+void Skype::hitchHike(const QString &messageId) {
+ kDebug() << k_funcinfo << "Message: " << messageId << endl;//some debug info
+
+ const QString &chat = (d->connection % QString("GET CHATMESSAGE %1 \
CHATNAME").arg(messageId)).section(' ', 3, 3).toUpper(); +
+ const QString &chatType = (d->connection % QString("GET CHAT %1 \
STATUS").arg(chat)).section(' ', 3, 3).toUpper(); +
+ if ((chatType == "LEGACY_DIALOG") || (chatType == "DIALOG")) {
+
+ const QString &user = (d->connection % QString("GET CHATMESSAGE %1 \
FROM_HANDLE").arg(messageId)).section(' ', 3, 3).toUpper();//ask skyp for a sender of \
that message and filter out the blouat around (like CHATMESSAGE 123...) +
+ if ((d->hitch) || (d->account.userHasChat(user))) {//it can be read eather if the \
hitchhiking non-chat messages is enabled or if the user already has opened a chat \
+ emit receivedIM(user, (d->connection % QString("GET CHATMESSAGE %1 \
BODY").arg(messageId)).section(' ', 3), messageId);//ask skype for the body and \
filter out the bload, we want only the text and make everyone aware that we received \
a message + if (d->mark) //We should mark it as read
+ d->connection << QString("SET CHATMESSAGE %1 SEEN").arg(messageId);//OK, just \
tell skype it is read + }
+ } else {
+ if ((d->hitch) || (d->account.chatExists(chat))) {
+ const QString &user = (d->connection % QString("GET CHATMESSAGE %1 \
FROM_HANDLE").arg(messageId)).section(' ', 3, 3).toUpper(); + emit \
receivedMultiIM(chat, (d->connection % QString("GET CHATMESSAGE %1 \
BODY").arg(messageId)).section(' ', 3), messageId, user); + if (d->mark)
+ d->connection << QString("SET CHATMESSAGE %1 SEEN").arg(messageId);
+ }
+ }
+}
+
+void Skype::send(const QString &user, const QString &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("MESSAGE %1 %2").arg(user).arg(message);//just ask skype \
to send it +}
+
+void Skype::setScanForUnread(bool value) {
+ d->scanForUnread = value;
+}
+
+void Skype::makeCall(const QString &userId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("CALL %1").arg(userId);
+}
+
+void Skype::acceptCall(const QString &callId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("SET CALL %1 STATUS INPROGRESS").arg(callId);
+}
+
+void Skype::hangUp(const QString &callId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("SET CALL %1 STATUS FINISHED").arg(callId);
+}
+
+void Skype::toggleHoldCall(const QString &callId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ const QString &status = (d->connection % QString("GET CALL %1 \
STATUS").arg(callId)).section(' ', 3, 3).toUpper(); + if ((status == "ONHOLD") || \
(status == "LOCALHOLD")) + d->connection << QString("SET CALL %1 STATUS \
INPROGRESS").arg(callId); + else
+ d->connection << QString("SET CALL %1 STATUS ONHOLD").arg(callId);
+}
+
+bool Skype::isCallIncoming(const QString &callId) {
+ const QString &type = (d->connection % QString("GET CALL %1 \
TYPE").arg(callId)).section(' ', 3, 3).toUpper(); + return ((type == "INCOMING_P2P") \
|| (type == "INCOMING_PSTN")); +}
+
+void Skype::getSkypeOut() {
+ const QString &curr = (d->connection % QString("GET PROFILE \
PSTN_BALANCE_CURRENCY")).section(' ', 2, 2).toUpper(); + if (curr.isEmpty()) {
+ emit skypeOutInfo(0, "");
+ } else {
+ int value = (d->connection % QString("GET PROFILE PSTN_BALANCE")).section(' ', 2, \
2).toUpper().toInt(); + emit skypeOutInfo(value, curr);
+ }
+}
+
+void Skype::enablePings(bool enabled) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->pings = enabled;
+
+ if (!enabled) {
+ d->pingTimer->stop();
+ return;
+ }
+
+ if (d->connStatus != csOffline) {
+ d->pingTimer->start(1000);
+ }
+}
+
+void Skype::ping() {
+ d->connection << QString("PING");
+}
+
+void Skype::setBus(int bus) {
+ d->bus = bus;
+}
+
+void Skype::setStartDBus(bool enabled) {
+ d->startDBus = enabled;
+}
+
+void Skype::setLaunchTimeout(int seconds) {
+ d->launchTimeout = seconds;
+}
+
+void Skype::setSkypeCommand(const QString &command) {
+ d->skypeCommand = command;
+}
+
+void Skype::setWaitConnect(int value) {
+ d->waitBeforeConnect = value;
+}
+
+void Skype::sendToChat(const QString &chat, const QString &message) {
+ kDebug() << k_funcinfo << endl;//some debug info`
+
+ if (d->connection.protocolVer() <= 4) {//Not able to handle it by the API, let \
Skype do it for me + d->connection << QString("OPEN CHAT %1 \
%2").arg(chat).arg(message); + emit gotMessageId("");
+ } else {
+ d->connection << QString("CHATMESSAGE %1 %2").arg(chat).arg(message);
+ }
+}
+
+void Skype::getTopic(const QString &chat) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ emit setTopic(chat, (d->connection % QString("GET CHAT %1 \
FRIENDLYNAME").arg(chat)).section(' ', 3).toUpper()); +}
+
+QString Skype::getMessageChat(const QString &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ return (d->connection % QString("GET CHATMESSAGE %1 \
CHATNAME").arg(message)).section(' ', 3, 3).toUpper(); +}
+
+QStringList Skype::getChatUsers(const QString &chat) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ const QString &me = getMyself();
+ const QString &rawUsers = (d->connection % QString("GET CHAT %1 \
MEMBERS").arg(chat)).section(' ', 3).toUpper(); + const QStringList &users = \
rawUsers.split(' '); + QStringList readyUsers;
+ for (QStringList::const_iterator it = users.begin(); it != users.end(); ++it) {
+ const QString &user = (*it).toUpper();
+ if (user.toUpper() != me.toUpper())
+ readyUsers.append(user);
+ }
+
+ return readyUsers;
+}
+
+QString Skype::getMyself() {
+ return (d->connection % QString("GET CURRENTUSERHANDLE")).section(' ', 1, \
1).toUpper(); +}
+
+void Skype::inviteUser(const QString &chatId, const QString &userId) {
+ kDebug() << k_funcinfo << " " << chatId << " " << userId << endl;//some debug info
+
+ if (d->connection.protocolVer() <= 4) {
+ KMessageBox::error(0L, i18n("This version of Skype does not support adding users \
to chat."), i18n("Skype Protocol")); + return;
+ }
+
+ d->connection << QString("ALTER CHAT %1 ADDMEMBERS %2").arg(chatId).arg(userId);
+}
+
+QString Skype::createChat(const QString &users) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ const QString &chatDesc = d->connection % QString("CHAT CREATE %1").arg(users);
+ kDebug() << "New chat ID: " << chatDesc.section(' ', 1, 1) << endl;
+ return chatDesc.section(' ', 1, 1);
+}
+
+void Skype::leaveChat(const QString &chatId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->connection << QString("ALTER CHAT %1 LEAVE").arg(chatId);
+}
+
+void Skype::removeContact(const QString &contactId) {
+ kDebug() << k_funcinfo << endl;
+
+ d->connection << QString("SET USER %1 BUDDYSTATUS 1").arg(contactId);
+}
+
+void Skype::addContact(const QString &contactId) {
+ kDebug() << k_funcinfo << endl;
+
+ d->connection % QString("SET USER %1 BUDDYSTATUS 2").arg(contactId);//do NOT parse \
this so the contact won't be created automatically +}
+
+void Skype::setAuthor(const QString &contactId, AuthorType author) {
+ kDebug() << k_funcinfo << endl;
+
+ switch (author) {
+ case Author:
+ d->connection << QString("SET USER %1 ISBLOCKED FALSE").arg(contactId);
+ d->connection << QString("SET USER %1 ISAUTHORIZED TRUE").arg(contactId);
+ break;
+ case Deny:
+ d->connection << QString("SET USER %1 ISBLOCKED FALSE").arg(contactId);
+ d->connection << QString("SET USER %1 ISAUTHORIZED FALSE").arg(contactId);
+ break;
+ case Block:
+ d->connection << QString("SET USER %1 ISBLOCKED TRUE").arg(contactId);
+ break;
+ }
+}
+
+Skype::AuthorType Skype::getAuthor(const QString &contactId) {
+ if ((d->connection % QString("GET USER %1 ISBLOCKED").arg(contactId)).section(' ', \
3, 3).toUpper() == "TRUE") + return Block;
+ else if ((d->connection % QString("GET USER %1 \
ISAUTHORIZED").arg(contactId)).section(' ', 3, 3).toUpper() == "TRUE") + return \
Author; + else
+ return Deny;
+}
+
+bool Skype::ableConference() {
+ return false;
+}
+
+#include "skype.moc"
Index: kopete/protocols/skype/skypechatsession.h
===================================================================
--- kopete/protocols/skype/skypechatsession.h (revision 0)
+++ kopete/protocols/skype/skypechatsession.h (revision 0)
@@ -0,0 +1,133 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPECHATSESSION_H
+#define SKYPECHATSESSION_H
+
+#include <kopetechatsession.h>
+
+class SkypeProtocol;
+class SkypeAccount;
+class SkypeContact;
+class SkypeChatSessionPrivate;
+
+/**
+ * The chat session for the Skype protocol
+ * @author Michal Vaner (VORNER) <michal.vaner@kdemail.net>
+ */
+class SkypeChatSession : public Kopete::ChatSession
+{
+ Q_OBJECT
+ private:
+ ///The insides of the chat session
+ SkypeChatSessionPrivate *d;
+ private slots:
+ ///sends message to the skype user who this chat belongs to
+ void message(Kopete::Message&);
+ /**This disables permanently the call button when the chat becomes a multi-user \
chat + * @todo make this unneeded and allow multiple-user calls
+ */
+ void disallowCall();
+ ///Do a call to all participants of the chat (in future, now it allows only one at \
onece) + void callChatSession();
+ public:
+ /**
+ * Constructor. The chat session will be created with first message coming out.
+ * @param account The account it belongs to
+ * @param other The other side. There it no way user could create chat with more \
than one user at once. If user is invited to chat by someone, the other constructor \
should be used. It is automatically registered in the manager. + */
+ SkypeChatSession(SkypeAccount *account, SkypeContact *other);
+ /**
+ * Constructor from chat session.
+ * Use this one if user is invited to an existing chat or if the first message in \
that chat was incoming message. The list of users will be loaded at startup. It is \
automatically registered in the manager. + * @param account The account this \
belongs to. + * @param session Identificator of the chat session in skype. The list \
of users will be loaded in startup and therefore they are not needed to be specified. \
+ */ + SkypeChatSession(SkypeAccount *account, const QString &session, const \
Kopete::ContactPtrList &contacts); + ///Destructor
+ ~SkypeChatSession();
+ /**
+ * Invites a contact to the chat
+ * @param contactId What contact
+ */
+ virtual void inviteContact(const QString &contactId);
+ public slots:
+ /**
+ * Update the chat topic
+ * @param chat What chat is it about? Maybe me?
+ * @param topic What to set as topic
+ */
+ void setTopic(const QString &chat, const QString &topic);
+ /**
+ * Set this chat's ID
+ * @param chatId The new ID
+ */
+ void setChatId(const QString &chatId);
+ /**
+ * Add new user to chat
+ * @param chat To know if he joined this chat
+ * @param userId ID of that user
+ */
+ void joinUser(const QString &chat, const QString &userId);
+ /**
+ * Some user left the chat
+ * @param chat Is it this chat?
+ * @param userId ID of that user
+ * @param reason Why he left
+ */
+ void leftUser(const QString &chat, const QString &userId, const QString &reason);
+ /**
+ * This will add message that has been sent out by this user
+ * @param recv List of receivers. If there are more than one, replaced by an dummy \
contact of that chat, because it does crash kopete otherwise + * @param body Text \
to show + */
+ void sentMessage(const QList<Kopete::Contact*> *recv, const QString &body);
+ signals:
+ /**
+ * This is emited when it become a multi-user chat. It should be removed from the \
contact so when user clicks on the contact, new one with only that one should be \
created + * @param chatSession Identificator of the chat
+ * @param previousUser Id of the other user before it became a multichat or empty \
string if no such user ever was + * @param sender Pointer to the chat session that \
emited this + */
+ void becameMultiChat(const QString &chatSession, SkypeChatSession *sender);
+ /**
+ * This is emited when there is an request to get a frindly name of a chat
+ * @param chat Id of that chat
+ */
+ void wantTopic(const QString &chat);
+ /**
+ * This chat's ID has changed
+ * @param oldId What was before? If it is the first set of the ID, it is empty
+ * @param newId The new ID. If it is empty, it means that this chat is being \
deleted right now and should be removed from all lists + * @param sender Pointer to \
that chat + */
+ void updateChatId(const QString &oldId, const QString &newId, SkypeChatSession \
*sender); + /**
+ * Request inviting user to a chat
+ * @param chatId What chat
+ * @param userId What user
+ */
+ void inviteUserToChat(const QString &chatId, const QString &userId);
+ /**
+ * Request leaving the chat
+ * @param chatId What chat
+ */
+ void leaveChat(const QString &chatId);
+};
+
+#endif
Index: kopete/protocols/skype/skypedetails.h
===================================================================
--- kopete/protocols/skype/skypedetails.h (revision 0)
+++ kopete/protocols/skype/skypedetails.h (revision 0)
@@ -0,0 +1,78 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPEDETAILS_H
+#define SKYPEDETAILS_H
+
+#include <ui_skypedetailsbase.h>
+
+class QString;
+class SkypeAccount;
+namespace Ui { class SkypeDetailsBase; }
+
+/**
+ * @author Michal Vaner (VORNER) <michal.vaner@kdemail.net>
+ * Dialog that shows users details
+ */
+class SkypeDetails : public QDialog, private Ui::SkypeDetailsBase {
+//class SkypeDetails : public Ui::SkypeDetailsBase {
+ Q_OBJECT
+ private:
+ SkypeAccount *account;
+ protected slots:
+ void changeAuthor(int item);
+ protected:
+ ///Make sure it is deleted after it is closed
+ void closeEvent(QCloseEvent *e);
+ public:
+ ///Just constructor
+ SkypeDetails();
+ ///Only a destructor
+ ~SkypeDetails();
+ public slots:
+ /**
+ * Sets the ID, the nick and the name
+ * @param id The ID of the user
+ * @param nick user's nick
+ * @param name user's full name
+ */
+ SkypeDetails &setNames(const QString &id, const QString &nick, const QString \
&name); + /**
+ * Sets the phone numbers what will be showed
+ * @param priv The private phone number
+ * @param mobile The mobile phone
+ * @param work The work phone
+ */
+ SkypeDetails &setPhones(const QString &priv, const QString &mobile, const QString \
&work); + /**
+ * Sets the homepage
+ * @param homepage The value to set
+ */
+ SkypeDetails &setHomepage(const QString &homepage);
+ /**
+ * Sets the users authorization
+ * @param author The authorization - 0 = authorized, 1 = not authorized, 2 = \
blocked + */
+ SkypeDetails &setAuthor(int author, SkypeAccount *account);
+ /**
+ * Sets the string to show in 'sex' edit box
+ */
+ SkypeDetails &setSex(const QString &sex);
+};
+
+#endif
Index: kopete/protocols/skype/skypecalldialog.cpp
===================================================================
--- kopete/protocols/skype/skypecalldialog.cpp (revision 0)
+++ kopete/protocols/skype/skypecalldialog.cpp (revision 0)
@@ -0,0 +1,296 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include <qstring.h>
+#include <kdebug.h>
+#include <qlabel.h>
+#include <klocale.h>
+#include <qpushbutton.h>
+#include <qtimer.h>
+#include <kglobal.h>
+#include <qdatetime.h>
+
+#include "skypecalldialog.h"
+#include "skypeaccount.h"
+
+typedef enum {
+ csNotRunning,
+ csOnHold,
+ csInProgress,
+ csShuttingDown
+} callStatus;
+
+class SkypeCallDialogPrivate {
+ public:
+ ///The call is done by some account
+ SkypeAccount *account;
+ ///The other side
+ QString userId;
+ ///Id of the call
+ QString callId;
+ ///Was there some error?
+ bool error;
+ ///The timer for updating call info
+ QTimer *updater;
+ ///The status of the call
+ callStatus status;
+ ///The time the call is running or on hold (in halfes of seconds)
+ int totalTime;
+ ///The time the call is actually running (in halfes of seconds)
+ int callTime;
+ ///Did I reported the ed of call already?
+ bool callEnded;
+ ///Report that the call has ended, please
+ void endCall() {
+ if (!callEnded) {
+ callEnded = true;
+ account->endCall();
+ }
+ };
+};
+
+SkypeCallDialog::SkypeCallDialog(const QString &callId, const QString &userId, \
SkypeAccount *account) : QDialog() { +//SkypeCallDialog::SkypeCallDialog(const \
QString &callId, const QString &userId, SkypeAccount *account) : \
Ui::SkypeCallDialogBase() { + kDebug() << k_funcinfo << endl;//some debug info
+
+ //Initialize values
+ d = new SkypeCallDialogPrivate();
+ d->account = account;
+ d->callId = callId;
+ d->userId = userId;
+ d->error = false;
+ d->status = csNotRunning;
+ d->totalTime = 0;
+ d->callTime = 0;
+ d->callEnded = false;
+
+ d->updater = new QTimer();
+ connect(d->updater, SIGNAL(timeout()), this, SLOT(updateCallInfo()));
+ d->updater->start(500);
+
+ NameLabel->setText(account->getUserLabel(userId));
+
+ //Show the window
+ show();
+ //TODO: Port to kde4
+ //KWin::activateWindow(winId());
+}
+
+
+SkypeCallDialog::~SkypeCallDialog(){
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ emit callFinished(d->callId);
+ d->endCall();
+
+ delete d->updater;
+ delete d;
+}
+
+void SkypeCallDialog::updateStatus(const QString &callId, const QString &status) {
+ kDebug() << k_funcinfo << "Status: " << status << endl;//some debug info
+
+ if (callId == d->callId) {
+ if (status == "CANCELLED") {
+ HoldButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("Canceled"));
+ closeLater();
+ d->status = csNotRunning;
+ } else if (status == "BUSY") {
+ HoldButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("Other person is busy"));
+ closeLater();
+ d->status = csNotRunning;
+ } else if (status == "REFUSED") {
+ HoldButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("Refused"));
+ closeLater();
+ d->status = csNotRunning;
+ } else if (status == "MISSED") {
+ HoldButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ AcceptButton->setEnabled(true);
+ AcceptButton->setText(i18n("Call Back"));
+ StatusLabel->setText(i18n("Missed"));
+ d->status = csNotRunning;
+ disconnect(AcceptButton, SIGNAL(clicked()), this, SLOT(acceptCall()));
+ connect(AcceptButton, SIGNAL(clicked()), this, SLOT(callBack()));
+ } else if (status == "FINISHED") {
+ HoldButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("Finished"));
+ closeLater();
+ d->status = csNotRunning;
+ } else if (status == "LOCALHOLD") {
+ HoldButton->setEnabled(true);
+ HoldButton->setText(i18n("Resume"));
+ HangButton->setEnabled(true);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("On hold (local)"));
+ d->status = csOnHold;
+ } else if (status == "REMOTEHOLD") {
+ HoldButton->setEnabled(false);
+ HangButton->setEnabled(true);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("On hold (remote)"));
+ d->status = csOnHold;
+ } else if (status == "ONHOLD") {
+ HoldButton->setEnabled(true);
+ HangButton->setEnabled(true);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("On hold"));
+ d->status = csOnHold;
+ } else if (status == "INPROGRESS") {
+ HoldButton->setEnabled(true);
+ HoldButton->setText(i18n("Hold"));
+ HangButton->setEnabled(true);
+ AcceptButton->setEnabled(false);
+ StatusLabel->setText(i18n("In progress"));
+ d->status=csInProgress;
+ } else if (status == "RINGING") {
+ HoldButton->setEnabled(false);
+ AcceptButton->setEnabled(d->account->isCallIncoming(callId));
+ HangButton->setEnabled(true);
+ StatusLabel->setText(i18n("Ringing"));
+ d->status = csNotRunning;
+ } else if (status == "FAILED") {
+ if (d->error) //This one is already handled
+ return;
+ HoldButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ StatusLabel->setText(i18n("Failed"));
+ d->status = csNotRunning;
+ } else if (status == "ROUTING") {
+ HoldButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ HangButton->setEnabled(true);
+ StatusLabel->setText(i18n("Connecting"));
+ d->status = csNotRunning;
+ } else if (status == "EARLYMEDIA") {
+ HoldButton->setEnabled(false);
+ AcceptButton->setEnabled(false);
+ HangButton->setEnabled(true);
+ StatusLabel->setText(i18n("Early media (waitong for operator..)"));
+ d->status = csNotRunning;
+ } else if (status == "UNPLACED") {//Ups, whats that, how that call got here?
+ deleteLater();//Just give up, this one is odd
+ }
+ }
+}
+
+void SkypeCallDialog::acceptCall() {
+ d->account->startCall();
+ emit acceptTheCall(d->callId);
+}
+
+void SkypeCallDialog::hangUp() {
+ emit hangTheCall(d->callId);
+}
+
+void SkypeCallDialog::holdCall() {
+ emit toggleHoldCall(d->callId);
+}
+
+void SkypeCallDialog::closeEvent(QCloseEvent *) {
+ emit hangTheCall(d->callId);//Finish the call before you give up
+ deleteLater();//some kind of suicide
+}
+
+void SkypeCallDialog::deathTimeout() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ deleteLater();//OK, the death is here :-)
+}
+
+void SkypeCallDialog::closeLater() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->endCall();
+
+ if ((d->account->closeCallWindowTimeout()) && (d->status != csShuttingDown)) {
+ QTimer::singleShot(1000 * d->account->closeCallWindowTimeout(), this, \
SLOT(deathTimeout())); + d->status = csShuttingDown;
+ }
+}
+
+void SkypeCallDialog::updateError(const QString &callId, const QString &message) {
+ kDebug() << k_funcinfo << endl;//some debug info
+ if (callId == d->callId) {
+ AcceptButton->setEnabled(false);
+ HangButton->setEnabled(false);
+ HoldButton->setEnabled(false);
+ StatusLabel->setText(i18n("Failed (%1)").arg(message));
+ closeLater();
+ d->error = true;
+ }
+}
+
+void SkypeCallDialog::updateCallInfo() {
+ switch (d->status) {
+ case csInProgress:
+ if (d->callTime % 20 == 0)
+ emit updateSkypeOut();//update the skype out
+ ++d->callTime;
+ //Do not break, do that as well
+ case csOnHold:
+ ++d->totalTime;
+ default:
+ ;//Get rid of that stupid warning about not handled value in switch
+ }
+ const QString &activeTime = \
KGlobal::locale()->formatTime(QTime().addSecs(d->callTime / 2), true, true); + const \
QString &totalTime = KGlobal::locale()->formatTime(QTime().addSecs(d->totalTime / 2), \
true, true); + TimeLabel->setText(i18n("%1 active\n%2 \
total").arg(activeTime).arg(totalTime)); +}
+
+void SkypeCallDialog::skypeOutInfo(int balance, const QString ¤cy) {
+ float part;//How to change the balance before showing (multiply by this)
+ QString symbol;//The symbol of the currency is
+ int digits;
+ if (currency == "EUR") {
+ part = 0.01;//It's in cent's not in euros
+ symbol = i18n("€");
+ digits = 2;
+ } else {
+ CreditLabel->setText(i18n("Skypeout inactive"));
+ return;
+ }
+ float value = balance * part;
+ CreditLabel->setText(KGlobal::locale()->formatMoney(value, symbol, digits));
+}
+
+void SkypeCallDialog::chatUser() {
+ d->account->chatUser(d->userId);
+}
+
+void SkypeCallDialog::callBack() {
+ deleteLater();//close this window
+
+ d->account->makeCall(d->userId);
+}
+
+
+#include "skypecalldialog.moc"
Index: kopete/protocols/skype/skypecontact.cpp
===================================================================
--- kopete/protocols/skype/skypecontact.cpp (revision 0)
+++ kopete/protocols/skype/skypecontact.cpp (revision 0)
@@ -0,0 +1,452 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#include "skypecontact.h"
+#include "skypeaccount.h"
+#include "skypeprotocol.h"
+#include "skypechatsession.h"
+#include "skypedetails.h"
+
+#include <kdebug.h>
+#include <qstring.h>
+#include <kopetemessage.h>
+#include <kopetechatsession.h>
+#include <kopetechatsessionmanager.h>
+#include <kopeteproperty.h>
+#include <kaction.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+typedef enum {
+ osOffline,
+ osOnline,
+ osAway,
+ osNA,
+ osDND,
+ osSkypeOut,
+ osSkypeMe
+} onlineStatus;
+
+typedef enum {
+ bsNotInList,
+ bsNoAuth,
+ bsInList
+} buddyStatus;
+
+class SkypeContactPrivate {
+ public:
+ ///Full name of the contact
+ QString fullName;
+ ///Acount that this contact belongs to
+ SkypeAccount *account;
+ ///Is it some user or is it something special (myself contact or such)
+ bool user;
+ ///Online status
+ onlineStatus status;
+ ///Buddy status
+ buddyStatus buddy;
+ ///The chat session
+ SkypeChatSession *session;
+ ///The action to call the user
+ KAction *callContactAction;
+ ///Authorization action
+ KAction *authorizeAction;
+ ///Remove authorization action
+ KAction *disAuthorAction;
+ ///Block user action
+ KAction *blockAction;
+ ///The private phone
+ QString privatePhone;
+ ///The private mobile phone
+ QString privateMobile;
+ ///The work phone
+ QString workPhone;
+ ///The homepage
+ QString homepage;
+ ///The contacts sex
+ QString sex;
+};
+
+SkypeContact::SkypeContact(SkypeAccount *account, const QString &id, \
Kopete::MetaContact *parent, bool user) + : Kopete::Contact(account, id, parent, \
QString::null) { + kDebug() << k_funcinfo << endl;//some debug info
+
+ d = new SkypeContactPrivate;//create the insides
+ d->session = 0L;//no session yet
+ d->account = account;//save the account for future, it will be needed
+ connect(this, SIGNAL(setCallPossible(bool )), this, SLOT(enableCall(bool )));
+ account->prepareContact(this);//let the account prepare us
+ d->user = user;
+
+ //TODO: Port to kde4
+ /*d->callContactAction = new KAction( this );
+ d->callContactAction->setIcon( (KIcon("call") ) );
+ d->callContactAction->setText( i18n ("Call (by Skype)") );
+ d->callContactAction->setEnabled( true );
+ connect(d->callContactAction, SIGNAL(triggered(bool)), SLOT(callContacts()));
+
+ * KAction *newAct = actionCollection()->addAction("quick-connect");
+ * newAct->setText(i18n("Quick Connect"))
+ * newAct->setIcon(KIcon("quick-connect"));
+ * newAct->setShortcut(Qt::Key_F6);
+ * connect(newAct, SIGNAL(triggered()), this, SLOT(quickConnect()));*/
+
+ /*d->callContactAction = new KAction(i18n("Call Contact"), "call", KShortcut(), \
this, SLOT(call()), this, "call_contact"); + d->authorizeAction = new \
KAction(i18n("(Re)send Authorization To"), "mail_forward", KShortcut(), this, \
SLOT(authorize()), this, "authorize_contact"); + d->disAuthorAction = new \
KAction(i18n("Remove Authorization From"), "mail_delete", KShortcut(), this, \
SLOT(disAuthor()), this, "dis_authorize_contact"); + d->blockAction = new \
KAction(i18n("Block"), "cancel", KShortcut(), this, SLOT(block()), this, \
"block_contact");*/ +
+ d->callContactAction = new KAction( this );
+ d->callContactAction->setText( i18n ("Call Contact") );
+ d->callContactAction->setIcon( (KIcon("call") ) );
+ connect(d->callContactAction, SIGNAL(triggered()), SLOT(call()));
+
+ d->authorizeAction = new KAction( this );
+ d->authorizeAction->setText( i18n ("(Re)send Authorization To") );
+ d->authorizeAction->setIcon( (KIcon("mail_forward") ) );
+ connect(d->authorizeAction, SIGNAL(triggered()), SLOT(authorize()));
+
+ d->authorizeAction = new KAction( this );
+ d->authorizeAction->setText( i18n ("Remove Authorization From") );
+ d->authorizeAction->setIcon( (KIcon("mail_delete") ) );
+ connect(d->authorizeAction, SIGNAL(triggered()), SLOT(disAuthor()));
+
+ statusChanged();//This one takes care of disabling/enabling this action depending \
on the user's status. +
+ //connect(this, SIGNAL(onlineStatusChanged(Kopete::Contact*,const \
Kopete::OnlineStatus&,const Kopete::OnlineStatus&)), this, SLOT(statusChanged())); \
+ if (account->canComunicate() && user) + emit infoRequest(contactId());//retrieve \
information +
+ setNickName(id);//Just default, should be replaced later by something..
+
+ setOnlineStatus(account->protocol()->Offline);
+}
+
+SkypeContact::~SkypeContact() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ //free memory
+ delete d;
+}
+
+Kopete::ChatSession *SkypeContact::manager(Kopete::Contact::CanCreateFlags \
CanCreate) { + kDebug() << k_funcinfo << endl;//some debug info
+
+ if ((!d->session) && (CanCreate)) {//It is not there and I can create it
+ d->session = new SkypeChatSession(d->account, this);
+ connect(d->session, SIGNAL(destroyed()), this, SLOT(removeChat()));//Care about \
loosing the session + connect(d->session, SIGNAL(becameMultiChat(const QString&, \
SkypeChatSession* )), this, SLOT(removeChat()));//This means it no longer belongs to \
this user + }
+
+ return d->session;//and return it
+}
+
+void SkypeContact::serialize(QMap<QString, QString> &serializedData, QMap<QString, \
QString> &) { + kDebug() << k_funcinfo << endl;//some debug info
+
+ serializedData["contactId"] = contactId();//save the ID
+}
+
+void SkypeContact::requestInfo() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->user)
+ emit infoRequest(contactId());//just ask for the info
+}
+
+void SkypeContact::setInfo(const QString &change) {
+ kDebug() << k_funcinfo << endl;//some debug info
+ kDebug() << "info is: " << change << endl;//some debug info
+
+ const QString &receivedProperty = change.section(' ', 0, 0).toUpper();//get the \
first part + if (receivedProperty == "FULLNAME") {
+ setProperty( Kopete::Global::Properties::self()->fullName(), change.section(' ', \
1) );//save the name + } else if (receivedProperty == "DISPLAYNAME") {
+ const QString &name = change.section(' ', 1);//get the name
+ if (name.isEmpty())
+ setNickName( property( Kopete::Global::Properties::self()->fullName() \
).value().toString() ); + else
+ setNickName(name);//set the display name
+ } else if (receivedProperty == "ONLINESTATUS") {//The online status eather changed \
or we just logged in and I asked for it + const QString &status = change.section(' \
', 1, 1).toUpper();//get the status +
+ if (status == "OFFLINE") {
+ d->status = osOffline;
+ } else if (status == "ONLINE") {
+ d->status = osOnline;
+ } else if (status == "AWAY") {
+ d->status = osAway;
+ } else if (status == "NA") {
+ d->status = osNA;
+ } else if (status == "DND") {
+ d->status = osDND;
+ } else if (status == "SKYPEOUT") {
+ d->status = osSkypeOut;
+ } else if (status == "SKYPEME") {
+ d->status = osSkypeMe;
+ }
+
+ resetStatus();
+ } else if (receivedProperty == "BUDDYSTATUS") {
+ int value = change.section(' ', 1, 1).toInt();//get the value
+
+ switch (value) {
+ case 0:
+ d->buddy = bsNotInList;
+ break;
+ case 1:
+ d->buddy = bsNotInList;
+ return;
+ case 2:
+ d->buddy = bsNoAuth;
+ break;
+ case 3:
+ d->buddy = bsInList;
+ break;
+ }
+
+ resetStatus();
+ } else
+ {
+ QString propValue = change.section(' ', 1);
+ if ( !propValue.isEmpty() )
+ {
+ if ( receivedProperty == "PHONE_HOME" ) {
+ setProperty( d->account->protocol()->propPrivatePhone, change.section(' ', 1) );
+ d->privatePhone = change.section(' ', 1);
+ } else if ( receivedProperty == "PHONE_OFFICE" ) {
+ setProperty( d->account->protocol()->propWorkPhone, change.section(' ', 1) );
+ d->workPhone = change.section(' ', 1);
+ } else if ( receivedProperty == "PHONE_MOBILE" ) {
+ setProperty(d->account->protocol()->propPrivateMobilePhone, change.section(' ', \
1) ); + d->privateMobile = change.section(' ', 1);
+ } else if ( receivedProperty == "HOMEPAGE" ) {
+ //setProperty( d->account->protocol()->propPrivateMobilePhone, change.section(' \
', 1) ); << This is odd, isn't it? + d->homepage = change.section(' ', 1);
+ } else if (receivedProperty == "SEX") {
+ if (change.section(' ', 1).toUpper() == "MALE") {
+ d->sex = i18n("Male");
+ } else if (change.section(' ', 1).toUpper() == "FEMALE") {
+ d->sex = i18n("Female");
+ } else
+ d->sex = "";
+ }
+ }
+ }
+}
+
+QString SkypeContact::formattedName() const {
+ if (!d->user)
+ return nickName();
+ return d->fullName;
+}
+
+void SkypeContact::resetStatus() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ SkypeProtocol * protocol = d->account->protocol();//get the protocol
+
+ if (d->status == osSkypeOut) {
+ setOnlineStatus(protocol->Phone);//this is the SkypeOut contact, in many ways \
special + return;
+ }
+
+ switch (d->buddy) {
+ case bsNotInList:
+ setOnlineStatus(protocol->NotInList);
+ return;
+ case bsNoAuth:
+ setOnlineStatus(protocol->NoAuth);
+ return;
+ case bsInList://just put there normal status
+ break;
+ }
+
+ switch (d->status) {
+ case osOffline:
+ setOnlineStatus(protocol->Offline);
+ break;
+ case osOnline:
+ setOnlineStatus(protocol->Online);
+ break;
+ case osAway:
+ setOnlineStatus(protocol->Away);
+ break;
+ case osNA:
+ setOnlineStatus(protocol->NotAvailable);
+ break;
+ case osDND:
+ setOnlineStatus(protocol->DoNotDisturb);
+ break;
+ case osSkypeOut:
+ setOnlineStatus(protocol->Phone);
+ break;
+ case osSkypeMe:
+ setOnlineStatus(protocol->SkypeMe);
+ break;
+ }
+}
+
+bool SkypeContact::isReachable() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ const Kopete::OnlineStatus &st = d->account->myself()->onlineStatus();
+ if ((st == d->account->protocol()->Offline) || (st == \
d->account->protocol()->Connecting)) + return false;
+
+ switch (d->buddy) {
+ case bsNotInList:
+ case bsNoAuth://I do not know, weather he is online, but I will send it trough the \
server + return true;
+ case bsInList:
+ break;//Do it by online status
+ }
+
+ switch (d->status) {
+ //case osOffline://he is offline
+ case osSkypeOut://This one can not get messages, it is skype-out contact
+ return false;
+ default://some kind of online
+ return true;
+ }
+}
+
+void SkypeContact::removeChat() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->session = 0L;//it exists no more or it is no longer of this contact
+}
+
+bool SkypeContact::hasChat() const {
+ return d->session;//does it have a chat session?
+}
+
+void SkypeContact::receiveIm(const QString &message, const QString &chat) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (!hasChat()) {
+ manager(CanCreate);//create it
+ if (!hasChat())//something failed
+ return;
+ }
+
+ Kopete::Message mes(this, d->account->myself());//create the message
+ mes.setDirection(Kopete::Message::Inbound);
+ mes.setPlainBody(message);
+ d->session->setChatId(chat);
+ d->session->appendMessage(mes);//add it to the session
+}
+
+QList<KAction*> *SkypeContact::customContextMenuActions() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->account->myself() == this)
+ return 0L;
+
+ QList<KAction*> *actions = new QList<KAction*>();
+
+ actions->append(d->callContactAction);
+ actions->append(d->authorizeAction);
+ actions->append(d->disAuthorAction);
+ actions->append(d->blockAction);
+
+ return actions;
+}
+
+void SkypeContact::enableCall(bool value) {
+ d->callContactAction->setEnabled(value);
+}
+
+void SkypeContact::statusChanged() {
+ SkypeProtocol * protocol = d->account->protocol();
+ const Kopete::OnlineStatus &myStatus = (d->account->myself()) ? \
d->account->myself()->onlineStatus() : protocol->Offline; + if \
(d->account->canAlterAuth()) { + d->authorizeAction->setEnabled(true);
+ d->disAuthorAction->setEnabled(true);
+ d->blockAction->setEnabled(true);
+ } else {
+ d->authorizeAction->setEnabled(false);
+ //TODO: Port to kde4, normaly kopete crashed
+ //d->disAuthorAction->setEnabled(false);
+ //d->blockAction->setEnabled(false);
+ }
+ if (this == d->account->myself()) {
+ emit setCallPossible(false);
+ } else if ((myStatus == protocol->Online) || (myStatus == protocol->Away) || \
(myStatus == protocol->NotAvailable) || (myStatus == protocol->DoNotDisturb) || \
(myStatus == protocol->NoAuth) || (myStatus == protocol->NotInList) || (myStatus == \
protocol->Phone) || (myStatus == protocol->SkypeMe)) + emit setCallPossible(true);
+ else
+ emit setCallPossible(false);
+}
+
+void SkypeContact::call() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->account->makeCall(this);
+}
+
+void SkypeContact::connectionStatus(bool connected) {
+ if (connected) {
+ statusChanged();
+ } else
+ emit setCallPossible(false);
+}
+
+SkypeChatSession *SkypeContact::getChatSession() {
+ return d->session;
+}
+
+bool SkypeContact::canCall() const {
+ if (!d->account->canComunicate())
+ return false;
+ if (!d->callContactAction)
+ return false;
+ return d->callContactAction->isEnabled();
+}
+
+void SkypeContact::slotUserInfo() {
+ kDebug() << k_funcinfo << endl;
+
+ (new SkypeDetails)->setNames(contactId(), nickName(), \
formattedName()).setPhones(d->privatePhone, d->privateMobile, \
d->workPhone).setHomepage(d->homepage).setAuthor(d->account->getAuthor(contactId()), \
d->account).setSex(d->sex); +}
+
+void SkypeContact::deleteContact() {
+ d->account->removeContact(contactId());
+ deleteLater();
+}
+
+void SkypeContact::sync(unsigned int changed) {
+ kDebug() << k_funcinfo << endl;
+
+ if (changed & MovedBetweenGroup) {
+ d->account->registerContact(contactId());
+ }
+}
+
+void SkypeContact::authorize() {
+ d->account->authorizeUser(contactId());
+}
+
+void SkypeContact::disAuthor() {
+ d->account->disAuthorUser(contactId());
+}
+
+void SkypeContact::block() {
+ d->account->blockUser(contactId());
+}
+
+#include "skypecontact.moc"
Index: kopete/protocols/skype/call_start
===================================================================
--- kopete/protocols/skype/call_start (revision 0)
+++ kopete/protocols/skype/call_start (revision 0)
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+kill -9 `ps -A | grep artsd` && artsd -a null &
+sleep 0.2
+
Property changes on: kopete/protocols/skype/call_start
___________________________________________________________________
Added: svn:executable
+ *
Index: kopete/protocols/skype/skypeaccount.cpp
===================================================================
--- kopete/protocols/skype/skypeaccount.cpp (revision 0)
+++ kopete/protocols/skype/skypeaccount.cpp (revision 0)
@@ -0,0 +1,883 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include "skypeaccount.h"
+#include "skypeprotocol.h"
+#include "skypecontact.h"
+#include "skype.h"
+#include "skypecalldialog.h"
+#include "skypechatsession.h"
+#include "skypeconference.h"
+
+#include <qstring.h>
+#include <kopetemetacontact.h>
+#include <kopeteonlinestatus.h>
+#include <kopetecontactlist.h>
+#include <kopetecontact.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kconfigbase.h>
+#include <Q3Dict>
+#include <kopetemessage.h>
+#include <kprocess.h>
+
+class SkypeAccountPrivate {
+ public:
+ ///The skype protocol pointer
+ SkypeProtocol *protocol;
+ ///ID of this account (means my skype name)
+ QString ID;
+ ///The skype back-end
+ Skype skype;
+ ///The hitchhike mode of incoming messages
+ bool hitch;
+ ///The mark read messages mode
+ bool markRead;
+ ///Search for unread messages on login?
+ bool searchForUnread;
+ ///Do we show call control window?
+ bool callControl;
+ ///Metacontact for all users that aren't in the list
+ Kopete::MetaContact notInListUsers;
+ ///Constructor
+ SkypeAccountPrivate(SkypeAccount &account) : skype(account) {};//just an empty \
constructor + ///Automatic close of call window when the call finishes (in seconds, \
0 -> disabled) + int callWindowTimeout;
+ ///Are the pings enabled?
+ bool pings;
+ ///What bus are we using, session (0) or system (1)?
+ int bus;
+ ///Do we start DBus if needed?
+ bool startDBus;
+ ///How long can I keep trying connect to newly started skype, before I give up \
(seconds) + int launchTimeout;
+ ///By what command is the skype started?
+ QString skypeCommand;
+ ///What is my name, by the way?
+ QString myName;
+ ///Do we wait before connecting?
+ int waitBeforeConnect;
+ ///List of chat all chat sessions
+ Q3Dict<SkypeChatSession> sessions;
+ //QList<SkypeChatSession*> sessions;
+ ///Last used chat session
+ SkypeChatSession *lastSession;
+ ///List of the conference calls
+ Q3Dict<SkypeConference> conferences;
+ //QList<SkypeConference*> conferences;
+ ///List of existing calls
+ Q3Dict<SkypeCallDialog> calls;
+ //QList<SkypeCallDialog*> calls;
+ ///Shall chat window leave the chat whenit is closed
+ bool leaveOnExit;
+ ///Executed before making the call
+ QString startCallCommand;
+ ///Executed after finished the call
+ QString endCallCommand;
+ ///Wait for the start call command to finitsh?
+ bool waitForStartCallCommand;
+ ///Execute the end call command only if no other calls exists?
+ bool endCallCommandOnlyLats;
+ ///How many calls are opened now?
+ int callCount;
+ ///Command executed on incoming call
+ QString incommingCommand;
+};
+
+SkypeAccount::SkypeAccount(SkypeProtocol *protocol) : Kopete::Account(protocol, \
QString::null ) { + kDebug() << k_funcinfo << endl;//some debug info
+
+ //keep track of what accounts the protocol has
+ protocol->registerAccount(this);
+
+ //the d pointer
+ d = new SkypeAccountPrivate(*this);
+ d->calls.setAutoDelete(false);
+ d->conferences.setAutoDelete(false);
+ //remember the protocol, it will be needed
+ d->protocol = protocol;
+
+ //load the properties
+ KConfigGroup *config = configGroup();
+ author = config->readEntry("Authorization");//get the name how to authorize myself
+ launchType = config->readEntry("Launch", 1);//launch the skype?
+ setScanForUnread(config->readEntry("ScanForUnread", true));
+ setCallControl(config->readEntry("CallControl", false));
+ setPings(config->readEntry("Pings", true));
+ setBus(config->readEntry("Bus", 1));
+ //setStartDBus(config->readEntry("StartDBus", false));
+ ///@todo Once Dbus launching works, remove this v and uncomment this ^
+ setStartDBus(false);
+ setLaunchTimeout(config->readEntry("LaunchTimeout", 30));
+ d->myName = config->readEntry("MyselfName", "Skype");
+ setSkypeCommand(config->readEntry("SkypeCommand", "skype"));
+ setWaitBeforeConnect(config->readEntry("WaitBeforeConnect", 10));
+ setLeaveOnExit(config->readEntry("LeaveOnExit", true));
+ setStartCallCommand(config->readEntry("StartCallCommand", ""));
+ setEndCallCommand(config->readEntry("EndCallCommand", ""));
+ setWaitForStartCallCommand(config->readEntry("WaitForStartCallCommand", false));
+ setEndCallCommandOnlyForLast(config->readEntry("EndCallCommandOnlyLast", false));
+ setIncomingCommand(config->readEntry("IncomingCall", ""));
+
+ //create myself contact
+ SkypeContact *_myself = new SkypeContact(this, "Skype", \
Kopete::ContactList::self()->myself(), false); + setMyself(_myself);
+ //and set default online status (means offline)
+ myself()->setOnlineStatus(protocol->Offline);
+
+ //Now, connect the signals
+ QObject::connect(&d->skype, SIGNAL(wentOnline()), this, SLOT(wentOnline()));
+ QObject::connect(&d->skype, SIGNAL(wentOffline()), this, SLOT(wentOffline()));
+ QObject::connect(&d->skype, SIGNAL(wentAway()), this, SLOT(wentAway()));
+ QObject::connect(&d->skype, SIGNAL(wentNotAvailable()), this, \
SLOT(wentNotAvailable())); + QObject::connect(&d->skype, SIGNAL(wentDND()), this, \
SLOT(wentDND())); + QObject::connect(&d->skype, SIGNAL(wentInvisible()), this, \
SLOT(wentInvisible())); + QObject::connect(&d->skype, SIGNAL(wentSkypeMe()), this, \
SLOT(wentSkypeMe())); + QObject::connect(&d->skype, SIGNAL(statusConnecting()), this, \
SLOT(statusConnecting())); + QObject::connect(&d->skype, SIGNAL(newUser(const \
QString&)), this, SLOT(newUser(const QString&))); + QObject::connect(&d->skype, \
SIGNAL(contactInfo(const QString&, const QString& )), this, \
SLOT(updateContactInfo(const QString&, const QString& ))); \
+ QObject::connect(&d->skype, SIGNAL(receivedIM(const QString&, const QString&, const \
QString& )), this, SLOT(receivedIm(const QString&, const QString&, const QString& \
))); + QObject::connect(&d->skype, SIGNAL(gotMessageId(const QString& )), this, \
SLOT(gotMessageId(const QString& )));//every time some ID is known inform the \
contacts + QObject::connect(&d->skype, SIGNAL(newCall(const QString&, const \
QString&)), this, SLOT(newCall(const QString&, const QString&))); \
+ QObject::connect(&d->skype, SIGNAL(setMyselfName(const QString&)), this, \
SLOT(setMyselfName(const QString& ))); + QObject::connect(&d->skype, \
SIGNAL(receivedMultiIM(const QString&, const QString&, const QString&, const QString& \
)), this, SLOT(receiveMultiIm(const QString&, const QString&, const QString&, const \
QString& ))); + QObject::connect(&d->skype, SIGNAL(outgoingMessage(const QString&, \
const QString&)), this, SLOT(sentMessage(const QString&, const QString& ))); \
+ QObject::connect(&d->skype, SIGNAL(groupCall(const QString&, const QString& )), \
this, SLOT(groupCall(const QString&, const QString& ))); +
+ //set values for the connection (should be updated if changed)
+ d->skype.setValues(launchType, author);
+ setHitchHike(config->readEntry("Hitch", true));
+ setMarkRead(config->readEntry("MarkRead", true));//read the modes of account
+ d->callWindowTimeout = config->readEntry("CloseWindowTimeout", 3);
+ setPings(config->readEntry("Pings", true));
+ d->sessions.setAutoDelete(false);
+ d->lastSession = 0L;
+ d->callCount = 0;
+}
+
+
+SkypeAccount::~SkypeAccount() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ save();
+
+ d->protocol->unregisterAccount();//This account no longer exists
+
+ //free memory
+ delete d;
+}
+
+bool SkypeAccount::createContact(const QString &contactID, Kopete::MetaContact \
*parentContact) { + kDebug() << k_funcinfo << endl;//some debug info
+
+ if (!contact(contactID)) {//check weather it is not used already
+ SkypeContact *newContact = new SkypeContact(this, contactID, \
parentContact);//create the contact +
+ return newContact != 0L;//test weather it was created
+ } else {
+ kDebug() << k_funcinfo << "Contact already exists:" << contactID << endl;//Tell \
that it is not OK +
+ return false;
+ }
+}
+
+void SkypeAccount::setAway(bool away, const QString &reason) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (away)
+ setOnlineStatus(d->protocol->Away, reason);
+ else
+ setOnlineStatus(d->protocol->Online, reason);
+}
+
+//void SkypeAccount::setOnlineStatus(const Kopete::OnlineStatus &status, const \
Kopete::StatusMessage &) { +void SkypeAccount::setOnlineStatus(const \
Kopete::OnlineStatus &status, const Kopete::StatusMessage &reason) { + kDebug() << \
k_funcinfo << endl;//some debug info +
+ if (status == d->protocol->Online)
+ d->skype.setOnline();//Go online
+ else if (status == d->protocol->Offline)
+ d->skype.setOffline();//Go offline
+ else if (status == d->protocol->Away)
+ d->skype.setAway();
+ else if (status == d->protocol->NotAvailable)
+ d->skype.setNotAvailable();
+ else if (status == d->protocol->DoNotDisturb)
+ d->skype.setDND();
+ else if (status == d->protocol->Invisible)
+ d->skype.setInvisible();
+ else if (status == d->protocol->SkypeMe)
+ d->skype.setSkypeMe();
+ else
+ kDebug() << "Unknown online status" << endl;//Just a warning that I do not know \
that status +}
+
+void SkypeAccount::setStatusMessage(const Kopete::StatusMessage &statusMessage)
+{
+ //TODO: Port to kde4 (copy from winpopup)
+ /*if(myself()->onlineStatus().status() == Kopete::OnlineStatus::Online)
+ setAway( false, statusMessage.message() );
+ else if(myself()->onlineStatus().status() == Kopete::OnlineStatus::Away)
+ setAway( true, statusMessage.message() );*/
+}
+
+void SkypeAccount::fillActionMenu( KActionMenu *actionMenu )
+{
+ /*kDebug(14170);
+
+ /// How to remove an action from Kopete::Account::actionMenu()? GF
+
+ actionMenu->setIcon( myself()->onlineStatus().iconFor(this) );
+ actionMenu->menu()->addTitle( QIcon(myself()->onlineStatus().iconFor(this)), \
i18n("WinPopup (%1)", accountId())); +
+ //if (mProtocol)
+ {
+ KAction *goOnline = new KAction( KIcon("skype"), i18n("Online"), this );
+ //, "actionGoAvailable" );
+ QObject::connect( goOnline, SIGNAL(triggered(bool)), this, SLOT(connect()) );
+ goOnline->setEnabled(isConnected() && isAway());
+ actionMenu->addAction(goOnline);
+
+ KAction *goAway = new KAction( KIcon("skype"), i18n("Away"), this );
+ //, "actionGoAway" );
+ QObject::connect( goAway, SIGNAL(triggered(bool)), this, SLOT(goAway()) );
+ goAway->setEnabled(isConnected() && !isAway());
+ actionMenu->addAction(goAway);
+
+ /// One cannot really go offline manually - appears online as long as samba server \
is running. GF +
+ actionMenu->addSeparator();
+ KAction *properties = new KAction( i18n("Properties"), this );
+ // "actionAccountProperties" );
+ QObject::connect( properties, SIGNAL(triggered(bool)), this, SLOT(editAccount()) \
); + actionMenu->addAction( properties );
+ }*/
+}
+
+bool SkypeAccount::hasCustomStatusMenu() const
+{
+ return true;
+}
+
+void SkypeAccount::disconnect() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ setOnlineStatus(d->protocol->Offline, Kopete::StatusMessage());
+}
+
+SkypeContact *SkypeAccount::contact(const QString &id) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ return static_cast<SkypeContact *>(contacts()[id]);//get the contact and convert it \
into the skype contact, there are no other contacts anyway +}
+
+void SkypeAccount::connect(const Kopete::OnlineStatus &Status) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if ((Status != d->protocol->Online) && (Status != d->protocol->Away) &&
+ (Status != d->protocol->NotAvailable) && (Status != d->protocol->DoNotDisturb) &&
+ (Status != d->protocol->SkypeMe))//some strange online status, taje a default one
+ setOnlineStatus(d->protocol->Online, Kopete::StatusMessage());
+ else
+ setOnlineStatus(Status, Kopete::StatusMessage());//just change the status
+}
+
+void SkypeAccount::save() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ KConfigGroup *config = configGroup();//get the config
+ config->writeEntry("Authorization", author);//write the authorization name
+ config->writeEntry("Launch", launchType);//and the launch type
+ config->writeEntry("Hitch", getHitchHike());//save the hitch hike messages mode
+ config->writeEntry("MarkRead", getMarkRead());//save the Mark read messages mode
+ config->writeEntry("ScanForUnread", getScanForUnread());
+ config->writeEntry("CallControl", getCallControl());
+ config->writeEntry("CloseWindowTimeout", d->callWindowTimeout);
+ config->writeEntry("Pings", getPings());
+ config->writeEntry("Bus", getBus());
+ config->writeEntry("StartDBus", getStartDBus());
+ config->writeEntry("LaunchTimeout", getLaunchTimeout());
+ config->writeEntry("SkypeCommand", getSkypeCommand());
+ config->writeEntry("MyselfName", d->myName);
+ config->writeEntry("WaitBeforeConnect", getWaitBeforeConnect());
+ config->writeEntry("LeaveOnExit", leaveOnExit());
+ config->writeEntry("StartCallCommand", startCallCommand());
+ config->writeEntry("EndCallCommand", endCallCommand());
+ config->writeEntry("WaitForStartCallCommand", waitForStartCallCommand());
+ config->writeEntry("EndCallCommandOnlyLast", endCallCommandOnlyLast());
+ config->writeEntry("IncomingCall", incomingCommand());
+
+ //save it into the skype connection as well
+ d->skype.setValues(launchType, author);
+}
+
+void SkypeAccount::wentOnline() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->Online);//just set the icon
+ d->skype.enablePings(d->pings);
+ emit connectionStatus(true);
+}
+
+void SkypeAccount::wentOffline() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->Offline);//just change the icon
+ emit connectionStatus(false);
+}
+
+void SkypeAccount::wentAway() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->Away);//just change the icon
+ emit connectionStatus(true);
+}
+
+void SkypeAccount::wentNotAvailable() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->NotAvailable);
+ emit connectionStatus(true);
+}
+
+void SkypeAccount::wentDND() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->DoNotDisturb);
+ emit connectionStatus(true);
+}
+
+void SkypeAccount::wentInvisible() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->Invisible);
+ emit connectionStatus(true);
+}
+
+void SkypeAccount::wentSkypeMe() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->SkypeMe);
+ emit connectionStatus(true);
+}
+
+void SkypeAccount::statusConnecting() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ myself()->setOnlineStatus(d->protocol->Connecting);
+ emit connectionStatus(false);
+}
+
+void SkypeAccount::newUser(const QString &name) {
+ kDebug() << k_funcinfo << QString("name = %1").arg(name) << endl;//some debug info
+ if (contacts().contains(name))
+ return;
+ addContact(name);
+}
+
+void SkypeAccount::prepareContact(SkypeContact *contact) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ QObject::connect(&d->skype, SIGNAL(updateAllContacts()), contact, \
SLOT(requestInfo()));//all contacts will know that + QObject::connect(contact, \
SIGNAL(infoRequest(const QString& )), &d->skype, SLOT(getContactInfo(const QString& \
)));//How do we ask for info? + QObject::connect(this, SIGNAL(connectionStatus(bool \
)), contact, SLOT(connectionStatus(bool ))); + QObject::connect(contact, \
SIGNAL(setCallPossible(bool )), d->protocol, SLOT(updateCallActionStatus())); +}
+
+void SkypeAccount::updateContactInfo(const QString &contact, const QString &change) \
{ + kDebug() << k_funcinfo << endl;//some debug info
+
+ SkypeContact *cont = static_cast<SkypeContact *> (contacts().value(contact));//get \
the contact + if (cont)
+ cont->setInfo(change);//give it the message
+ else {//it does not yet exist, create it if it is in skype contact list (can be got \
by buddystatus) + const QString &type = change.section(' ', 0, 0).toUpper();//get \
the first part of the message, it should be BUDDYSTATUS + const QString &value = \
change.section(' ', 1, 1);//get the second part if it is some reasonable value + if \
((type == "BUDDYSTATUS") && ((value == "2") || (value == "3"))) {//the user is in \
skype contact list + newUser(contact);
+ } else if (type != "BUDDYSTATUS")//this is some other info
+ d->skype.getContactBuddy(contact);//get the buddy status for the account and \
check, if it is in contact list or not + }
+}
+
+bool SkypeAccount::canComunicate() {
+ return d->skype.canComunicate();
+}
+
+SkypeProtocol * SkypeAccount::protocol() {
+ return d->protocol;
+}
+
+void SkypeAccount::sendMessage(Kopete::Message &message, const QString &chat) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (chat.isEmpty()) {
+ const QString &user = message.to().at(0)->contactId();//get id of the first \
contact, messages to multiple people are not yet possible + const QString &body = \
message.plainBody();//get the text of the message +
+ d->skype.send(user, body);//send it by skype
+ } else {
+ const QString &body = message.plainBody();
+
+ d->skype.sendToChat(chat, body);
+ }
+}
+
+bool SkypeAccount::getHitchHike() const {
+ return d->hitch;
+}
+
+bool SkypeAccount::getMarkRead() const {
+ return d->markRead;
+}
+
+void SkypeAccount::setHitchHike(bool value) {
+ d->hitch = value;//save it
+ d->skype.setHitchMode(value);//set it in the skype
+}
+
+void SkypeAccount::setMarkRead(bool value) {
+ d->markRead = value;//remember it
+ d->skype.setMarkMode(value);
+}
+
+bool SkypeAccount::userHasChat(const QString &userId) {
+ SkypeContact *cont = static_cast<SkypeContact *> (contacts().value(userId));//get \
the contact +
+ if (cont)//it exists
+ return cont->hasChat();//so ask it
+ else
+ return false;//if it does not exist it can not have a chat opened
+}
+
+void SkypeAccount::receivedIm(const QString &user, const QString &message, const \
QString &messageId) { + kDebug() << k_funcinfo << "User: " << user << ", message: " \
<< message << endl;//some debug info + getContact(user)->receiveIm(message, \
getMessageChat(messageId));//let the contact show the message +}
+
+void SkypeAccount::setScanForUnread(bool value) {
+ d->searchForUnread = value;
+ d->skype.setScanForUnread(value);
+}
+
+bool SkypeAccount::getScanForUnread() const {
+ return d->searchForUnread;
+}
+
+void SkypeAccount::makeCall(SkypeContact *user) {
+ makeCall(user->contactId());
+}
+
+void SkypeAccount::makeCall(const QString &users) {
+ startCall();
+ d->skype.makeCall(users);
+}
+
+bool SkypeAccount::getCallControl() const {
+ return d->callControl;
+}
+
+void SkypeAccount::setCallControl(bool value) {
+ d->callControl = value;
+}
+
+void SkypeAccount::newCall(const QString &callId, const QString &userId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->callControl) {//Show the skype call control window
+ SkypeCallDialog *dialog = new SkypeCallDialog(callId, userId, this);//It should \
free itself when it is closed + QObject::connect(&d->skype, SIGNAL(callStatus(const \
QString&, const QString& )), dialog, SLOT(updateStatus(const QString&, const QString& \
))); + QObject::connect(dialog, SIGNAL(acceptTheCall(const QString& )), &d->skype, \
SLOT(acceptCall(const QString& ))); + QObject::connect(dialog, \
SIGNAL(hangTheCall(const QString& )), &d->skype, SLOT(hangUp(const QString& ))); \
+ QObject::connect(dialog, SIGNAL(toggleHoldCall(const QString& )), &d->skype, \
SLOT(toggleHoldCall(const QString& ))); + QObject::connect(&d->skype, \
SIGNAL(callError(const QString&, const QString& )), dialog, SLOT(updateError(const \
QString&, const QString& ))); + QObject::connect(&d->skype, SIGNAL(skypeOutInfo(int, \
const QString& )), dialog, SLOT(skypeOutInfo(int, const QString& ))); \
+ QObject::connect(dialog, SIGNAL(updateSkypeOut()), &d->skype, \
SLOT(getSkypeOut())); + QObject::connect(dialog, SIGNAL(callFinished(const QString& \
)), this, SLOT(removeCall(const QString& ))); + d->skype.getSkypeOut();
+
+ d->calls.insert(callId, dialog);
+ }
+
+ if ((!d->incommingCommand.isEmpty()) && (d->skype.isCallIncoming(callId))) {
+ kDebug() << "Running ring command" << endl;
+ KProcess *proc = new KProcess();
+ (*proc) << d->incommingCommand.split(' ');
+ QObject::connect(proc, SIGNAL(processExited(KProcess* )), proc, \
SLOT(deleteLater())); + proc->start();
+ }
+}
+
+bool SkypeAccount::isCallIncoming(const QString &callId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ return d->skype.isCallIncoming(callId);
+}
+
+void SkypeAccount::setCloseWindowTimeout(int timeout) {
+ d->callWindowTimeout = timeout;
+}
+
+int SkypeAccount::closeCallWindowTimeout() const {
+ return d->callWindowTimeout;
+}
+
+QString SkypeAccount::getUserLabel(const QString &userId) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (userId.indexOf(' ') != -1) {//there are more people than just one
+ QStringList users = userId.split(' ');
+ for (QStringList::iterator it = users.begin(); it != users.end(); ++it) {
+ (*it) = getUserLabel((*it));
+ }
+ return users.join("\n");
+ }
+
+ Kopete::Contact *cont = contact(userId);
+
+ if (!cont) {
+ addContact(userId, QString::null, 0L, Temporary);//create a temporary contact
+
+ cont = (contacts().value(userId));//It should be there now
+ if (!cont)
+ return userId;//something odd,.but better do nothing than crash
+ }
+
+ return QString("%1 (%2)").arg(cont->nickName()).arg(userId);
+}
+
+void SkypeAccount::setPings(bool enabled) {
+ d->skype.enablePings(enabled);
+ d->pings = enabled;
+}
+
+bool SkypeAccount::getPings() const {
+ return d->pings;
+}
+
+int SkypeAccount::getBus() const {
+ return d->bus;
+}
+
+void SkypeAccount::setBus(int bus) {
+ d->bus = bus;
+ d->skype.setBus(bus);
+}
+
+void SkypeAccount::setStartDBus(bool enable) {
+ d->startDBus = enable;
+ d->skype.setStartDBus(enable);
+}
+
+bool SkypeAccount::getStartDBus() const {
+ return d->startDBus;
+}
+
+void SkypeAccount::setLaunchTimeout(int seconds) {
+ d->launchTimeout = seconds;
+ d->skype.setLaunchTimeout(seconds);
+}
+
+int SkypeAccount::getLaunchTimeout() const {
+ return d->launchTimeout;
+}
+
+void SkypeAccount::setSkypeCommand(const QString &command) {
+ d->skypeCommand = command;
+ d->skype.setSkypeCommand(command);
+}
+
+const QString &SkypeAccount::getSkypeCommand() const {
+ return d->skypeCommand;
+}
+
+void SkypeAccount::setMyselfName(const QString &name) {
+ d->myName = name;
+ myself()->setNickName(name);
+}
+
+void SkypeAccount::setWaitBeforeConnect(int value) {
+ d->waitBeforeConnect = value;
+ d->skype.setWaitConnect(value);
+}
+
+int SkypeAccount::getWaitBeforeConnect() const {
+ return d->waitBeforeConnect;
+}
+
+SkypeContact *SkypeAccount::getContact(const QString &userId) {
+ SkypeContact *cont = static_cast<SkypeContact *> (contacts().value(userId));//get \
the contact + if (!cont) {//We do not know such contact
+ addContact(userId, QString::null, 0L, Temporary);//create a temporary contact
+
+ cont = static_cast<SkypeContact *> (contacts().value(userId));//It should be there \
now + }
+ return cont;
+}
+
+void SkypeAccount::prepareChatSession(SkypeChatSession *session) {
+ QObject::connect(session, SIGNAL(updateChatId(const QString&, const QString&, \
SkypeChatSession* )), this, SLOT(setChatId(const QString&, const QString&, \
SkypeChatSession* ))); + QObject::connect(session, SIGNAL(wantTopic(const QString& \
)), &d->skype, SLOT(getTopic(const QString& ))); + QObject::connect(&d->skype, \
SIGNAL(joinUser(const QString&, const QString& )), session, SLOT(joinUser(const \
QString&, const QString& ))); + QObject::connect(&d->skype, SIGNAL(leftUser(const \
QString&, const QString&, const QString& )), session, SLOT(leftUser(const QString&, \
const QString&, const QString& ))); + QObject::connect(&d->skype, \
SIGNAL(setTopic(const QString&, const QString& )), session, SLOT(setTopic(const \
QString&, const QString& ))); + QObject::connect(session, \
SIGNAL(inviteUserToChat(const QString&, const QString& )), &d->skype, \
SLOT(inviteUser(const QString&, const QString& ))); + QObject::connect(session, \
SIGNAL(leaveChat(const QString& )), &d->skype, SLOT(leaveChat(const QString& ))); +}
+
+void SkypeAccount::setChatId(const QString &oldId, const QString &newId, \
SkypeChatSession *sender) { + d->sessions.remove(oldId);//remove the old one
+ if (!newId.isEmpty()) {
+ d->sessions.insert(newId, sender);
+ }
+}
+
+bool SkypeAccount::chatExists(const QString &chat) {
+ return d->sessions.find(chat);
+}
+
+void SkypeAccount::receiveMultiIm(const QString &chatId, const QString &body, const \
QString &messageId, const QString &user) { + SkypeChatSession *session = \
d->sessions.find(chatId); +
+ if (!session) {
+ QStringList users = d->skype.getChatUsers(chatId);
+ Kopete::ContactPtrList list;
+ for (QStringList::iterator it = users.begin(); it != users.end(); ++it) {
+ list.append(getContact(*it));
+ }
+
+ session = new SkypeChatSession(this, chatId, list);
+ }
+
+ Kopete::Message mes(getContact(user), myself());
+ mes.setDirection(Kopete::Message::Inbound);
+ mes.setPlainBody(body);
+ session->appendMessage(mes);
+}
+
+QString SkypeAccount::getMessageChat(const QString &messageId) {
+ return d->skype.getMessageChat(messageId);
+}
+
+void SkypeAccount::registerLastSession(SkypeChatSession *lastSession) {
+ d->lastSession = lastSession;
+}
+
+void SkypeAccount::gotMessageId(const QString &messageId) {
+ if ((d->lastSession) && (!messageId.isEmpty())) {
+ d->lastSession->setChatId(d->skype.getMessageChat(messageId));
+ }
+
+ d->lastSession = 0L;
+}
+
+void SkypeAccount::sentMessage(const QString &body, const QString &chat) {
+ kDebug() << k_funcinfo << "chat: " << chat << endl;//some debug info
+
+ SkypeChatSession *session = d->sessions.find(chat);
+ const QStringList &users = d->skype.getChatUsers(chat);
+ QList<Kopete::Contact*> *recv = 0L;
+
+ if (!session)
+ if (d->hitch) {
+ recv = constructContactList(users);
+ if (recv->count() == 1) {
+ SkypeContact *cont = static_cast<SkypeContact *> (recv->at(0));
+ cont->startChat();
+ session = cont->getChatSession();
+ session->setChatId(chat);
+ } else {
+ session = new SkypeChatSession(this, chat, *recv);
+ }
+ } else {
+ return;
+ }
+
+ if (!recv)
+ recv = constructContactList(users);
+
+ session->sentMessage(recv, body);
+ delete recv;
+}
+
+QList<Kopete::Contact*> *SkypeAccount::constructContactList(const QStringList \
&users) { + QList<Kopete::Contact*> *list= new QList<Kopete::Contact*> ();
+ for (QStringList::const_iterator it = users.begin(); it != users.end(); ++it) {
+ list->append(getContact(*it));
+ }
+
+ return list;
+}
+
+void SkypeAccount::groupCall(const QString &callId, const QString &groupId) {
+ kDebug() << k_funcinfo << endl;
+
+ //TODO: Find out a way to embet qdialog into another one after creation
+ return;
+
+ if (!d->callControl)
+ return;
+
+ SkypeConference *conf;
+ if (!(conf = d->conferences[groupId])) {//does it already exist?
+ conf = new SkypeConference(groupId);//no, create one then..
+ d->conferences.insert(groupId, conf);
+
+ QObject::connect(conf, SIGNAL(removeConference(const QString& )), this, \
SLOT(removeCallGroup(const QString& ))); + }
+
+ conf->embedCall(d->calls[callId]);
+}
+
+void SkypeAccount::removeCall(const QString &callId) {
+ kDebug() << k_funcinfo << endl;
+ d->calls.remove(callId);
+}
+
+void SkypeAccount::removeCallGroup(const QString &groupId) {
+ kDebug() << k_funcinfo << endl;
+ d->conferences.remove(groupId);
+}
+
+QString SkypeAccount::createChat(const QString &users) {
+ return d->skype.createChat(users);
+}
+
+bool SkypeAccount::leaveOnExit() const {
+ return d->leaveOnExit;
+}
+
+void SkypeAccount::setLeaveOnExit(bool value) {
+ d->leaveOnExit = value;
+}
+
+void SkypeAccount::chatUser(const QString &userId) {
+ SkypeContact *contact = getContact(userId);
+
+ contact->execute();
+}
+
+void SkypeAccount::setStartCallCommand(const QString &value) {
+ d->startCallCommand = value;
+}
+
+void SkypeAccount::setEndCallCommand(const QString &value) {
+ d->endCallCommand = value;
+}
+
+void SkypeAccount::setWaitForStartCallCommand(bool value) {
+ d->waitForStartCallCommand = value;
+}
+void SkypeAccount::setEndCallCommandOnlyForLast(bool value) {
+ d->endCallCommandOnlyLats = value;
+}
+
+QString SkypeAccount::startCallCommand() const {
+ return d->startCallCommand;
+}
+
+QString SkypeAccount::endCallCommand() const {
+ return d->endCallCommand;
+}
+
+bool SkypeAccount::waitForStartCallCommand() const {
+ return d->waitForStartCallCommand;
+}
+
+bool SkypeAccount::endCallCommandOnlyLast() const {
+ return d->endCallCommandOnlyLats;
+}
+
+void SkypeAccount::startCall() {
+ kDebug() << k_funcinfo << endl;
+
+ KProcess *proc = new KProcess();
+ QObject::connect(proc, SIGNAL(processExited(KProcess* )), proc, \
SLOT(deleteLater())); + QStringList args = d->startCallCommand.split(' ');
+ (*proc) << args;//set what will be executed
+ //TODO: Port to kde4
+ //KProcess::RunMode mode = d->waitForStartCallCommand ? KProcess::Block : \
KProcess::NotifyOnExit; + proc->start();
+ //proc->start(mode);
+ ++d->callCount;
+}
+
+void SkypeAccount::endCall() {
+ kDebug() << k_funcinfo << endl;
+
+ if ((--d->callCount == 0) || (!d->endCallCommandOnlyLats)) {
+ KProcess *proc = new KProcess();
+ QObject::connect(proc, SIGNAL(processExited(KProcess* )), proc, \
SLOT(deleteLater())); + (*proc) << d->endCallCommand.split(' ');
+ proc->start();
+ }
+ if (d->callCount < 0)
+ d->callCount = 0;
+}
+
+void SkypeAccount::setIncomingCommand(const QString &command) {
+ d->incommingCommand = command;
+}
+
+QString SkypeAccount::incomingCommand() const {
+ return d->incommingCommand;
+}
+
+void SkypeAccount::registerContact(const QString &contactId) {
+ kDebug() << k_funcinfo << endl;
+ d -> skype.addContact(contactId);
+}
+
+void SkypeAccount::removeContact(const QString &contactId) {
+ d -> skype.removeContact(contactId);
+}
+
+bool SkypeAccount::ableMultiCall() {
+ return (d->skype.ableConference());
+}
+
+bool SkypeAccount::canAlterAuth() {
+ return (d->skype.canComunicate());
+}
+
+void SkypeAccount::authorizeUser(const QString &userId) {
+ d->skype.setAuthor(userId, Skype::Author);
+}
+
+void SkypeAccount::disAuthorUser(const QString &userId) {
+ d->skype.setAuthor(userId, Skype::Deny);
+}
+
+void SkypeAccount::blockUser(const QString &userId) {
+ d->skype.setAuthor(userId, Skype::Block);
+}
+
+int SkypeAccount::getAuthor(const QString &contactId) {
+ switch (d->skype.getAuthor(contactId)) {
+ case Skype::Author:
+ return 0;
+ case Skype::Deny:
+ return 1;
+ case Skype::Block:
+ return 2;
+ }
+}
+
+#include "skypeaccount.moc"
Index: kopete/protocols/skype/skypeui.rc
===================================================================
--- kopete/protocols/skype/skypeui.rc (revision 0)
+++ kopete/protocols/skype/skypeui.rc (revision 0)
@@ -0,0 +1,18 @@
+<!DOCTYPE kpartgui>
+<kpartgui name="kopete_skype" version="1">
+ <MenuBar>
+ <Menu name="edit">
+ <text>&Edit</text>
+ <Action name="callSkypeContact" />
+ </Menu>
+ </MenuBar>
+ <Menu name="contact_popup">
+ <Action name="callSkypeContact" />
+ </Menu>
+ <ToolBar fullWidth="true" name="mainToolBar" noMerge="1"><Text>Main Toolbar</Text>
+ <Action name="callSkypeContact"/>
+ </ToolBar>
+ <Menu name="contactlistitems_popup">
+ <Action name="callSkypeContact" />
+ </Menu>
+</kpartgui>
Index: kopete/protocols/skype/skypechatui.rc
===================================================================
--- kopete/protocols/skype/skypechatui.rc (revision 0)
+++ kopete/protocols/skype/skypechatui.rc (revision 0)
@@ -0,0 +1,12 @@
+<!DOCTYPE kpartgui>
+<kpartgui version="1" name="kopetechatwindow">
+ <MenuBar>
+ <Menu name="tools" >
+ <text>&Tools</text>
+ <Action name="callSkypeContactFromChat" />
+ </Menu>
+ </MenuBar>
+ <ToolBar name="mainToolBar" fullWidth="true">
+ <Action name="callSkypeContactFromChat" />
+ </ToolBar>
+</kpartgui>
Index: kopete/protocols/skype/skypecalldialog.h
===================================================================
--- kopete/protocols/skype/skypecalldialog.h (revision 0)
+++ kopete/protocols/skype/skypecalldialog.h (revision 0)
@@ -0,0 +1,105 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef SKYPECALLDIALOG_H
+#define SKYPECALLDIALOG_H
+
+#include <ui_skypecalldialogbase.h>
+
+class SkypeAccount;
+class SkypeCallDialogPrivate;
+namespace Ui { class SkypeCallDialogBase; }
+
+/**
+ * This class is a window that can control a call (show information about it, hang \
up, hold, ...) + * @author Michal Vaner (Vorner)
+ */
+class SkypeCallDialog : public QDialog, private Ui::SkypeCallDialogBase
+//class SkypeCallDialog : public Ui::SkypeCallDialogBase
+{
+ Q_OBJECT
+ private:
+ SkypeCallDialogPrivate *d;
+ ///Start timeout to close
+ void closeLater();
+ private slots:
+ ///Close it after timeout after finishing the call
+ void deathTimeout();
+ ///Update the call info now
+ void updateCallInfo();
+ ///Call the user back
+ void callBack();
+ protected slots:
+ ///The accept button was clicked, accept the call
+ virtual void acceptCall();
+ ///Hold or release the call
+ virtual void holdCall();
+ ///Hang up the call
+ virtual void hangUp();
+ ///Start chat to the user
+ virtual void chatUser();
+ protected:
+ ///I want to know when I'm closed
+ virtual void closeEvent(QCloseEvent *e);
+ public:
+ /**
+ * Constructor
+ */
+ SkypeCallDialog(const QString &callId, const QString &userId, SkypeAccount \
*account); + ///Destructor
+ ~SkypeCallDialog();
+ public slots:
+ ///Update the status of call and disable/enable the right buttons and show it in \
the labels + void updateStatus(const QString &callId, const QString &status);
+ ///Updates an error message when some error occurred
+ void updateError(const QString &callId, const QString &status);
+ /**
+ * Incoming skype-out balance info
+ * @param balance How much of that ddoes user have
+ * @param currency What currency is it (actually only euro-cents are used)
+ */
+ void skypeOutInfo(int balance, const QString ¤cy);
+ signals:
+ /**
+ * accept an incoming call
+ * @param callId What call is it
+ */
+ void acceptTheCall(const QString &callId);
+ /**
+ * Hang up this call for me, please
+ * @param callId What call are we talking about
+ */
+ void hangTheCall(const QString &callId);
+ /**
+ * Hold or resume a call (depending on its actual status
+ * @param callId What call are we tlking about
+ */
+ void toggleHoldCall(const QString &callId);
+ /**
+ * Tell me the skype out balance, please
+ */
+ void updateSkypeOut();
+ /**
+ * This is emited when a call dialog is closed and is going to be deleted
+ * @param callId Id of it's call
+ */
+ void callFinished(const QString &callId);
+};
+
+#endif
Index: kopete/protocols/skype/skypecontact.h
===================================================================
--- kopete/protocols/skype/skypecontact.h (revision 0)
+++ kopete/protocols/skype/skypecontact.h (revision 0)
@@ -0,0 +1,150 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPECONTACT_H
+#define SKYPECONTACT_H
+
+#include <kopetecontact.h>
+
+class SkypeAccount;
+class QString;
+class SkypeContactPrivate;
+namespace Kopete {
+ class MetaContact;
+ class ChatSession;
+}
+class KAction;
+//template <class T> class QPtrList;
+class SkypeChatSession;
+
+/**
+ * @author Michal Vaner (VORNER) <michal.vaner@kdemail.net>
+ */
+class SkypeContact : public Kopete::Contact
+{
+ Q_OBJECT
+ private:
+ ///some internal things
+ SkypeContactPrivate *d;
+ ///This examines all factors of users online status and sets the status acordingly
+ void resetStatus();
+ private slots:
+ ///This will note that the session was destroyed and therefore can't be used \
again. As well used when the chat becomes multi-user so it no longer belongs to this \
contact + void removeChat();
+ ///Enables or disables the call action depending on if it can be called or not.
+ void enableCall(bool value);
+ ///The status changed, so there should be update of the availiblity of some things
+ void statusChanged();
+ public:
+ /**
+ * Constructor.
+ * @param account Account to which it belongs
+ * @param id ID of the new contact
+ * @param parent Metacontact to put it inside
+ */
+ SkypeContact(SkypeAccount *account, const QString &id, Kopete::MetaContact \
*parent, bool user = true); + /**
+ * Destructor.
+ */
+ ~SkypeContact();
+ /**
+ * Creates a chat session.
+ * @param flags Can I create it?
+ * @return Pointer to that session
+ */
+ virtual Kopete::ChatSession *manager(Kopete::Contact::CanCreateFlags flags);
+ /**
+ * Save this contact (resp. set what should be saved and it will be written \
automatically by kopete) + */
+ virtual void serialize(QMap<QString, QString> &serializedData, QMap<QString, \
QString> &addressBookData); + ///Returns full name for the contact
+ virtual QString formattedName() const;
+ ///Is it reachable now?
+ virtual bool isReachable();
+ ///Does this contact has opened chat session?
+ bool hasChat() const;
+ ///Tell kopete which actions to show in the contact pop-up menu
+ QList<KAction*> *customContextMenuActions();
+ ///Give me actually existing chat session
+ SkypeChatSession *getChatSession();
+ ///Can this contact be called now?
+ bool canCall() const;
+ private slots:
+ /**
+ * Authorize the user to see if I'm online
+ */
+ void authorize();
+ /**
+ * Remove authorization from that user
+ */
+ void disAuthor();
+ /**
+ * Block this user, no more messages
+ */
+ void block();
+ public slots:
+ /**
+ * Please ask for the contact information (emit infoReques with your name)
+ */
+ void requestInfo();
+ /**
+ * Chnages something in the contact.
+ * @param change What change was it? It looks like [property] [value]
+ */
+ void setInfo(const QString &change);
+ /**
+ * This one showes message in the chat session.
+ * @param message The message to show
+ * @param chat The chat ID of the chat the message belongs to
+ */
+ void receiveIm(const QString &message, const QString &chat);
+ /**
+ * connection status changed
+ * @param connected Are we connected now?
+ */
+ void connectionStatus(bool connected);
+ ///This slot calls a contact
+ void call();
+ /**
+ * This slot should show the user info
+ * TODO: Implement this
+ * Now it only shows a messagebox
+ */
+ virtual void slotUserInfo();
+ /**
+ * Remove the contact from skype server
+ */
+ virtual void deleteContact();
+ /**
+ * Save me to the Skype
+ */
+ virtual void sync(unsigned int changed);
+ signals:
+ /**
+ * There is a request to get/refresh the contact info from skype
+ * @param contact Which contact wants it?
+ */
+ void infoRequest(const QString &contact);
+ /**
+ * The possibility to call this contact has changed, so GUI should enable/disable \
some buttons. + * @param value Is it possible to call it now?
+ */
+ void setCallPossible(bool value);
+};
+
+#endif
Index: kopete/protocols/skype/skypeprotocol.cpp
===================================================================
--- kopete/protocols/skype/skypeprotocol.cpp (revision 0)
+++ kopete/protocols/skype/skypeprotocol.cpp (revision 0)
@@ -0,0 +1,198 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#include "skypeprotocol.h"
+#include "skypeeditaccount.h"
+#include "skypeaccount.h"
+#include "skypeaddcontact.h"
+#include "skypecontact.h"
+
+#include <kopeteonlinestatusmanager.h>
+#include <kgenericfactory.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kshortcut.h>
+#include <kopetecontactlist.h>
+#include <kopetemetacontact.h>
+
+K_PLUGIN_FACTORY( SkypeProtocolFactory, registerPlugin<SkypeProtocol>(); )
+K_EXPORT_PLUGIN( SkypeProtocolFactory( "kopete_skype" ) )
+
+class SkypeProtocolPrivate {
+ private:
+ public:
+ ///The "call contact" action
+ KAction *callContactAction;
+ ///Pointer to the account
+ SkypeAccount *account;
+ ///Constructor
+ SkypeProtocolPrivate() {
+ account = 0L;//no account yet
+ callContactAction = 0L;
+ }
+};
+
+SkypeProtocol::SkypeProtocol(QObject *parent, const QList<QVariant>&) :
+ Kopete::Protocol(SkypeProtocolFactory::componentData(), parent),//create the parent
+ Offline(Kopete::OnlineStatus::Offline, 0, this, 1, QStringList(), i18n("Offline"), \
i18n("Offline"), Kopete::OnlineStatusManager::Offline),//and online statuses \
+ Online(Kopete::OnlineStatus::Online, 1, this, 2, QStringList(), i18n("Online"), \
i18n("Online"), Kopete::OnlineStatusManager::Online), \
+ SkypeMe(Kopete::OnlineStatus::Online, 0, this, 3, \
QStringList("contact_ffc_overlay"), i18n("Skype Me"), i18n("Skype Me"), \
Kopete::OnlineStatusManager::FreeForChat), + Away(Kopete::OnlineStatus::Away, 2, \
this, 4, QStringList("contact_away_overlay"), i18n("Away"), i18n("Away"), \
Kopete::OnlineStatusManager::Away), + NotAvailable(Kopete::OnlineStatus::Away, 1, \
this, 5, QStringList("contact_xa_overlay"), i18n("Not Available"), i18n("Not \
Available"), Kopete::OnlineStatusManager::Away), \
+ DoNotDisturb(Kopete::OnlineStatus::Away, 0, this, 6, \
QStringList("contact_busy_overlay"), i18n("Do Not Disturb"), i18n("Do Not Disturb"), \
Kopete::OnlineStatusManager::Busy), + Invisible(Kopete::OnlineStatus::Invisible, 0, \
this, 7, QStringList("contact_invisible_overlay"), i18n("Invisible"), \
i18n("Invisible"), Kopete::OnlineStatusManager::Invisible), \
+ Connecting(Kopete::OnlineStatus::Connecting, 0, this, 8, \
QStringList("skype_connect"), i18n("Connecting")), \
+ NotInList(Kopete::OnlineStatus::Offline, 0, this, 9, \
QStringList("contact_unknown_overlay"), i18n("Not in skype list")), \
+ NoAuth(Kopete::OnlineStatus::Offline, 0, this, 10, \
QStringList("contact_unknown_overlay"), i18n("Not authorized")), \
+ Phone(Kopete::OnlineStatus::Online, 0, this, 11, \
QStringList("contact_phone_overlay"), i18n("SkypeOut contact")), + /** Contact \
property templates */ + propFullName(Kopete::Global::Properties::self()->fullName()),
+ propPrivatePhone(Kopete::Global::Properties::self()->privatePhone()),
+ propPrivateMobilePhone(Kopete::Global::Properties::self()->privateMobilePhone()),
+ propWorkPhone(Kopete::Global::Properties::self()->workPhone()),
+ propLastSeen(Kopete::Global::Properties::self()->lastSeen())
+
+{
+ kDebug() << k_funcinfo << endl;//some debug info
+ //create the d pointer
+ d = new SkypeProtocolPrivate();
+ //add address book field
+ addAddressBookField("messaging/skype", Kopete::Plugin::MakeIndexField);
+
+ setXMLFile("skypeui.rc");
+
+ //TODO: Port to kde4
+ //d->callContactAction = new KAction(i18n("Call (by Skype)"), \
QString::fromLatin1("call"), 0, this, SLOT(callContacts()), actionCollection(), \
"callSkypeContact"); + d->callContactAction = new KAction( this );
+ d->callContactAction->setIcon( (KIcon("call") ) );
+ d->callContactAction->setText( i18n ("Call (by Skype)") );
+ connect(d->callContactAction, SIGNAL(triggered(bool)), SLOT(callContacts()));
+
+ updateCallActionStatus();
+ connect(Kopete::ContactList::self(), SIGNAL(metaContactSelected(bool)), this, \
SLOT(updateCallActionStatus())); +}
+
+SkypeProtocol::~SkypeProtocol() {
+ kDebug() << k_funcinfo << endl;//some debug info
+ //release the memory
+ delete d;
+}
+
+Kopete::Account *SkypeProtocol::createNewAccount(const QString &) {
+ kDebug() << k_funcinfo << endl;//some debug info
+ //just create one
+ return new SkypeAccount(this);
+}
+
+AddContactPage *SkypeProtocol::createAddContactWidget(QWidget *parent, \
Kopete::Account *account) { + kDebug() << k_funcinfo << endl;//some debug info
+ return new SkypeAddContact(this, parent, (SkypeAccount *)account, 0L);
+}
+
+KopeteEditAccountWidget *SkypeProtocol::createEditAccountWidget(Kopete::Account \
*account, QWidget *parent) { + kDebug() << k_funcinfo << endl;//some debug info
+ return new skypeEditAccount(this, account, parent);//create the widget and return \
it +}
+
+void SkypeProtocol::registerAccount(SkypeAccount *account) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->account = account;
+}
+
+void SkypeProtocol::unregisterAccount() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->account = 0L;//forget everything about the account
+}
+
+bool SkypeProtocol::hasAccount() const {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ return (d->account);
+}
+
+Kopete::Contact *SkypeProtocol::deserializeContact(Kopete::MetaContact *metaContact, \
const QMap<QString, QString> &serializedData, const QMap<QString, QString> &) { \
+ kDebug() << k_funcinfo << "Name: " << serializedData["contactId"] << endl;//some \
debug info +
+ QString contactID = serializedData["contactId"];//get the contact ID
+
+ if (!d->account) {
+ kDebug() << "Account does not exists, skiping contact creation" << endl;//write \
error for debugging + return 0L;//create nothing
+ }
+
+ return new SkypeContact(d->account, contactID, metaContact);//create the contact
+}
+
+void SkypeProtocol::updateCallActionStatus() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ bool enab = false;
+
+ if ((Kopete::ContactList::self()->selectedMetaContacts().count() != 1) && \
((!d->account) || (!d->account->ableMultiCall()))) { \
+ d->callContactAction->setEnabled(false); + return;
+ }
+
+ //Run trough all selected contacts and find if there is any skype contact
+ const QList<Kopete::MetaContact*> &selected = \
Kopete::ContactList::self()->selectedMetaContacts(); + for \
(QList<Kopete::MetaContact*>::const_iterator met = selected.begin(); met != \
selected.end(); ++met) { + const QList<Kopete::Contact*> &metaCont = \
(*met)->contacts(); + for (QList<Kopete::Contact*>::const_iterator con = \
metaCont.begin(); con != metaCont.end(); ++con) { + if ((*con)->protocol() == this) \
{//This is skype contact, ask it if it can be called + SkypeContact *thisCont = \
static_cast<SkypeContact *> (*con); + if (thisCont->canCall()) {
+ enab = true;
+ goto OUTSIDE;
+ }
+ }
+ }
+ }
+ OUTSIDE:
+ d->callContactAction->setEnabled(enab);
+}
+
+void SkypeProtocol::callContacts() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ QString list;
+
+ const QList<Kopete::MetaContact*> &selected = \
Kopete::ContactList::self()->selectedMetaContacts(); + for \
(QList<Kopete::MetaContact*>::const_iterator met = selected.begin(); met != \
selected.end(); ++met) { + const QList<Kopete::Contact*> &metaCont = \
(*met)->contacts(); + for (QList<Kopete::Contact*>::const_iterator con = \
metaCont.begin(); con != metaCont.end(); ++con) { + if ((*con)->protocol() == this) \
{//This is skype contact, ask it if it can be called + SkypeContact *thisCont = \
static_cast<SkypeContact *> (*con); + if (thisCont->canCall()) {
+ if (!list.isEmpty())
+ list += ", ";
+ list += thisCont->contactId();
+ }
+ }
+ }
+ }
+
+ if (!list.isEmpty()) {
+ d->account->makeCall(list);
+ }
+}
+
+#include "skypeprotocol.moc"
Index: kopete/protocols/skype/skypeaccount.h
===================================================================
--- kopete/protocols/skype/skypeaccount.h (revision 0)
+++ kopete/protocols/skype/skypeaccount.h (revision 0)
@@ -0,0 +1,515 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPEACCOUNT_H
+#define SKYPEACCOUNT_H
+
+#include <kopeteaccount.h>
+#include <kactionmenu.h>
+#include <kmenu.h>
+
+class SkypeProtocol;
+class QString;
+class SkypeAccountPrivate;
+class SkypeContact;
+class SkypeChatSession;
+//template <class X> class QPtrList;
+
+namespace Kopete {
+ class MetaContact;
+ class OnlineStatus;
+ class Message;
+ class Kontact;
+}
+
+#define DBUS_SESSION 0
+#define DBUS_SYSTEM 1
+
+/**
+ * @author Michal Vaner
+ * @short Skype account
+ * Account to use external skype program. At this time, it only supports one skype \
account at one, may be more in future. + */
+class SkypeAccount : public Kopete::Account
+{
+Q_OBJECT
+ private:
+ ///Some internal things
+ SkypeAccountPrivate *d;
+ ///Constructs list of users from their ID list. Have to be deleted later!
+ QList<Kopete::Contact*> *constructContactList(const QStringList &users);
+ private slots:
+ /**
+ * This sets the right icon for the status - online
+ */
+ void wentOnline();
+ /**
+ * This changes the account icon to offline
+ */
+ void wentOffline();
+ /**
+ * This changes the account icon to away
+ */
+ void wentAway();
+ /**
+ * This changes the account icon to not available
+ */
+ void wentNotAvailable();
+ /**
+ * This changes the account icon to Do not disturb
+ */
+ void wentDND();
+ /**
+ * This changes the status icon of account to Invisible
+ */
+ void wentInvisible();
+ /**
+ * This changes the status indicator to Skype me
+ */
+ void wentSkypeMe();
+ /**
+ * The status changed to actually connecting
+ */
+ void statusConnecting();
+ /**
+ * This adds user to the contact list if it is not there
+ * @param name The skype name of the contact
+ */
+ void newUser(const QString &name);
+ /**
+ * This is used for receiving messages from skype network
+ * @param user The user that sent it
+ * @param message The text of the message
+ * @param messageId Id of that message
+ */
+ void receivedIm(const QString &user, const QString &message, const QString \
&messageId); + /**
+ * New cal to show (or not, depending on setup) the call control window.
+ * @param callId ID of the new call
+ * @param userId User that is on the other end. If conference, list of IDs divided \
by spaces. + */
+ void newCall(const QString &callId, const QString &userId);
+ /**
+ * This one sets name of myself
+ * @param name What the new name is.
+ */
+ void setMyselfName(const QString &name);
+ /**
+ * This one keeps track of chat sessions that know their chat id
+ * @param oldId The old chat ID, or empty if no chat ID was known before
+ * @param newId The new chat ID, or empty if the chat just exists
+ * @param sender Pointer to the session
+ */
+ void setChatId(const QString &oldId, const QString &newId, SkypeChatSession \
*sender); + /**
+ * Some message is meing sent out by Skype, it should be showed
+ * @param body Text of the message
+ * @param chat Id of the chat it was sent to
+ */
+ void sentMessage(const QString &body, const QString &chat);
+ /**
+ * An Id of some message is known, use it
+ * @param messageId New id of that message
+ */
+ void gotMessageId(const QString &messageId);
+ /**
+ * This is used to group conference call participants together
+ * @param callId What call to add to the group
+ * @param groupIt to what group to add it
+ */
+ void groupCall(const QString &callId, const QString &groupId);
+ /**
+ * Remove that call from list
+ * @param callId what call
+ */
+ void removeCall(const QString &callId);
+ /**
+ * Remove reference to a call group
+ * @param groupId What group to remove
+ */
+ void removeCallGroup(const QString &groupId);
+ protected:
+ /**
+ * Creates new skype contact and adds it into the parentContact.
+ * @param contactID ID of the contact (the skype name)
+ * @param parentContact Metacontact to add it into.
+ * @return True if it worked, false otherwise.
+ */
+ virtual bool createContact(const QString &contactID, Kopete::MetaContact \
*parentContact); + public:
+ /**
+ * Constructor.
+ * @param protocol The skype protocol pointer.
+ */
+ SkypeAccount(SkypeProtocol *protocol);
+ /**
+ * Destructor
+ */
+ ~SkypeAccount();
+ /**
+ * Finds contact of given id
+ * @param id id of the wanted contact
+ * @return eather pointer to that contact or 0L of it was not found.
+ */
+ SkypeContact *contact(const QString &id);
+ /**
+ * How to launch the Skype
+ */
+ int launchType;
+ /**
+ * Is this verson of protocol able to create call conferences?
+ */
+ bool ableMultiCall();
+ /**
+ * Is it possible to alter the authorization now?
+ */
+ bool canAlterAuth();
+ /**
+ * How shoul kopete authorize it self? (empty means as kopete)
+ */
+ QString author;
+ /**
+ * This saves properties to the config file
+ */
+ void save();
+ /**
+ * Prepares this contact for life and integrates it into this account. Should be \
called only by the contact in its constructor. + * @param conntact The contact to \
prepare + */
+ void prepareContact(SkypeContact *contact);
+ ///Can we comunicate with the skype? (not with the network, just with the program)
+ bool canComunicate();
+ ///returns the protocol
+ SkypeProtocol * protocol();
+ /**
+ * @return Is the HitchHike mode enabled or not?
+ * @see setHitchHike
+ */
+ bool getHitchHike() const;
+ /**
+ * @return Is the MarkRead mode enabled or not?
+ * @see setMarkRead
+ */
+ bool getMarkRead() const;
+ /**
+ * Is the scan for unread message on login enabled?
+ * @return Is it enabled or not?
+ * @see setSearchForUnread
+ */
+ bool getScanForUnread() const;
+ /**
+ * @return true if this user already has opened chat session, false if he doesn't \
have opened chat session or the user do not exist + * @param userId ID of the user \
in interest + */
+ bool userHasChat(const QString &userId);
+ /**
+ * @return Should a control window be showed for calls?
+ */
+ bool getCallControl() const;
+ /**
+ * Is that call incoming or not?
+ * @param callId What call you want to know?
+ * @return true if the call is incoming call (someone calls you), false otherwise \
(outgoing, not a call at all..) + */
+ bool isCallIncoming(const QString &callId);
+ /**
+ * @return The time after the call finished to auto-closing the window. If \
auto-closing is disabled, 0 is returned + * @see setCallWindowTimeout
+ */
+ int closeCallWindowTimeout() const;
+ /**
+ * @return Returns name that shouls be showed by a call window
+ */
+ QString getUserLabel(const QString &userId);
+ /**
+ * Are pings to Skype enabled?
+ * @return You guess..
+ */
+ bool getPings() const;
+ /**
+ * What bus is set to use now?
+ * @return 0 as session bus, 1 as system wide
+ */
+ int getBus() const;
+ /**
+ * Is starting Dbus when it is not running enabled?
+ * @return You guess..
+ */
+ bool getStartDBus() const;
+ /**
+ * How long does it try to connect to newly started skype, until it gives up \
(seconds) + */
+ int getLaunchTimeout() const;
+ /**
+ * What is the command that launches skype?
+ */
+ const QString &getSkypeCommand() const;
+ /**
+ * Do we wait before connecting?
+ */
+ int getWaitBeforeConnect() const;
+ /**
+ * Do we have that chat opened?
+ * @param chatId What chat are you interested in?
+ */
+ bool chatExists(const QString &chatId);
+ /**
+ * This one returns contact of that name. If that contact does not exist in the \
contact list, a temporary one is created + * @param userId ID of that user
+ */
+ SkypeContact *getContact(const QString &userId);
+ /**
+ * @param messageId ID of a message
+ * @return ID of chat the message belongs to. If no such message exists, the \
result is not defined. + */
+ QString getMessageChat(const QString &messageId);
+ /**
+ * This will mark last active chat (last that sent out some message). It will be \
set an ID soon after that, user will not have time to write another message anyway \
+ * @param session Pointer to that chat session + */
+ void registerLastSession(SkypeChatSession *session);
+ /**
+ * Create a chat with given members
+ * @param users Comma sepparated list of members
+ * @return ID of the chat
+ */
+ QString createChat(const QString &users);
+ /**
+ * Should chat leave when it's window is closed?
+ */
+ bool leaveOnExit() const;
+ /**
+ * Returns the call that should be executed before making a call.
+ * @return The command or empty string if nothing should be executed
+ */
+ QString startCallCommand() const;
+ /**
+ * Should we wait for the startCallCommand to finish before making the call.
+ */
+ bool waitForStartCallCommand() const;
+ /**
+ * The command that should be executed after the call is finished.
+ * @return The command or empty string if user does not want to execute anything.
+ */
+ QString endCallCommand() const;
+ /**
+ * Should be tha command executed only for the last call?
+ */
+ bool endCallCommandOnlyLast() const;
+ /**
+ * Command that should be executed on incoming call, or empty string if nothing to \
execute + */
+ QString incomingCommand() const;
+ /**
+ * Registers this contact to the skype contact list
+ * @param contactId What user should be added?
+ */
+ void registerContact(const QString &contactId);
+ /**
+ * returns how is user authorized
+ * @return 0 if he is authorized, 1 if not and 2 if he is blocked
+ */
+ int getAuthor(const QString &contactId);
+ public slots:
+ /**
+ * Disconnects from server.
+ */
+ virtual void disconnect();
+ /**
+ * Sets online status to away/online.
+ * @param away If true, it sets to away, otherwise it sets to online.
+ * @param reason Message to set. Ignored with skype as it does not support away \
messages. (Or I don't know about it)) + */
+ virtual void setAway(bool away, const QString &reason);
+ /**
+ * Sets online status for the account.
+ * @param status Status to set.
+ * @param reason Away message. Ignored by skype.
+ */
+ //virtual void setOnlineStatus(const Kopete::OnlineStatus &status, const QString \
&reason); + void setOnlineStatus( const Kopete::OnlineStatus &status , const \
Kopete::StatusMessage &reason = Kopete::StatusMessage()); + /**
+ * Connect to the skype with given status
+ * @param status The status to connect with. If it is something unusual (like \
offline or something unknown), online is used + */
+ virtual void connect(const Kopete::OnlineStatus &status);
+ /**
+ * This notifies contact of some change of its information
+ * @param contact What contact is it?
+ * @param change And what happende.
+ */
+ void updateContactInfo(const QString &contact, const QString &change);
+ /**
+ * This will send message by the skype connection. Will take care of all \
notifications when it is done and so. (means it will emit messageSent when it is \
sent) + * @param message What to send.
+ * @param chat Chat to send it to. If it is empty, it is sent just to that person \
listed in the message + */
+ void sendMessage(Kopete::Message &message, const QString &chat);
+ /**
+ * Enables or disables the HitchHike mode of getting messages. If it is enabled, a \
new message to unstarted chat will be showed. If not, they will be ignored and you \
will have to open them in Skype + * @param value True enables HitchHike mode, false \
disables. + * @see getHitchHike
+ */
+ void setHitchHike(bool value);
+ /**
+ * Enables reading messages by kopete. If it is on, all messages showed in Kopete \
will be marked as read, if disable, you will have to read them in Skype/something \
else. + * If HitchHike mode is disabled, messages that creates chats are NOT marked \
as read, because they are not showed. + * @param value Enable or disable the mode
+ * @see getMarkRead
+ * @see getHitchHake
+ * @see setHitchHike
+ */
+ void setMarkRead(bool value);
+ /**
+ * Set if there should be scan for unread messages when kopete connects to Skype.
+ * @param value Enable or disable the scan.
+ * @see getScanForUnread
+ */
+ void setScanForUnread(bool value);
+ /**
+ * Make a call to that user
+ * @param user To who we call.
+ */
+ void makeCall(SkypeContact *user);
+ /**
+ * Make conference call to more than one user (possibly)
+ * @param users comma separated list of user IDs
+ */
+ void makeCall(const QString &users);
+ /**
+ * Set if a control window will be showed for calls.
+ * @param value Is it enabled or disabled now?
+ */
+ void setCallControl(bool value);
+ /**
+ * Sets timeout in seconds how long will be call window visible after the call \
finished. If you want to disable it, set to 0. + */
+ void setCloseWindowTimeout(int timeout);
+ /**
+ * Turns pinging skype on/off
+ * If it is on, every second a ping message is sent to skype so track of if Skype \
is running is still hold. f it is off, skype can be turned off and you won't know it. \
+ * @param enabled Are they on or off from now? + */
+ void setPings(bool enabled);
+ /**
+ * Sets bus on which Skype listens
+ * @param bus 0 -> session bus, 1 -> system wide bus
+ */
+ void setBus(int bus);
+ /**
+ * Should be DBus started when needed?
+ */
+ void setStartDBus(bool enabled);
+ /**
+ * Set the timeout for giving up launching Skype
+ */
+ void setLaunchTimeout(int seconds);
+ /**
+ * Set command by what the Skype will be started
+ */
+ void setSkypeCommand(const QString &command);
+ /**
+ * Set if we wait a while before connecting to just started skype
+ */
+ void setWaitBeforeConnect(int value);
+ /**
+ * This should be called with all new chat sessions to connect all signals to them
+ * @param session The chat session
+ */
+ void prepareChatSession(SkypeChatSession *session);
+ /**
+ * This receives a multi-user chat message and delivers it to the chat session
+ * @param chatId What chat should get it
+ * @param boty Text of that message
+ * @param messageId ID of the received message
+ * @param user The one who sent it
+ */
+ void receiveMultiIm(const QString &chatId, const QString &body, const QString \
&messageId, const QString &user); + /**
+ * Set if chat window should close a chat window when you close it
+ */
+ void setLeaveOnExit(bool value);
+ /**
+ * Open chat to the user
+ * @param userId
+ */
+ void chatUser(const QString &userId);
+ /**
+ * Sets the command to be executed before making/accepting call (or empty if \
nothing) + */
+ void setStartCallCommand(const QString &value);
+ /**
+ * Set the command that will be executed when a call is finished
+ */
+ void setEndCallCommand(const QString &value);
+ /**
+ * Do we wait for the command to be executed before making the call?
+ */
+ void setWaitForStartCallCommand(bool value);
+ /**
+ * Should be the end command executed only for the last closed call or for every \
call that is closed? + */
+ void setEndCallCommandOnlyForLast(bool value);
+ /**
+ * Notify me when a call has begun and I should run the start call command
+ */
+ void startCall();
+ /**
+ * Notify me when the call ends to run the end call command
+ */
+ void endCall();
+ /**
+ * Sets a command to be executed for incoming call
+ */
+ void setIncomingCommand(const QString &command);
+ /**
+ * Removes a given contact from skype
+ */
+ void removeContact(const QString &contactId);
+ /**
+ * authorizes a user
+ * @param userId what user
+ */
+ void authorizeUser(const QString &userId);
+ /**
+ * removes authorization from user
+ * @param userId what user
+ */
+ void disAuthorUser(const QString &userId);
+ /**
+ * Blocks a user (no more messages will be accepted)
+ * @param userId what user
+ */
+ void blockUser(const QString &userId);
+ void setStatusMessage(const Kopete::StatusMessage& statusMessage);
+ void fillActionMenu( KActionMenu *actionMenu );
+ bool hasCustomStatusMenu() const;
+ signals:
+ /**
+ * This is emited when the message has been sent by skype
+ * @param messageId Id of the message that has been sent
+ */
+ void sentMessage(const QString &messageId);
+ /**
+ * This slot notifies of connecting/disconnecting. Needed to be sure, if alling is \
possible. + * @param online Are we online now?
+ */
+ void connectionStatus(bool online);
+};
+
+#endif
Index: kopete/protocols/skype/skypeeditaccount.cpp
===================================================================
--- kopete/protocols/skype/skypeeditaccount.cpp (revision 0)
+++ kopete/protocols/skype/skypeeditaccount.cpp (revision 0)
@@ -0,0 +1,160 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+
+#include "skypeeditaccount.h"
+#include "skypeprotocol.h"
+#include "skypeaccount.h"
+
+#include <qlineedit.h>
+#include <qstring.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kopeteaccountmanager.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <kdebug.h>
+#include <qbuttongroup.h>
+#include <qspinbox.h>
+
+class SkypeEditAccountPrivate {
+ public:
+ ///The protocol
+ SkypeProtocol *protocol;
+ ///The account
+ SkypeAccount *account;
+};
+
+skypeEditAccount::skypeEditAccount(SkypeProtocol *protocol, Kopete::Account \
*account, QWidget *parent) : QWidget(parent), KopeteEditAccountWidget(account) { \
+//skypeEditAccount::skypeEditAccount(SkypeProtocol *protocol, Kopete::Account \
*account, QWidget *parent) : SkypeEditAccountBase(parent), \
KopeteEditAccountWidget(account) { + kDebug() << k_funcinfo << endl;//some debug info
+
+ d = new SkypeEditAccountPrivate();//the d pointer
+ d->protocol = protocol;//I may need the protocol later
+
+ d->account = (SkypeAccount *) account;//save the account
+
+ //Now, check weather it is existing account or just an old one to modify
+ if (account) {//it is old one
+ excludeCheck->setChecked(account->excludeConnect());//Check, weather it should be \
excluded + //LaunchGroup->setButton(d->account->launchType);//set the launch type
+ AuthorCheck->setChecked(!d->account->author.isEmpty());//set the check box that \
allows you to change authorization + if (AuthorCheck->isChecked())
+ AuthorEdit->setText(d->account->author);//set the name
+ MarkCheck->setChecked(d->account->getMarkRead());//set the get read mode
+ HitchCheck->setChecked(d->account->getHitchHike());
+ ScanCheck->setChecked(d->account->getScanForUnread());
+ CallCheck->setChecked(d->account->getCallControl());
+ PingsCheck->setChecked(d->account->getPings());
+ //BusGroup->setButton(d->account->getBus());
+ DBusCheck->setChecked(d->account->getStartDBus());
+ LaunchSpin->setValue(d->account->getLaunchTimeout());
+ CommandEdit->setText(d->account->getSkypeCommand());
+ WaitSpin->setValue(d->account->getWaitBeforeConnect());
+ if (d->account->closeCallWindowTimeout()) {
+ AutoCloseCallCheck->setChecked(true);
+ CloseTimeoutSpin->setValue(d->account->closeCallWindowTimeout());
+ } else AutoCloseCallCheck->setChecked(false);
+ LeaveCheck->setChecked(d->account->leaveOnExit());
+ const QString &startCallCommand = d->account->startCallCommand();
+ StartCallCommandCheck->setChecked(!startCallCommand.isEmpty());
+ StartCallCommandEdit->setText(startCallCommand);
+ WaitForStartCallCommandCheck->setChecked(d->account->waitForStartCallCommand());
+ const QString &endCallCommand = d->account->endCallCommand();
+ EndCallCommandCheck->setChecked(!endCallCommand.isEmpty());
+ EndCallCommandEdit->setText(endCallCommand);
+ OnlyLastCallCommandCheck->setChecked(d->account->endCallCommandOnlyLast());
+ const QString &incomingCommand = d->account->incomingCommand();
+ IncomingCommandCheck->setChecked(!incomingCommand.isEmpty());
+ IncomingCommandEdit->setText(incomingCommand);
+ } else {
+ KMessageBox::information(this, i18n("Please note that this version of Skype plugin \
is a development version and it is probable it will cause more problems than solve. \
You have been warned"), i18n("Version info")); //- I hope it is not needed any more \
+ } +}
+
+skypeEditAccount::~skypeEditAccount() {
+ kDebug() << k_funcinfo << endl;//some debug info
+}
+
+bool skypeEditAccount::validateData() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (d->protocol->hasAccount() && (!account())) {//he wants to create some account \
witch name is already used + KMessageBox::sorry(this, i18n("You can have only one \
skype account"), i18n("Wrong Information"));//Tell him to use something other \
+ return false; + }
+
+ return true;//It seems OK
+}
+
+Kopete::Account *skypeEditAccount::apply() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ //first, I need a pointer to that account
+ if (!account()) //it does not exist
+ setAccount(new SkypeAccount(d->protocol));//create a new one
+ SkypeAccount *skype = static_cast<SkypeAccount *>(account());//get the account
+
+ //TODO: Port to kde4, here Kopete crashed: isChecked() !!!
+ //set it's values
+ skype->setExcludeConnect(excludeCheck->isChecked());//Save the "exclude from \
connection" setup + //skype->launchType = LaunchGroup->selectedId();//get the type \
how to launch skype + if (AuthorCheck->isChecked())
+ skype->author = AuthorEdit->text();//put there what user wrote
+ else
+ skype->author = "";//nothing unusual
+ skype->setHitchHike(HitchCheck->isChecked());//save the hitch hike mode and activat \
ethe new value + skype->setMarkRead(MarkCheck->isChecked());//set the mark read \
messages mode and activate it + skype->setScanForUnread(ScanCheck->isChecked());
+ skype->setCallControl(CallCheck->isChecked());
+ skype->setPings(PingsCheck->isChecked());
+ //skype->setBus(BusGroup->selectedId());
+ skype->setStartDBus(DBusCheck->isChecked());
+ skype->setLaunchTimeout(LaunchSpin->value());
+ skype->setSkypeCommand(CommandEdit->text());
+ skype->setWaitBeforeConnect(WaitSpin->value());
+ skype->setLeaveOnExit(LeaveCheck->isChecked());
+ if (AutoCloseCallCheck->isChecked()) {
+ skype->setCloseWindowTimeout(CloseTimeoutSpin->value());
+ } else {
+ skype->setCloseWindowTimeout(0);
+ }
+ if (StartCallCommandCheck->isChecked()) {
+ skype->setStartCallCommand(StartCallCommandEdit->text());
+ } else {
+ skype->setStartCallCommand("");
+ }
+ skype->setWaitForStartCallCommand(WaitForStartCallCommandCheck->isChecked());
+ if (EndCallCommandCheck->isChecked()) {
+ skype->setEndCallCommand(EndCallCommandEdit->text());
+ } else {
+ skype->setEndCallCommand("");
+ }
+ if (IncomingCommandCheck->isChecked()) {
+ skype->setIncomingCommand(IncomingCommandEdit->text());
+ } else {
+ skype->setIncomingCommand("");
+ }
+
+ skype->setEndCallCommandOnlyForLast(OnlyLastCallCommandCheck->isChecked());
+ skype->save();//save it to config
+ return skype;//return the account
+}
+
+#include "skypeeditaccount.moc"
Index: kopete/protocols/skype/call_end
===================================================================
--- kopete/protocols/skype/call_end (revision 0)
+++ kopete/protocols/skype/call_end (revision 0)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+kill `ps -A | grep artsd`
+artsd &
Property changes on: kopete/protocols/skype/call_end
___________________________________________________________________
Added: svn:executable
+ *
Index: kopete/protocols/skype/skypeaddcontact.cpp
===================================================================
--- kopete/protocols/skype/skypeaddcontact.cpp (revision 0)
+++ kopete/protocols/skype/skypeaddcontact.cpp (revision 0)
@@ -0,0 +1,96 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#include "skypeaddcontact.h"
+#include "skypeprotocol.h"
+#include "ui_skypeaddcontactbase.h"
+#include "skypeaccount.h"
+
+#include <kdebug.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+namespace Ui { class SkypeAddContactBase; }
+
+class SkypeAddContactWidget : public Ui::SkypeAddContactBase, public QWidget {
+ private:
+ public:
+ SkypeAddContactWidget(QWidget *parent, const char *name = 0L) : \
Ui::SkypeAddContactBase() { + kDebug() << k_funcinfo << endl;//some debug info
+ }
+};
+
+class SkypeAddContactPrivate {
+ public:
+ SkypeProtocol *protocol;
+ SkypeAddContactWidget *widget;
+ SkypeAccount *account;
+};
+
+SkypeAddContact::SkypeAddContact(SkypeProtocol *protocol, QWidget *parent, \
SkypeAccount *account, const char *name) : AddContactPage(parent) { + kDebug() << \
k_funcinfo << endl;//some debug info +
+ d = new SkypeAddContactPrivate();//create the d ponter
+ d->protocol = protocol;//remember the protocol
+ d->account = account;
+
+ //TODO: Port to kde4
+ //(new QVBoxLayout(this))->setAutoAdd(true);//create the layout and add there \
automatically + d->widget = new SkypeAddContactWidget(this);//create the insides
+}
+
+
+SkypeAddContact::~SkypeAddContact() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ //free everything (the widget is deleted automatically)
+ delete d;
+}
+
+bool SkypeAddContact::validateData() {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ if (!d->account->canComunicate()) {
+ KMessageBox::sorry(d->widget, i18n("You must connect to Skype first"), i18n("Not \
Connected"), QFlags<KMessageBox::Option>()); + return false;
+ }
+
+ if (d->widget->NameEdit->text().isEmpty()) {//He wrote nothing
+ KMessageBox::sorry(d->widget, i18n("You must write the contact's name"), \
i18n("Wrong Information"));//Tell the user I don't like this at all + return \
false;//and don't allow to continue + }
+
+ if (d->account->contact(d->widget->NameEdit->text())) {//this contact already \
exists in this account + KMessageBox::sorry(d->widget, i18n("This contact already \
exists in this account"), i18n("Wrong Information"));//Tell the user + return \
false;//do not proceed + }
+
+ return true;
+}
+
+bool SkypeAddContact::apply(Kopete::Account *, Kopete::MetaContact *metaContact) {
+ kDebug() << k_funcinfo << endl;//some debug info
+
+ d->account->registerContact(d->widget->NameEdit->text());
+ d->account->addContact(d->widget->NameEdit->text(), metaContact, \
Kopete::Account::ChangeKABC); + return true;//all OK
+}
+
+#include "skypeaddcontact.moc"
Index: kopete/protocols/skype/skypeeditaccountwidget.cpp
===================================================================
--- kopete/protocols/skype/skypeeditaccountwidget.cpp (revision 0)
+++ kopete/protocols/skype/skypeeditaccountwidget.cpp (revision 0)
@@ -0,0 +1,17 @@
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Kopete Developers <kopete-devel@kde.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "skypeeditaccountwidget.h"
+
+skypeEditAccountWidget::skypeEditAccountWidget(QWidget *parent, const char \
*name):skypeEditAccountWidget(parent, name) { +}
+
+#include "skypeeditaccountwidget.moc"
Index: kopete/protocols/skype/skypeprotocol.h
===================================================================
--- kopete/protocols/skype/skypeprotocol.h (revision 0)
+++ kopete/protocols/skype/skypeprotocol.h (revision 0)
@@ -0,0 +1,134 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef SKYPEPROTOCOL_H
+#define SKYPEPROTOCOL_H
+
+#include "kopeteprotocol.h"
+#include "kopeteproperty.h"
+#include <qstring.h>
+
+class SkypeAccount;
+class SkypeProtocolPrivate;
+
+namespace Kopete {
+ class OnlineStatus;
+};
+
+#define LAUNCH_ALLWAYS 0
+#define LAUNCH_NEEDED 1
+#define LAUNCH_NEVER 2
+
+/**
+ * @author Michal Vaner
+ * @short Protocol to use external skype
+ * This protocol is only binding for exteral skype program. The reason to write this \
was I did not like the skype as it was. + */
+class SkypeProtocol : public Kopete::Protocol
+{
+ Q_OBJECT
+ private:
+ SkypeProtocolPrivate *d;
+ public:
+ const Kopete::OnlineStatus Offline;
+ const Kopete::OnlineStatus Online;
+ const Kopete::OnlineStatus SkypeMe;
+ const Kopete::OnlineStatus Away;
+ const Kopete::OnlineStatus NotAvailable;
+ const Kopete::OnlineStatus DoNotDisturb;
+ const Kopete::OnlineStatus Invisible;
+ const Kopete::OnlineStatus Connecting;
+ const Kopete::OnlineStatus NotInList;
+ const Kopete::OnlineStatus NoAuth;
+ const Kopete::OnlineStatus Phone;
+ // contact properties
+/* const Kopete::ContactPropertyTmpl propAwayMessage;
+ const Kopete::ContactPropertyTmpl propFirstName;
+ const Kopete::ContactPropertyTmpl propLastName;*/
+ const Kopete::PropertyTmpl propFullName;
+// const Kopete::ContactPropertyTmpl propEmailAddress;
+ const Kopete::PropertyTmpl propPrivatePhone;
+ const Kopete::PropertyTmpl propPrivateMobilePhone;
+ const Kopete::PropertyTmpl propWorkPhone;
+// const Kopete::ContactPropertyTmpl propWorkMobilePhone;
+ const Kopete::PropertyTmpl propLastSeen;
+ /**
+ * Constructor. This is called automatically on library load.
+ * @param parent Parent of the object.
+ * @param name Name of the object.
+ * @param args Arguments to allow creation by KGenericFactory.
+ * @see KGenericFactory
+ */
+ SkypeProtocol(QObject *parent, const QVariantList &);
+ /**
+ * Destructor.
+ */
+ ~SkypeProtocol();
+ /**
+ * Reimplementation of the methot that creates a new skype account.
+ * @param accountID ID of the account.
+ * @return At the moment NULL, but it will change soon.
+ */
+ virtual Kopete::Account *createNewAccount(const QString &accountID);
+ /**
+ * Reimplementation of the method that creates widget for adding contact to skype \
account. + * @param parent Parent widget. It will be showed inside.
+ * @param account Account to witch it aplies.
+ * @return At the moment NULL, but it will change soon.
+ */
+ virtual AddContactPage *createAddContactWidget(QWidget *parent, Kopete::Account \
*account); + /**
+ * Reimplementation of the method that creates widget for editing/creation of the \
skype account. + * @param account Account to what it applies. (0 means we create a \
new one) + * @param parent Parent widget. It will be showed inside it.
+ * @return NULL at the moment, but it will change soon.
+ */
+ virtual KopeteEditAccountWidget* createEditAccountWidget(Kopete::Account *account, \
QWidget *parent); + /**
+ * Skype plugin allows only one skype account at once. This answers weather one \
exists or not. + * @return true if some account exists and false if not
+ */
+ bool hasAccount() const;
+ /**
+ * Tells skype to remember this account
+ * @param account Pointer to the instance of the account
+ */
+ void registerAccount(SkypeAccount *account);
+ /**
+ * Removes account is some exists
+ */
+ void unregisterAccount();
+ /**
+ * Creates a contact from provided data
+ * @param metaContact Metacontact to add the contact into
+ * @param serializedData Some data to store the contact
+ * @param addressBookData Data inside the address book
+ * @return Brand new loaded contact
+ */
+ virtual Kopete::Contact *deserializeContact(Kopete::MetaContact *metaContact, \
const QMap<QString, QString> &serializedData, const QMap<QString, QString> \
&addressBokkData); + public slots:
+ /**
+ * This enables or disables the "Call by skype" action depending on weather a \
contact(s) are selected and have skype contacts + */
+ void updateCallActionStatus();
+ /**
+ * This calls all selected skype contacts
+ */
+ void callContacts();
+};
+
+#endif
Index: kopete/protocols/skype/skypeeditaccount.h
===================================================================
--- kopete/protocols/skype/skypeeditaccount.h (revision 0)
+++ kopete/protocols/skype/skypeeditaccount.h (revision 0)
@@ -0,0 +1,68 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef SKYPEEDITACCOUNT_H
+#define SKYPEEDITACCOUNT_H
+
+#include <ui_skypeeditaccountbase.h>
+#include "editaccountwidget.h"
+
+class SkypeEditAccountPrivate;
+class SkypeProtocol;
+namespace Ui { class SkypeEditAccountBase; }
+
+/**
+ * @author Michal Vaner
+ * @short Skype account edit-widget
+ * This widget will be showed inside the add account wizard when adding skype \
account or in edit account dialog, when editing skype account. + */
+class skypeEditAccount: public QWidget, private Ui::SkypeEditAccountBase, public \
KopeteEditAccountWidget +//class skypeEditAccount : public Ui::SkypeEditAccountBase, \
public KopeteEditAccountWidget +{
+Q_OBJECT
+ private:
+ ///Some internal things
+ SkypeEditAccountPrivate *d;
+ public:
+ /**
+ * Constructor.
+ * @param account The account we are editing. 0 if new should be created.
+ * @param parent Inside what it will be showed.
+ */
+ skypeEditAccount(SkypeProtocol *protocol, Kopete::Account *account, QWidget \
*parent = 0L); + //skypeEditAccount(QWidget *parent, Kopete::Account *theAccount);
+ /**
+ * Destructor.
+ */
+ virtual ~skypeEditAccount();
+ /**
+ * Check, weather the written data can be used.
+ * @return True if the data are OK, false if not.
+ */
+ virtual bool validateData();
+ /**
+ * Aply all changes. Will change the actual account or create new one, if no was \
given. + * @return Pointer to that account.
+ */
+ virtual Kopete::Account *apply();
+ public slots:
+};
+
+#endif
+
Index: kopete/protocols/skype/skypeconference.cpp
===================================================================
--- kopete/protocols/skype/skypeconference.cpp (revision 0)
+++ kopete/protocols/skype/skypeconference.cpp (revision 0)
@@ -0,0 +1,77 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include "skypeconference.h"
+#include "skypecalldialog.h"
+
+#include <qstring.h>
+#include <qlayout.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+class SkypeConferencePrivate {
+ public:
+ //my id
+ QString id;
+ //The layout
+ QHBoxLayout *layout;
+};
+
+SkypeConference::SkypeConference(const QString &id) : QDialog() {
+ kDebug() << k_funcinfo << endl;
+
+ //create the d pointer
+ d = new SkypeConferencePrivate();
+
+ //some UI
+ //TODO: Port to kde4
+ //setCaption(i18n("Conference Call"));
+ d->layout = new QHBoxLayout(this);
+
+ //remember all things
+ d->id = id;
+
+ //show myself
+ show();
+}
+
+SkypeConference::~SkypeConference() {
+ kDebug() << k_funcinfo << endl;
+
+ //free all memory
+ delete d->layout;
+ delete d;
+}
+
+void SkypeConference::closeEvent(QCloseEvent *) {
+ emit removeConference(d->id);
+
+ deleteLater();
+}
+
+void SkypeConference::embedCall(SkypeCallDialog *dialog) {
+ dialog->hide();
+ //TODO: Port to kde4
+ //insertChild(dialog);
+ //d->layout->add(dialog);
+
+ connect(this, SIGNAL(destroyed()), dialog, SLOT(hangUp()));
+}
+
+#include "skypeconference.moc"
Index: kopete/protocols/skype/skypeaddcontact.h
===================================================================
--- kopete/protocols/skype/skypeaddcontact.h (revision 0)
+++ kopete/protocols/skype/skypeaddcontact.h (revision 0)
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPEADDCONTACT_H
+#define SKYPEADDCONTACT_H
+
+#include <addcontactpage.h>
+
+class SkypeAddContactPrivate;
+class QString;
+class SkypeProtocol;
+class SkypeAccount;
+
+/**
+ * @author Michal Vaner (vorner)
+ * Just a widget with a line and label ;-)
+ */
+class SkypeAddContact : public AddContactPage
+{
+ Q_OBJECT
+ private:
+ ///internal things
+ SkypeAddContactPrivate *d;
+ public:
+ /**
+ * Constructor.
+ * @param protocol Pointer to the Skype protocol.
+ * @param parent Widget inside which I will be showed.
+ * @param name My name I can be found by.
+ */
+ SkypeAddContact(SkypeProtocol *protocol, QWidget *parent, SkypeAccount *account, \
const char *name); + /**
+ * Destructor.
+ */
+ ~SkypeAddContact();
+ /**
+ * Check, weather user wrote something sane.
+ * @return True if it is useable, false otherwise.
+ */
+ virtual bool validateData();
+ public slots:
+ /**
+ * Adds it into the account.kdDebug(14311) << k_funcinfo << endl;//some debug info
+ * @param account Where to add it.
+ * @param metaContact Metacontact which will hold it.
+ * @return True if it worked, false if not.
+ */
+ virtual bool apply(Kopete::Account *account, Kopete::MetaContact *metaContact);
+};
+
+#endif
Index: kopete/protocols/skype/skypeconference.h
===================================================================
--- kopete/protocols/skype/skypeconference.h (revision 0)
+++ kopete/protocols/skype/skypeconference.h (revision 0)
@@ -0,0 +1,64 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#ifndef SKYPECONFERENCE_H
+#define SKYPECONFERENCE_H
+
+#include <qdialog.h>
+
+class SkypeConferencePrivate;
+class SkypeCallDialog;
+
+class QString;
+
+/**
+ * @author Michal Vaner
+ * @short Dialog to group calls
+ * This dialog can group calls that belongs
+ */
+class SkypeConference : public QDialog
+{
+ Q_OBJECT
+ private:
+ ///Here are stored the private things, just for better readibility
+ SkypeConferencePrivate *d;
+ protected:
+ ///Make a suicide when closed
+ virtual void closeEvent(QCloseEvent *e);
+ public:
+ /**
+ * Constructor, also shows itself
+ * @param id My ID
+ */
+ SkypeConference(const QString &id);
+ ///Destrucotr
+ ~SkypeConference();
+ /**
+ * Add a call to this group
+ * @param dialog What to add there
+ */
+ void embedCall(SkypeCallDialog *dialog);
+ signals:
+ /**
+ * The conference is being removed right now
+ * @param conferenceId what conference
+ */
+ void removeConference(const QString &conferenceId);
+};
+
+#endif
Index: kopete/protocols/skype/kopete_skype.desktop
===================================================================
--- kopete/protocols/skype/kopete_skype.desktop (revision 0)
+++ kopete/protocols/skype/kopete_skype.desktop (revision 0)
@@ -0,0 +1,53 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+X-Kopete-Version=1000900
+Icon=skype_protocol
+ServiceTypes=Kopete/Protocol
+X-KDE-Library=kopete_skype
+X-Kopete-Messaging-Protocol=messaging/skype
+X-KDE-PluginInfo-Author=Kopete Developers
+X-KDE-PluginInfo-Email=kopete-devel@kde.org
+X-KDE-PluginInfo-Name=kopete_skype
+X-KDE-PluginInfo-Version=0.0.0
+X-KDE-PluginInfo-Website=http://kopete.kde.org
+X-KDE-PluginInfo-Category=Protocols
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=false
+Name=Skype
+Name[pa]=ਸਕਾਈਪੀ
+Name[tg]=Скайп
+Name[xx]=xxSkypexx
+Comment=Skype protocol plugin (only wrapper!)
+Comment[ar]= قابس ميفاق Skype (only wrapper!)
+Comment[be]=Утулка пратаколу Skype (толькі wrapper!)
+Comment[bg]=Приставка за протокола Skype (само \
обвивка!) +Comment[cs]=Modul protokolu Skype (pouze wrapper!)
+Comment[da]=Plugin for skype-protokol (kun wrapper!)
+Comment[de]=Skype Protokoll-Modul (nur ein Wrapper!)
+Comment[el]= ρόσθετο πρωτοκόλλου Skype (μόνο \
ενσωμάτωση!) +Comment[es]=Extensión del protocolo skype (Solo la capa \
externa) +Comment[et]=Skype protokolli plugin (ainult kest!)
+Comment[fr]=Plugin gérant le protocole Skype (redirige seulement les appels)
+Comment[ga]=Breiseán prótacail Skype (rapar amháin!)
+Comment[gl]=Plugin para o protocolo de Skype (só interface!)
+Comment[hr]=Dodatak za Skype protokol (samo omotač!)
+Comment[it]=Plugin per il protocollo Skype (solo un impacchettatore!)
+Comment[ka]=Skype-ის ოქმის მოდული (მხოლოდ \
გა დამქმნელი!) +Comment[lt]=Skype protokolo priedas (tik \
apvalkalas!) +Comment[ms]=Plugin protokol Skype (hanya pembalut!)
+Comment[nds]=Moduul för dat Skype-Protokoll (bloots en Ümtoprogramm!)
+Comment[nl]=Skype-protocolplugin (alleen schil!)
+Comment[pa]=ਸਕਾਈਪੀ (Skype) ਪਰੋਟੋਕਾਲ \
ਪਲੱਗਿੰਨ (ਸਿਰਫ਼ ਰੇਪਰ!) +Comment[pt]='Plugin' para o \
protocolo do Skype (apenas interface!) +Comment[pt_BR]=Plugin para o protocolo \
Skype(somente encapsulamento!) +Comment[ru]=Модуль для работы с \
протоколом Skype через официальный клиент \
+Comment[sk]=Modul pre Skype protokol (len obálka!) +Comment[sr]=Прикључак \
Skype протокола (само омотач!) +Comment[sr@Latn]=Priključak Skype \
protokola (samo omotač!) +Comment[sv]=Protokollinsticksprogram för Skype (bara \
omgivning) +Comment[tg]=Модул барои кор кардан бо \
протоколи Скайп бо воситаи мизоҷи расмӣ \
+Comment[tr]=Skype protokolü eklentisi +Comment[uk]=Втулок протоколу \
Skype (тільки обгортка) +Comment[xx]=xxSkype protocol plugin (only \
wrapper!)xx
Index: kopete/protocols/skype/icons/ox22-action-call.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: kopete/protocols/skype/icons/ox22-action-call.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/icons/ox32-action-call.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: kopete/protocols/skype/icons/ox32-action-call.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/icons/ox16-action-contact_ffc_overlay.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: kopete/protocols/skype/icons/ox16-action-contact_ffc_overlay.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/icons/ox16-action-call.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: kopete/protocols/skype/icons/ox16-action-call.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/icons/ox16-action-contact_unknown_overlay.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: \
kopete/protocols/skype/icons/ox16-action-contact_unknown_overlay.png \
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/icons/ox16-app-skype_protocol.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: kopete/protocols/skype/icons/ox16-app-skype_protocol.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/icons/CMakeLists.txt
===================================================================
--- kopete/protocols/skype/icons/CMakeLists.txt (revision 0)
+++ kopete/protocols/skype/icons/CMakeLists.txt (revision 0)
@@ -0,0 +1,5 @@
+########### next target ###############
+
+kde4_install_icons( ${DATA_INSTALL_DIR}/kopete/icons )
+
+########### install files ###############
Index: kopete/protocols/skype/icons/ox16-action-skype_connect.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: kopete/protocols/skype/icons/ox16-action-skype_connect.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: kopete/protocols/skype/ui/skypeeditaccountbase.ui
===================================================================
--- kopete/protocols/skype/ui/skypeeditaccountbase.ui (revision 0)
+++ kopete/protocols/skype/ui/skypeeditaccountbase.ui (revision 0)
@@ -0,0 +1,1077 @@
+<ui version="4.0" >
+ <class>SkypeEditAccountBase</class>
+ <widget class="QWidget" name="SkypeEditAccountBase" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1063</width>
+ <height>444</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" >
+ <string>If you have problems with arts and sound, you can use this to turn off \
arts for the call only. There are scripts duing this bundled with the kopete plugin \
(somewhere in you kde_folder/share/apps/kopete_skype) you can use.</string> + \
</property> + <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QTabWidget" name="TabWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>&Basic Setup</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="Q3GroupBox" name="groupBox1" >
+ <property name="title" >
+ <string>Account Information</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="excludeCheck" >
+ <property name="whatsThis" >
+ <string>Check this if you do not want to connect with other \
protocols</string> + </property>
+ <property name="text" >
+ <string>E&xclude from connection</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>71</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="Q3GroupBox" name="groupBox3" >
+ <property name="title" >
+ <string>Important Note</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel3" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth" >
+ <number>0</number>
+ </property>
+ <property name="text" >
+ <string><p align="left">This is just a bridge to external running \
skype. This hase some consequences, like you need running instance of skype and thet \
only one skype account is possible</p></string> + </property>
+ <property name="textFormat" >
+ <enum>Qt::AutoText</enum>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer10_2" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="TabPage" >
+ <attribute name="title" >
+ <string>Lau&nch</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="Q3ButtonGroup" name="LaunchGroup" >
+ <property name="whatsThis" >
+ <string>You can set weather and when should kopete launch skype.</string>
+ </property>
+ <property name="title" >
+ <string>Launch Skype</string>
+ </property>
+ <property name="selectedId" stdset="0" >
+ <number>0</number>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QRadioButton" name="LaunchNeededRadio" >
+ <property name="text" >
+ <string>When &not running</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="LaunchNeverRadio" >
+ <property name="text" >
+ <string>N&ever</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel1" >
+ <property name="text" >
+ <string>Command:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="CommandEdit" >
+ <property name="text" >
+ <string>artsdsp skype --use-session-dbus</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel1_4" >
+ <property name="text" >
+ <string>Launch timeout:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="LaunchSpin" >
+ <property name="minimum" >
+ <number>3</number>
+ </property>
+ <property name="maximum" >
+ <number>60</number>
+ </property>
+ <property name="value" >
+ <number>30</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel2_3" >
+ <property name="text" >
+ <string>s</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer23" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>151</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="DBusCheck" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Launches DBus when not running</string>
+ </property>
+ <property name="whatsThis" >
+ <string>This will start session DBus if connection is set to session and \
it is not running. The prefered way is to set it in startup script, thought, so this \
if off by default.</string> + </property>
+ <property name="text" >
+ <string>Laun&ch DBus</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel2_4" >
+ <property name="text" >
+ <string>Wait before connect:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="WaitSpin" >
+ <property name="toolTip" >
+ <string>trying</string>
+ </property>
+ <property name="whatsThis" >
+ <string>trying</string>
+ </property>
+ <property name="minimum" >
+ <number>0</number>
+ </property>
+ <property name="maximum" >
+ <number>120</number>
+ </property>
+ <property name="value" >
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel1_5" >
+ <property name="text" >
+ <string>s</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer21" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>218</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel2" >
+ <property name="text" >
+ <string>If you get error that Skype was not found and it is running, check \
instructions at http://www.skype.com/community/devzone/SkypeAPIforLinux.html or use \
session bus. (start skype with --use-session-dbus)</string> + </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer8" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="TabPage" >
+ <attribute name="title" >
+ <string>C&onnection</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="Q3GroupBox" name="groupBox3_2" >
+ <property name="whatsThis" >
+ <string>Each application that wants to use skype must tell a name to it \
and user is asked weather to allow such application to access it.<br> +By default, \
kopete provides kopete as its name, but if you suspect another application that it \
access skype with this name, you can set another and disallow applications that tries \
to log in as kopete.</string> + </property>
+ <property name="title" >
+ <string>Authorization</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="AuthorCheck" >
+ <property name="text" >
+ <string>&Non-standard authorization</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="AuthorEdit" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="Q3ButtonGroup" name="BusGroup" >
+ <property name="toolTip" >
+ <string>What bus do you want to use</string>
+ </property>
+ <property name="whatsThis" >
+ <string>What bus do you want to use to connect to Skype.<br>Session: \
Your own, other people can not get to that. (use --use-session-dbus to start skype on \
that bus).<br>System: This one is shared by all people on the same computer. \
Oddly, this one is used by default by Skype.it.<br>You have to use the same as \
uses Skype</string> + </property>
+ <property name="title" >
+ <string>Bus</string>
+ </property>
+ <property name="selectedId" stdset="0" >
+ <number>0</number>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QRadioButton" name="radioButton4" >
+ <property name="text" >
+ <string>Sessi&on</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton5" >
+ <property name="text" >
+ <string>S&ystem</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel1_2" >
+ <property name="text" >
+ <string>Note that Kopete will freeze while Skype asks you if it can let \
Kopete in. This is usual and if you allow it for ever (check that "Remember" checkbox \
on the Skype's dialog), it will not happen again.</string> + </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer7_2" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="TabPage" >
+ <attribute name="title" >
+ <string>&Activity</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="HitchCheck" >
+ <property name="toolTip" >
+ <string>Show all incoming messages</string>
+ </property>
+ <property name="whatsThis" >
+ <string>This will show all skype incoming messages. If this is off, they \
are showed only if the message belongs to chat that is started by kopete.</string> + \
</property> + <property name="text" >
+ <string>Hitchhike incoming &messages</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="MarkCheck" >
+ <property name="toolTip" >
+ <string>This will mark incoming messages as read so if you have Skype set \
up not to automatically pop-up chats, it will not flash that exclamation \
icon.</string> + </property>
+ <property name="text" >
+ <string>Mar&k as read</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="ScanCheck" >
+ <property name="whatsThis" >
+ <string>If this is checked, Kopete will ask Skype on login, if it has any \
unshowed messages and show them. This is handy if you start Kopete later than Skype \
and Skype is configured not to show incoming messages.</string> + </property>
+ <property name="text" >
+ <string>Scan f&or unread</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="CallCheck" >
+ <property name="toolTip" >
+ <string>Show call control window for all cals</string>
+ </property>
+ <property name="whatsThis" >
+ <string>This will show a call control window for every call (both incoming \
and outgoing). If it is off, you can call from Kopete, byt you have to control that \
call from Skype.</string> + </property>
+ <property name="text" >
+ <string>S&how call control</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer9" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="AutoCloseCallCheck" >
+ <property name="toolTip" >
+ <string>Auto close the call control window</string>
+ </property>
+ <property name="whatsThis" >
+ <string>This will close tha call control window automatically when the \
call finishes</string> + </property>
+ <property name="text" >
+ <string>Autoc&lose</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer14" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>361</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer10" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel1_3" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Timeout:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="CloseTimeoutSpin" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="maximum" >
+ <number>120</number>
+ </property>
+ <property name="value" >
+ <number>5</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel2_2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>s</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer12" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>301</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="PingsCheck" >
+ <property name="toolTip" >
+ <string>If this is enabled, Kopete keeps track of wether the Skype is \
running.</string> + </property>
+ <property name="whatsThis" >
+ <string>This keeps track of wether Skype is running. Turning this off \
makes only sence it you're trying to get some not-flooded debug output.</string> + \
</property> + <property name="text" >
+ <string>Pi&ng Skype</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="LeaveCheck" >
+ <property name="toolTip" >
+ <string>Leave a chat on window exit</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Leave a chat when it's chat window is closed. Makes difference \
only with multi-user chats, if it is unchecked, you will continue receiving messages \
from that chat even after closing the window.</string> + </property>
+ <property name="text" >
+ <string>Leave on e&xit</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer13" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>70</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="TabPage" >
+ <attribute name="title" >
+ <string>&Calls</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="StartCallCommandCheck" >
+ <property name="text" >
+ <string>E&xecute before call</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer12_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="StartCallCommandEdit" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer13_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="WaitForStartCallCommandCheck" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>This will wait before making/accepting the call for the command \
to finish</string> + </property>
+ <property name="whatsThis" >
+ <string>This will wait for the command to finish before accepting/making \
the call.<br> +Note that it will freeze kopete for the time.</string>
+ </property>
+ <property name="text" >
+ <string>Wait for fi&nish</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="EndCallCommandCheck" >
+ <property name="text" >
+ <string>Execute after call</string>
+ </property>
+ <property name="shortcut" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer14_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="EndCallCommandEdit" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer15" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="OnlyLastCallCommandCheck" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Ususally makes no difference, just when there are some other \
calls on hold, it is executend only for the last ended one.</string> + \
</property> + <property name="text" >
+ <string>Onl&y for last call</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="IncomingCommandCheck" >
+ <property name="text" >
+ <string>Execute on inco&ming call</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer15_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="IncomingCommandEdit" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="textLabel1_6" >
+ <property name="text" >
+ <string>If you have problems with arts while calling, you can use this to \
turn off arts for the call (I bundled scripts doing that, somewhere in \
kde_folder/share/apps/kopete_skype, names call_start and call_end)</string> + \
</property> + <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer16" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>Q3GroupBox</class>
+ <extends>QGroupBox</extends>
+ <header>Qt3Support/Q3GroupBox</header>
+ <container>1</container>
+ </customwidget>
+ <customwidget>
+ <class>Q3ButtonGroup</class>
+ <extends>Q3GroupBox</extends>
+ <header>Qt3Support/Q3ButtonGroup</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>AuthorCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>AuthorEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>CallCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>AutoCloseCallCheck</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>AutoCloseCallCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CloseTimeoutSpin</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>CallCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>AutoCloseCallCheck</receiver>
+ <slot>setChecked(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>StartCallCommandCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>StartCallCommandEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>StartCallCommandCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>WaitForStartCallCommandCheck</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>EndCallCommandCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EndCallCommandEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>EndCallCommandCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>OnlyLastCallCommandCheck</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>IncomingCommandCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>IncomingCommandEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Index: kopete/protocols/skype/ui/skypeaddcontactbase.ui
===================================================================
--- kopete/protocols/skype/ui/skypeaddcontactbase.ui (revision 0)
+++ kopete/protocols/skype/ui/skypeaddcontactbase.ui (revision 0)
@@ -0,0 +1,131 @@
+<ui version="4.0" >
+ <class>SkypeAddContactBase</class>
+ <widget class="QWidget" name="SkypeAddContactBase" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>362</width>
+ <height>372</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Add Skype Contact</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel1" >
+ <property name="text" >
+ <string>Skype name:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="NameEdit" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Q3GroupBox" name="groupBox1" >
+ <property name="title" >
+ <string>Search</string>
+ </property>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="textLabel2" >
+ <property name="text" >
+ <string>Sorry, but the search function was not yet implemented.</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" >
+ <item>
+ <spacer name="spacer3" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="SearchButton" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Se&arch</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer5" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer4" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>Q3GroupBox</class>
+ <extends>QGroupBox</extends>
+ <header>Qt3Support/Q3GroupBox</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
Index: kopete/protocols/skype/ui/skypedetailsbase.ui
===================================================================
--- kopete/protocols/skype/ui/skypedetailsbase.ui (revision 0)
+++ kopete/protocols/skype/ui/skypedetailsbase.ui (revision 0)
@@ -0,0 +1,290 @@
+<ui version="4.0" >
+ <class>SkypeDetailsBase</class>
+ <widget class="QDialog" name="SkypeDetailsBase" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>365</width>
+ <height>331</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Users Details</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="textLabel1" >
+ <property name="text" >
+ <string>Skype ID:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="1" >
+ <widget class="QLineEdit" name="idEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLineEdit" name="privatePhoneEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="0" colspan="2" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer6" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton3" >
+ <property name="text" >
+ <string>&Close</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer7" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="9" column="1" >
+ <widget class="QComboBox" name="authorCombo" >
+ <item>
+ <property name="text" >
+ <string>Authorized</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Not Authorized</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Blocked</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QLabel" name="textLabel5" >
+ <property name="text" >
+ <string>Mobile phone:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="textLabel6" >
+ <property name="text" >
+ <string>Work phone:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1" >
+ <widget class="QLineEdit" name="homepageEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="textLabel4" >
+ <property name="text" >
+ <string>Private phone:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="0" >
+ <widget class="QLabel" name="textLabel7" >
+ <property name="text" >
+ <string>Is authorized:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" >
+ <widget class="QLineEdit" name="mobilePhoneEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" >
+ <widget class="QLineEdit" name="workPhoneEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="1" column="0" >
+ <widget class="QLabel" name="textLabel2" >
+ <property name="text" >
+ <string>Nick:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLineEdit" name="nameEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="nickEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="textLabel3" >
+ <property name="text" >
+ <string>Full name:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0" >
+ <widget class="QLabel" name="textLabel1_2" >
+ <property name="text" >
+ <string>Homepage:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="textLabel1_3" >
+ <property name="text" >
+ <string>Sex:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLineEdit" name="sexEdit" >
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>pushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>SkypeDetailsBase</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>authorCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>SkypeDetailsBase</receiver>
+ <slot>changeAuthor(int)</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Index: kopete/protocols/skype/ui/skypecalldialogbase.ui
===================================================================
--- kopete/protocols/skype/ui/skypecalldialogbase.ui (revision 0)
+++ kopete/protocols/skype/ui/skypecalldialogbase.ui (revision 0)
@@ -0,0 +1,328 @@
+<ui version="4.0" >
+ <class>SkypeCallDialogBase</class>
+ <widget class="QDialog" name="SkypeCallDialogBase" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>430</width>
+ <height>235</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Skype Call</string>
+ </property>
+ <property name="sizeGripEnabled" >
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="1" >
+ <widget class="QLabel" name="NameLabel" >
+ <property name="toolTip" >
+ <string>Partners name</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Name of the other person of call (or list of names if the call is \
conference).</string> + </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="textLabel1" >
+ <property name="toolTip" >
+ <string>Partners</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Name</string>
+ </property>
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="textLabel2" >
+ <property name="toolTip" >
+ <string>Time elapsed</string>
+ </property>
+ <property name="whatsThis" >
+ <string>together.</string>
+ </property>
+ <property name="text" >
+ <string>Time:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="CreditLabel" >
+ <property name="toolTip" >
+ <string>Skype-out credits left</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Skype-ou credits left</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="TimeLabel" >
+ <property name="toolTip" >
+ <string>Time elapsed</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Total time elapsed by the call/<br />time elapsed by the call and \
on hold together.</string> + </property>
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="StatusLabel" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="textLabel1_2" >
+ <property name="text" >
+ <string>Status:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="textLabel3" >
+ <property name="toolTip" >
+ <string>Skype-out credits left</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Skype-ou credits left</string>
+ </property>
+ <property name="text" >
+ <string>Skype-out credits:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer name="spacer3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>48</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="AcceptButton" >
+ <property name="toolTip" >
+ <string>Accept call</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Accept incoming call</string>
+ </property>
+ <property name="text" >
+ <string>Accept</string>
+ </property>
+ <property name="shortcut" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="HangButton" >
+ <property name="toolTip" >
+ <string>Finish the call</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Terminate the call</string>
+ </property>
+ <property name="text" >
+ <string>H&ang up</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="HoldButton" >
+ <property name="toolTip" >
+ <string>Hold the call</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Interrupt the call for a moment and resume (or hang up) it \
later</string> + </property>
+ <property name="text" >
+ <string>H&old</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton4" >
+ <property name="toolTip" >
+ <string>Open chat to the person</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Open chat to the person you are talking with</string>
+ </property>
+ <property name="text" >
+ <string>Chat</string>
+ </property>
+ <property name="shortcut" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="spacer2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>49</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>AcceptButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SkypeCallDialogBase</receiver>
+ <slot>acceptCall()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>HangButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SkypeCallDialogBase</receiver>
+ <slot>hangUp()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>HoldButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SkypeCallDialogBase</receiver>
+ <slot>holdCall()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>pushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>SkypeCallDialogBase</receiver>
+ <slot>chatUser()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Index: kopete/protocols/skype/CMakeLists.txt
===================================================================
--- kopete/protocols/skype/CMakeLists.txt (revision 0)
+++ kopete/protocols/skype/CMakeLists.txt (revision 0)
@@ -0,0 +1,107 @@
+# src
+
+add_subdirectory( icons )
+#add_subdirectory( libskype )
+#add_subdirectory( ui )
+
+include_directories(
+# /usr/include/qt4
+# /usr/include/qt4/QtCore
+# /usr/include/qt4/Qt/
+# /usr/include
+# /usr/include/dbus-1.0
+# /usr/lib/dbus-1.0/include
+ #/usr/include/kopete
+ #/usr/include/kopete/ui/
+ #/usr/include/kde
+
+ ${KOPETE_INCLUDES}
+
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ #${CMAKE_CURRENT_SOURCE_DIR}/ui
+ ${CMAKE_CURRENT_SOURCE_DIR}/libskype
+ ${CMAKE_CURRENT_SOURCE_DIR}/libskype/skypedbus
+
+ ${CMAKE_CURRENT_BUILD_DIR}
+ ${CMAKE_CURRENT_BUILD_DIR}/ui
+ ${CMAKE_CURRENT_BUILD_DIR}/libskype
+ ${CMAKE_CURRENT_BUILD_DIR}/libskype/skypedbus
+)
+
+########### next target ###############
+
+set(
+ skypedbus_SRCS
+
+ libskype/skypedbus/skypeconnection.cpp
+)
+
+set(
+ libskype_SRCS
+
+ libskype/skype.cpp
+)
+
+set(
+ kopete_skype_ui_SRCS
+
+# ui/empty.cpp
+# ui/skypeaddcontactbase.cpp
+# ui/skypecalldialogbase.cpp
+# ui/skypedetailsbase.cpp
+# ui/skypeeditaccountbase.cpp
+)
+
+kde4_add_ui_files(
+ kopete_skype_ui_SRCS
+
+# ui/empty.cpp
+ ui/skypeaddcontactbase.ui
+ ui/skypecalldialogbase.ui
+ ui/skypedetailsbase.ui
+ ui/skypeeditaccountbase.ui
+)
+
+set(
+ kopete_skype_SRCS
+
+ ${skypedbus_SRCS}
+ ${libskype_SRCS}
+ ${kopete_skype_ui_SRCS}
+ skypeaccount.cpp
+ skypeaddcontact.cpp
+ skypecalldialog.cpp
+ skypeconference.cpp
+ skypecontact.cpp
+ skypedetails.cpp
+ skypeeditaccount.cpp
+# skypeeditaccountwidget.cpp
+ skypechatsession.cpp
+ skypeprotocol.cpp
+)
+
+#kde4_add_plugin( skypedbus ${skypedbus_SRCS} )
+
+#kde4_add_plugin( libskype ${libskype_SRCS} )
+
+kde4_add_plugin( kopete_skype ${kopete_skype_SRCS} )
+
+#add_library( kopete_skype SHARED ${kopete_skype_SRCS} ${skypedbus} ${libskype} \
${QT_QT3SUPPORT_LIBRARY}) +
+target_link_libraries(
+ kopete_skype
+
+# skypedbus
+# libskype
+ kopete
+ ${QT_QT3SUPPORT_LIBRARY}
+ ${KDE4_KDE3SUPPORT_LIBS}
+)
+
+install(TARGETS kopete_skype DESTINATION ${PLUGIN_INSTALL_DIR})
+
+########### install files ###############
+
+install( FILES kopete_skype.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
+install( FILES skypeui.rc skypechatui.rc DESTINATION \
${DATA_INSTALL_DIR}/kopete_skype ) +install( PROGRAMS call_end call_start DESTINATION \
${DATA_INSTALL_DIR}/kopete_skype )
Index: kopete/protocols/telepathy/telepathyaddpendingcontactjob.cpp
===================================================================
--- kopete/protocols/telepathy/telepathyaddpendingcontactjob.cpp (revision 869463)
+++ kopete/protocols/telepathy/telepathyaddpendingcontactjob.cpp (working copy)
@@ -35,7 +35,7 @@
#include "telepathyaccount.h"
#include "telepathycontact.h"
-using namespace Kopete::UI;
+//using namespace Kopete::UI;
class TelepathyAddPendingContactJob::Private
{
Index: kopete/protocols/CMakeLists.txt
===================================================================
--- kopete/protocols/CMakeLists.txt (revision 869463)
+++ kopete/protocols/CMakeLists.txt (working copy)
@@ -19,17 +19,18 @@
option(WITH_jabber "Enable Kopete Jabber protocol" ON)
option(WITH_bonjour "Enable Kopete Bonjour protocol" ON)
option(WITH_irc "Enable Kopete IRC protocol" OFF)
+option(WITH_skype "Enable Kopete Skype protocol" ON)
include_directories(${KOPETE_INCLUDES})
if(WITH_msn)
- add_subdirectory( msn )
+ add_subdirectory( msn )
endif(WITH_msn)
if(WITH_oscar)
add_subdirectory( oscar )
endif(WITH_oscar)
if(WITH_yahoo)
- add_subdirectory( yahoo )
+ add_subdirectory( yahoo )
endif(WITH_yahoo)
if(WITH_qq)
add_subdirectory( qq )
@@ -85,4 +86,9 @@
endif(DNSSD_FOUND)
endif(WITH_bonjour)
+if(WITH_skype)
+ message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: WARNING: Skype protocol is not work \
yet") + add_subdirectory( skype )
+endif(WITH_skype)
+
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: Meanwhile protocol has been disabled \
because it is not ported to KDE4 yet.")
["signature.asc" (application/pgp-signature)]
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic