summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skypekit
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-14 19:41:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-14 19:41:18 +0000
commit5c2da0fd5b2542d99750747fc746013b7755ddae (patch)
tree244101a9e85129c514bcc9f54d7ed3be1b4a3742 /protocols/Skype/src/skypekit
parentdca0e0ddd70216e068e98f13e7df2c5517ff0164 (diff)
callbacks removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4947 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skypekit')
-rw-r--r--protocols/Skype/src/skypekit/account.cpp15
-rw-r--r--protocols/Skype/src/skypekit/account.h5
-rw-r--r--protocols/Skype/src/skypekit/contact.cpp18
-rw-r--r--protocols/Skype/src/skypekit/contact.h7
-rw-r--r--protocols/Skype/src/skypekit/conversation.cpp12
-rw-r--r--protocols/Skype/src/skypekit/conversation.h7
-rw-r--r--protocols/Skype/src/skypekit/group.cpp16
-rw-r--r--protocols/Skype/src/skypekit/group.h5
-rw-r--r--protocols/Skype/src/skypekit/message.cpp1
-rw-r--r--protocols/Skype/src/skypekit/participant.cpp1
-rw-r--r--protocols/Skype/src/skypekit/search.cpp17
-rw-r--r--protocols/Skype/src/skypekit/search.h8
-rw-r--r--protocols/Skype/src/skypekit/transfer.cpp16
-rw-r--r--protocols/Skype/src/skypekit/transfer.h7
14 files changed, 34 insertions, 101 deletions
diff --git a/protocols/Skype/src/skypekit/account.cpp b/protocols/Skype/src/skypekit/account.cpp
index 088d747a77..995b070b72 100644
--- a/protocols/Skype/src/skypekit/account.cpp
+++ b/protocols/Skype/src/skypekit/account.cpp
@@ -1,14 +1,10 @@
+#include "..\skype.h"
#include "account.h"
-CAccount::CAccount(unsigned int oid, SERootObject* root) : Account(oid, root)
+CAccount::CAccount(CSkypeProto *_ppro, unsigned int oid, SERootObject* root) :
+ Account(oid, root),
+ ppro(_ppro)
{
- this->ppro = NULL;
-}
-
-void CAccount::SetOnAccountChangedCallback(OnAccountChanged callback, CSkypeProto *ppro)
-{
- this->ppro = ppro;
- this->callback = callback;
}
bool CAccount::IsOnline()
@@ -32,6 +28,5 @@ bool CAccount::SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result)
void CAccount::OnChange(int prop)
{
- if (this->ppro != NULL)
- (ppro->*callback)(prop);
+ ppro->OnAccountChanged(prop);
} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/account.h b/protocols/Skype/src/skypekit/account.h
index ce6151da63..3b2b7063a5 100644
--- a/protocols/Skype/src/skypekit/account.h
+++ b/protocols/Skype/src/skypekit/account.h
@@ -10,16 +10,13 @@ public:
typedef DRef<CAccount, Account> Ref;
typedef DRefs<CAccount, Account> Refs;
- CAccount(unsigned int oid, SERootObject* root);
+ CAccount(CSkypeProto*, unsigned int oid, SERootObject* root);
bool IsOnline();
bool SetAvatar(SEBinary avatar, Skype::VALIDATERESULT &result);
-
- void SetOnAccountChangedCallback(OnAccountChanged callback, CSkypeProto *ppro);
private:
CSkypeProto* ppro;
- OnAccountChanged callback;
void OnChange(int prop);
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/contact.cpp b/protocols/Skype/src/skypekit/contact.cpp
index 6031837afe..30be4b478c 100644
--- a/protocols/Skype/src/skypekit/contact.cpp
+++ b/protocols/Skype/src/skypekit/contact.cpp
@@ -1,9 +1,10 @@
+#include "..\skype.h"
#include "contact.h"
-CContact::CContact(unsigned int oid, SERootObject* root) : Contact(oid, root)
+CContact::CContact(CSkypeProto* _ppro, unsigned int oid, SERootObject* root) :
+ Contact(oid, root),
+ proto(_ppro)
{
- this->proto = NULL;
- this->callback == NULL;
}
SEString CContact::GetSid()
@@ -38,21 +39,14 @@ bool CContact::GetFullname(SEString &firstName, SEString &lastName)
if (pos != -1)
{
firstName = fullname.substr(0, pos - 1);
- lastName = fullname.right(fullname.size() - pos - 1);
+ lastName = fullname.right((int)fullname.size() - pos - 1);
} else
firstName = fullname;
return true;
}
-void CContact::SetOnContactChangedCallback(OnContactChanged callback, CSkypeProto* proto)
-{
- this->proto = proto;
- this->callback = callback;
-}
-
void CContact::OnChange(int prop)
{
- if (this->proto)
- (proto->*callback)(this->ref(), prop);
+ proto->OnContactChanged(this->ref(), prop);
} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/contact.h b/protocols/Skype/src/skypekit/contact.h
index ee36764c50..d15c684815 100644
--- a/protocols/Skype/src/skypekit/contact.h
+++ b/protocols/Skype/src/skypekit/contact.h
@@ -5,22 +5,17 @@
class CContact : public Contact
{
public:
- typedef void (CSkypeProto::* OnContactChanged)(CContact::Ref contact, int);
-
typedef DRef<CContact, Contact> Ref;
typedef DRefs<CContact, Contact> Refs;
- CContact(unsigned int oid, SERootObject* root);
+ CContact(CSkypeProto*, unsigned int oid, SERootObject* root);
SEString GetSid();
SEString GetNick();
bool GetFullname(SEString &firstName, SEString &lastName);
- void SetOnContactChangedCallback(OnContactChanged callback, CSkypeProto* proto);
-
private:
CSkypeProto* proto;
- OnContactChanged callback;
void OnChange(int prop);
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/conversation.cpp b/protocols/Skype/src/skypekit/conversation.cpp
index 25ffbffbfe..3aa6fe39f2 100644
--- a/protocols/Skype/src/skypekit/conversation.cpp
+++ b/protocols/Skype/src/skypekit/conversation.cpp
@@ -1,13 +1,7 @@
+#include "..\skype.h"
#include "conversation.h"
-CConversation::CConversation(unsigned int oid, SERootObject* root) : Conversation(oid, root) { }
-
-void CConversation::SetOnConvoChangedCallback(OnConvoChanged callback)
+CConversation::CConversation(unsigned int oid, SERootObject* root) :
+ Conversation(oid, root)
{
- this->callback = callback;
}
-
-void CConversation::OnChange(int prop)
-{
- //(((CSkypeProto*)this->root)->*callback)(this->ref(), prop);
-} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/conversation.h b/protocols/Skype/src/skypekit/conversation.h
index b9b1a51da1..e8631dcac8 100644
--- a/protocols/Skype/src/skypekit/conversation.h
+++ b/protocols/Skype/src/skypekit/conversation.h
@@ -11,11 +11,4 @@ public:
typedef DRefs<CConversation, Conversation> Refs;
CConversation(unsigned int oid, SERootObject* root);
-
- void SetOnConvoChangedCallback(OnConvoChanged callback);
-
-private:
- OnConvoChanged callback;
-
- void OnChange(int prop);
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/group.cpp b/protocols/Skype/src/skypekit/group.cpp
index f547563bcf..3e708280ca 100644
--- a/protocols/Skype/src/skypekit/group.cpp
+++ b/protocols/Skype/src/skypekit/group.cpp
@@ -1,19 +1,13 @@
+#include "..\skype.h"
#include "group.h"
-CContactGroup::CContactGroup(unsigned int oid, SERootObject* root) : ContactGroup(oid, root)
+CContactGroup::CContactGroup(CSkypeProto* _ppro, unsigned int oid, SERootObject* root) :
+ ContactGroup(oid, root),
+ proto(_ppro)
{
- this->proto = NULL;
- this->callback == NULL;
-}
-
-void CContactGroup::SetOnContactListChangedCallback(OnContactListChanged callback, CSkypeProto* proto)
-{
- this->proto = proto;
- this->callback = callback;
}
void CContactGroup::OnChange(const ContactRef &contact)
{
- if (this->proto)
- (proto->*callback)(contact);
+ proto->OnContactListChanged(contact);
} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/group.h b/protocols/Skype/src/skypekit/group.h
index ff395594a5..92412fb59b 100644
--- a/protocols/Skype/src/skypekit/group.h
+++ b/protocols/Skype/src/skypekit/group.h
@@ -10,13 +10,10 @@ public:
typedef DRef<CContactGroup, ContactGroup> Ref;
typedef DRefs<CContactGroup, ContactGroup> Refs;
- CContactGroup(unsigned int oid, SERootObject* root);
-
- void SetOnContactListChangedCallback(OnContactListChanged callback, CSkypeProto* proto);
+ CContactGroup(CSkypeProto*, unsigned int oid, SERootObject* root);
private:
CSkypeProto* proto;
- OnContactListChanged callback;
void OnChange(const ContactRef &contact);
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/message.cpp b/protocols/Skype/src/skypekit/message.cpp
index ce96de0c01..82011d8c0d 100644
--- a/protocols/Skype/src/skypekit/message.cpp
+++ b/protocols/Skype/src/skypekit/message.cpp
@@ -1,3 +1,4 @@
+#include "..\skype.h"
#include "message.h"
CMessage::CMessage(unsigned int oid, SERootObject* root) : Message(oid, root) { }
diff --git a/protocols/Skype/src/skypekit/participant.cpp b/protocols/Skype/src/skypekit/participant.cpp
index 9b35cfabb2..34832d084d 100644
--- a/protocols/Skype/src/skypekit/participant.cpp
+++ b/protocols/Skype/src/skypekit/participant.cpp
@@ -1,3 +1,4 @@
+#include "..\skype.h"
#include "participant.h"
CParticipant::CParticipant(unsigned int oid, SERootObject* root) : Participant(oid, root)
diff --git a/protocols/Skype/src/skypekit/search.cpp b/protocols/Skype/src/skypekit/search.cpp
index 362e412c86..f6f035a3a1 100644
--- a/protocols/Skype/src/skypekit/search.cpp
+++ b/protocols/Skype/src/skypekit/search.cpp
@@ -1,10 +1,9 @@
+#include "..\skype.h"
#include "search.h"
CContactSearch::CContactSearch(unsigned int oid, SERootObject* root) : ContactSearch(oid, root)
{
this->proto = NULL;
- this->SearchCompletedCallback == NULL;
- this->ContactFindedCallback == NULL;
}
void CContactSearch::OnChange(int prop)
@@ -17,7 +16,7 @@ void CContactSearch::OnChange(int prop)
{
this->isSeachFinished = true;
if (this->proto)
- (proto->*SearchCompletedCallback)(this->hSearch);
+ proto->OnSearchCompleted(this->hSearch);
}
}
}
@@ -25,7 +24,7 @@ void CContactSearch::OnChange(int prop)
void CContactSearch::OnNewResult(const ContactRef &contact, const uint &rankValue)
{
if (this->proto)
- (proto->*ContactFindedCallback)(contact, this->hSearch);
+ proto->OnContactFinded(contact, this->hSearch);
}
void CContactSearch::BlockWhileSearch()
@@ -41,13 +40,3 @@ void CContactSearch::SetProtoInfo(CSkypeProto* proto, HANDLE hSearch)
this->proto = proto;
this->hSearch = hSearch;
}
-
-void CContactSearch::SetOnSearchCompleatedCallback(OnSearchCompleted callback)
-{
- this->SearchCompletedCallback = callback;
-}
-
-void CContactSearch::SetOnContactFindedCallback(OnContactFinded callback)
-{
- this->ContactFindedCallback = callback;
-} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/search.h b/protocols/Skype/src/skypekit/search.h
index 60b920130d..fa5819ccee 100644
--- a/protocols/Skype/src/skypekit/search.h
+++ b/protocols/Skype/src/skypekit/search.h
@@ -6,9 +6,6 @@
class CContactSearch : public ContactSearch
{
public:
- typedef void (CSkypeProto::* OnSearchCompleted)(HANDLE hSearch);
- typedef void (CSkypeProto::* OnContactFinded)(CContact::Ref contact, HANDLE hSearch);
-
typedef DRef<CContactSearch, ContactSearch> Ref;
typedef DRefs<CContactSearch, ContactSearch> Refs;
@@ -21,13 +18,10 @@ public:
void OnNewResult(const ContactRef &contact, const uint &rankValue);
void SetProtoInfo(CSkypeProto* proto, HANDLE hSearch);
- void SetOnSearchCompleatedCallback(OnSearchCompleted callback);
- void SetOnContactFindedCallback(OnContactFinded callback);
void BlockWhileSearch();
+
private:
HANDLE hSearch;
CSkypeProto* proto;
- OnSearchCompleted SearchCompletedCallback;
- OnContactFinded ContactFindedCallback;
}; \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/transfer.cpp b/protocols/Skype/src/skypekit/transfer.cpp
index 986a5bcbab..68eb985fd0 100644
--- a/protocols/Skype/src/skypekit/transfer.cpp
+++ b/protocols/Skype/src/skypekit/transfer.cpp
@@ -1,19 +1,13 @@
+#include "..\skype.h"
#include "transfer.h"
-CTransfer::CTransfer(unsigned int oid, SERootObject* root) : Transfer(oid, root)
+CTransfer::CTransfer(CSkypeProto* _ppro, unsigned int oid, SERootObject* root) :
+ Transfer(oid, root),
+ proto(_ppro)
{
- this->proto = NULL;
- this->transferCallback = NULL;
-}
-
-void CTransfer::SetOnTransferCallback(OnTransfer callback, CSkypeProto* proto)
-{
- this->proto = proto;
- this->transferCallback = callback;
}
void CTransfer::OnChange(int prop)
{
- if (this->proto)
- (proto->*transferCallback)(this->ref(), prop);
+ proto->OnTransferChanged(this->ref(), prop);
} \ No newline at end of file
diff --git a/protocols/Skype/src/skypekit/transfer.h b/protocols/Skype/src/skypekit/transfer.h
index d327c496b0..a9dbf709b6 100644
--- a/protocols/Skype/src/skypekit/transfer.h
+++ b/protocols/Skype/src/skypekit/transfer.h
@@ -5,18 +5,13 @@
class CTransfer : public Transfer
{
public:
- typedef void (CSkypeProto::* OnTransfer)(CTransfer::Ref transfer, int);
-
typedef DRef<CTransfer, Transfer> Ref;
typedef DRefs<CTransfer, Transfer> Refs;
- CTransfer(unsigned int oid, SERootObject* p_root);
-
- void SetOnTransferCallback(OnTransfer callback, CSkypeProto* proto);
+ CTransfer(CSkypeProto*, unsigned int oid, SERootObject* p_root);
private:
CSkypeProto* proto;
- OnTransfer transferCallback;
void OnChange(int prop);
}; \ No newline at end of file