Commit b748f898 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Initial commit of learnerprofile library.

parent 1dfa3655
...@@ -45,6 +45,8 @@ add_subdirectory(sounds) ...@@ -45,6 +45,8 @@ add_subdirectory(sounds)
add_subdirectory(images) add_subdirectory(images)
add_subdirectory(icons) add_subdirectory(icons)
add_subdirectory(liblearnerprofile)
# Build Tests if KDE_TEST is on # Build Tests if KDE_TEST is on
if(KDE4_BUILD_TESTS) if(KDE4_BUILD_TESTS)
enable_testing() enable_testing()
......
###
# Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###
set( learnerprofile_LIB_SRCS
learner.cpp
)
kde4_add_library( learnerprofile SHARED ${learnerprofile_LIB_SRCS} )
target_link_libraries( learnerprofile
${KDE4_KDECORE_LIBS}
)
set_target_properties( learnerprofile
PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
)
install( TARGETS learnerprofile ${INSTALL_TARGETS_DEFAULT_ARGS} )
/*
* Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "learner_p.h"
#include "learner.h"
using namespace LearnerProfile;
Learner::Learner(QObject *parent)
: QObject(parent)
, d(new LearnerPrivate)
{
}
Learner::~Learner()
{
}
QString Learner::name() const
{
return d->name;
}
void Learner::setName(const QString &name)
{
if (name == d->name) {
return;
}
d->name = name;
emit nameChanged();
}
QString Learner::identifier() const
{
return d->identifier;
}
void Learner::setIdentifier(const QString& identifier)
{
if (identifier == d->identifier) {
return;
}
d->identifier = identifier;
emit identifierChanged();
}
/*
* Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LEARNER_H
#define LEARNER_H
#include "liblearnerprofile_export.h"
#include <QObject>
class LearnerPrivate;
namespace LearnerProfile
{
/**
* \class Learner
*/
class LIBLEARNERPROFILE_EXPORT Learner : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString id READ identifier WRITE setIdentifier NOTIFY identifierChanged)
public:
explicit Learner(QObject *parent = 0);
~Learner();
QString name() const;
void setName(const QString &name);
QString identifier() const;
void setIdentifier(const QString &identifier);
Q_SIGNALS:
void nameChanged();
void identifierChanged();
private:
Q_DISABLE_COPY(Learner)
const QScopedPointer<LearnerPrivate> d;
};
}
#endif // LEARNER_H
/*
* Copyright 2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3, or any
* later version accepted by the membership of KDE e.V. (or its
* successor approved by the membership of KDE e.V.), which shall
* act as a proxy defined in Section 6 of version 3 of the license.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QString>
namespace LearnerProfile
{
class LearnerPrivate {
public:
LearnerPrivate() {}
~LearnerPrivate() {}
QString name;
QString identifier;
};
}
#ifndef LIBLEARNERPROFILE_EXPORT_H
#define LIBLEARNERPROFILE_EXPORT_H
// needed for KDE_EXPORT and KDE_IMPORT macros
#include <kdemacros.h>
#ifndef LIBLEARNERPROFILE_EXPORT
# if defined(MAKE_LIBLEARNERPROFILE_LIB)
// We are building this library
# define LIBLEARNERPROFILE_EXPORT KDE_EXPORT
# else
// We are using this library
# define LIBLEARNERPROFILE_EXPORT KDE_IMPORT
# endif
#endif
# ifndef LIBLEARNERPROFILE_EXPORT_DEPRECATED
# define LIBLEARNERPROFILE_EXPORT_DEPRECATED KDE_DEPRECATED LIBLEARNERPROFILE_EXPORT
# endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment