summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/tests/mock
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/libkopete/tests/mock')
-rw-r--r--kopete/libkopete/tests/mock/Makefile.am14
-rw-r--r--kopete/libkopete/tests/mock/kopeteaccount_mock.cpp61
-rw-r--r--kopete/libkopete/tests/mock/kopeteaccount_mock.h54
-rw-r--r--kopete/libkopete/tests/mock/kopetecontact_mock.cpp44
-rw-r--r--kopete/libkopete/tests/mock/kopetecontact_mock.h49
-rw-r--r--kopete/libkopete/tests/mock/kopetemessage_mock.cpp20
-rw-r--r--kopete/libkopete/tests/mock/kopetemessage_mock.h39
-rw-r--r--kopete/libkopete/tests/mock/kopetemetacontact_mock.cpp20
-rw-r--r--kopete/libkopete/tests/mock/kopetemetacontact_mock.h41
-rw-r--r--kopete/libkopete/tests/mock/kopeteprotocol_mock.cpp49
-rw-r--r--kopete/libkopete/tests/mock/kopeteprotocol_mock.h53
11 files changed, 444 insertions, 0 deletions
diff --git a/kopete/libkopete/tests/mock/Makefile.am b/kopete/libkopete/tests/mock/Makefile.am
new file mode 100644
index 00000000..b132a2a5
--- /dev/null
+++ b/kopete/libkopete/tests/mock/Makefile.am
@@ -0,0 +1,14 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT -DQT_NO_CAST_ASCII -DQT_NO_ASCII_CAST \
+ $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private $(all_includes)
+
+noinst_LTLIBRARIES = libkopete_mock.la
+
+libkopete_mock_la_SOURCES = kopetemessage_mock.cpp kopeteaccount_mock.cpp kopetecontact_mock.cpp kopetemetacontact_mock.cpp kopeteprotocol_mock.cpp
+
+libkopete_mock_la_LDFLAGS = $(all_libraries) -lkabc
+libkopete_mock_la_LIBADD = ../../libkopete.la ../../private/libkopeteprivate.la $(LIB_KHTML)
+
+noinst_HEADERS = kopetemessage_mock.h kopetecontact_mock.h kopetemetacontact_mock.h kopeteaccount_mock.h kopeteprotocol_mock.h
+
+
diff --git a/kopete/libkopete/tests/mock/kopeteaccount_mock.cpp b/kopete/libkopete/tests/mock/kopeteaccount_mock.cpp
new file mode 100644
index 00000000..8a8425bc
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopeteaccount_mock.cpp
@@ -0,0 +1,61 @@
+/*
+ Account mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopeteaccount_mock.h"
+#include "kopetemetacontact.h"
+#include "kopeteaccount_mock.h"
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+Account::Account(Kopete::Protocol *parent, const QString &accountID, const char *name) : Kopete::Account(parent, accountID, name)
+{
+
+}
+
+Account::~Account()
+{
+
+}
+
+bool Account::createContact( const QString &contactId, Kopete::MetaContact *parentContact )
+{
+ return true;
+}
+
+void Account::connect( const Kopete::OnlineStatus& initialStatus)
+{
+ // do nothing
+}
+
+void Account::disconnect()
+{
+ // do nothing
+}
+
+void Account::setOnlineStatus( const Kopete::OnlineStatus& status , const QString &reason)
+{
+ // do nothing
+}
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete
diff --git a/kopete/libkopete/tests/mock/kopeteaccount_mock.h b/kopete/libkopete/tests/mock/kopeteaccount_mock.h
new file mode 100644
index 00000000..55ba15cc
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopeteaccount_mock.h
@@ -0,0 +1,54 @@
+/*
+ Account mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef _KOPETEACCOUNT_MOCK_H_
+#define _KOPETEACCOUNT_MOCK_H_
+
+#include "kopeteaccount.h"
+
+class Kopete::Protocol;
+class Kopete::OnlineStatus;
+class Kopete::MetaContact;
+
+class QString;
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+class Account : public Kopete::Account
+{
+public:
+ Account(Kopete::Protocol *parent, const QString &accountID, const char *name=0L);
+ ~Account();
+ // pure virtual functions implementation
+ virtual bool createContact( const QString &contactId, MetaContact *parentContact );
+ virtual void connect( const Kopete::OnlineStatus& initialStatus = OnlineStatus() );
+ virtual void disconnect();
+ virtual void setOnlineStatus( const Kopete::OnlineStatus& status , const QString &reason = QString::null );
+};
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete
+
+
+#endif
+
diff --git a/kopete/libkopete/tests/mock/kopetecontact_mock.cpp b/kopete/libkopete/tests/mock/kopetecontact_mock.cpp
new file mode 100644
index 00000000..19cfa7b0
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopetecontact_mock.cpp
@@ -0,0 +1,44 @@
+/*
+ Contact mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopetecontact_mock.h"
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+Contact::Contact( Kopete::Account *account, const QString &id, Kopete::MetaContact *parent, const QString &icon) : Kopete::Contact( account, id, parent, icon)
+{
+
+}
+
+Contact::~Contact()
+{
+
+}
+
+Kopete::ChatSession* Contact::manager( CanCreateFlags canCreate)
+{
+ return 0L;
+}
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete \ No newline at end of file
diff --git a/kopete/libkopete/tests/mock/kopetecontact_mock.h b/kopete/libkopete/tests/mock/kopetecontact_mock.h
new file mode 100644
index 00000000..e445a571
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopetecontact_mock.h
@@ -0,0 +1,49 @@
+/*
+ Contact mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef _KOPETECONTACT_MOCK_H_
+#define _KOPETECONTACT_MOCK_H_
+
+#include "kopetecontact.h"
+
+class Kopete::MetaContact;
+class Kopete::Account;
+class Kopete::ChatSession;
+class QString;
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+class Contact : public Kopete::Contact
+{
+public:
+ Contact( Kopete::Account *account, const QString &id, Kopete::MetaContact *parent, const QString &icon = QString::null );
+ ~Contact();
+ virtual Kopete::ChatSession* manager( CanCreateFlags canCreate = CannotCreate );
+};
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete
+
+
+#endif
+
diff --git a/kopete/libkopete/tests/mock/kopetemessage_mock.cpp b/kopete/libkopete/tests/mock/kopetemessage_mock.cpp
new file mode 100644
index 00000000..a3e543e3
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopetemessage_mock.cpp
@@ -0,0 +1,20 @@
+/*
+ Message mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopetemessage_mock.h"
+
+
diff --git a/kopete/libkopete/tests/mock/kopetemessage_mock.h b/kopete/libkopete/tests/mock/kopetemessage_mock.h
new file mode 100644
index 00000000..13c92574
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopetemessage_mock.h
@@ -0,0 +1,39 @@
+/*
+ Message mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef _KOPETEMESSAGE_MOCK_H_
+#define _KOPETEMESSAGE_MOCK_H_
+
+#include "kopetemessage.h"
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+class Message : public Kopete::Message
+{
+
+};
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete
+
+#endif \ No newline at end of file
diff --git a/kopete/libkopete/tests/mock/kopetemetacontact_mock.cpp b/kopete/libkopete/tests/mock/kopetemetacontact_mock.cpp
new file mode 100644
index 00000000..32f0fe1c
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopetemetacontact_mock.cpp
@@ -0,0 +1,20 @@
+/*
+ MetaContact Mock Object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopetemetacontact_mock.h"
+
+
diff --git a/kopete/libkopete/tests/mock/kopetemetacontact_mock.h b/kopete/libkopete/tests/mock/kopetemetacontact_mock.h
new file mode 100644
index 00000000..f3311713
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopetemetacontact_mock.h
@@ -0,0 +1,41 @@
+/*
+ MetaContact Mock Object
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef _KOPETEMETACONTACT_MOCK_H_
+#define _KOPETEMETACONTACT_MOCK_H_
+
+#include "kopetemetacontact.h"
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+class MetaContact : public Kopete::MetaContact
+{
+
+};
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete
+
+
+#endif
+
diff --git a/kopete/libkopete/tests/mock/kopeteprotocol_mock.cpp b/kopete/libkopete/tests/mock/kopeteprotocol_mock.cpp
new file mode 100644
index 00000000..d3bbd0e2
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopeteprotocol_mock.cpp
@@ -0,0 +1,49 @@
+/*
+ Protocol mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopeteprotocol_mock.h"
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+Protocol::Protocol( KInstance *instance, QObject *parent, const char *name ) : Kopete::Protocol(instance, parent, name)
+{
+
+}
+
+Account* Protocol::createNewAccount( const QString &accountId )
+{
+ return 0L;
+}
+
+AddContactPage* Protocol::createAddContactWidget( QWidget *parent, Kopete::Account *account )
+{
+ return 0L;
+}
+
+KopeteEditAccountWidget* Protocol::createEditAccountWidget( Kopete::Account *account, QWidget *parent )
+{
+ return 0L;
+}
+
+} // end ns mock
+} // end ns test
+} // end ns kopete
diff --git a/kopete/libkopete/tests/mock/kopeteprotocol_mock.h b/kopete/libkopete/tests/mock/kopeteprotocol_mock.h
new file mode 100644
index 00000000..189f7d79
--- /dev/null
+++ b/kopete/libkopete/tests/mock/kopeteprotocol_mock.h
@@ -0,0 +1,53 @@
+/*
+ Protocol mock object class
+
+ Copyright (c) 2005 by Duncan Mac-Vicar Prett <duncan@kde.org>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef _KOPETEPROTOCOL_MOCK_H_
+#define _KOPETEPROTOCOL_MOCK_H_
+
+#include "kopeteprotocol.h"
+
+class KInstance;
+class QObject;
+
+class KopeteEditAccountWidget;
+class AddContactPage;
+class KopeteEditAccountWidget;
+
+namespace Kopete
+{
+namespace Test
+{
+namespace Mock
+{
+
+class Protocol : public Kopete::Protocol
+{
+public:
+ Protocol( KInstance *instance, QObject *parent, const char *name );
+ // pure virtual functions implemented
+ virtual Account *createNewAccount( const QString &accountId );
+ virtual AddContactPage *createAddContactWidget( QWidget *parent, Kopete::Account *account );
+ virtual KopeteEditAccountWidget * createEditAccountWidget( Kopete::Account *account, QWidget *parent );
+};
+
+} // end ns Kopete::Test::Mock
+} // end ns Kopete::Test
+} // end ns Kopete
+
+
+#endif
+