initial
This commit is contained in:
commit
de36fe2a4e
15 changed files with 421 additions and 0 deletions
24
core/CMakeLists.txt
Normal file
24
core/CMakeLists.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(squawkCORE)
|
||||
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
find_package(Qt5Widgets CONFIG REQUIRED)
|
||||
find_package(Qt5Network CONFIG REQUIRED)
|
||||
|
||||
set(squawkCORE_SRC
|
||||
squawk.cpp
|
||||
account.cpp
|
||||
)
|
||||
|
||||
# Tell CMake to create the helloworld executable
|
||||
add_library(squawkCORE ${squawkCORE_SRC})
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
target_link_libraries(squawkCORE Qt5::Core)
|
||||
target_link_libraries(squawkCORE Qt5::Network)
|
||||
target_link_libraries(squawkCORE qxmpp)
|
||||
|
||||
# Install the executable
|
||||
install(TARGETS squawkCORE DESTINATION lib)
|
17
core/account.cpp
Normal file
17
core/account.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "account.h"
|
||||
|
||||
using namespace Core;
|
||||
|
||||
Account::Account(const QString& p_jid, const QString& p_password, QObject* parent):
|
||||
QObject(parent),
|
||||
jid(p_jid),
|
||||
password(p_password),
|
||||
client()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Account::~Account()
|
||||
{
|
||||
|
||||
}
|
25
core/account.h
Normal file
25
core/account.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef CORE_ACCOUNT_H
|
||||
#define CORE_ACCOUNT_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#include <qxmpp/QXmppClient.h>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
|
||||
class Account : public QObject
|
||||
{
|
||||
public:
|
||||
Account(const QString& p_jid, const QString& p_password, QObject* parent = 0);
|
||||
~Account();
|
||||
|
||||
private:
|
||||
QString jid;
|
||||
QString password;
|
||||
QXmppClient client;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // CORE_ACCOUNT_H
|
15
core/squawk.cpp
Normal file
15
core/squawk.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "squawk.h"
|
||||
|
||||
using namespace Core;
|
||||
|
||||
Squawk::Squawk(QObject* parent):
|
||||
QObject(parent),
|
||||
accounts()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Squawk::~Squawk()
|
||||
{
|
||||
|
||||
}
|
27
core/squawk.h
Normal file
27
core/squawk.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef CORE_SQUAWK_H
|
||||
#define CORE_SQUAWK_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <deque>
|
||||
|
||||
#include "account.h"
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class Squawk : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Squawk(QObject* parent = 0);
|
||||
~Squawk();
|
||||
|
||||
private:
|
||||
typedef std::deque<Account> Accounts;
|
||||
|
||||
Accounts accounts;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // CORE_SQUAWK_H
|
Loading…
Add table
Add a link
Reference in a new issue