Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit dff2413c authored by Boudewijn Rempt's avatar Boudewijn Rempt

Also add kis_resource, ready for renaming. Patrick has given me a blanket

license to relicense his code to lgpl whenever necessary, btw.

svn path=/trunk/koffice/; revision=659194
parent 8298b309
/*
Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.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) any later version.
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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "kis_resource.h"
#include "kis_global.h"
KisResource::KisResource(const QString& filename)
{
m_filename = filename;
m_valid = false;
}
KisResource::~KisResource()
{
}
QString KisResource::filename() const
{
return m_filename;
}
void KisResource::setFilename(const QString& filename)
{
m_filename = filename;
}
QString KisResource::name() const
{
return m_name;
}
void KisResource::setName(const QString& name)
{
m_name = name;
}
bool KisResource::valid() const
{
return m_valid;
}
void KisResource::setValid(bool valid)
{
m_valid = valid;
}
#include "kis_resource.moc"
/*
Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.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) any later version.
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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KIS_RESOURCE_H_
#define KIS_RESOURCE_H_
#include <QImage>
#include <QObject>
#include <QString>
#include <krita_export.h>
/**
* The KisResource class provides a representation of Krita image resources. This
* includes, but not limited to, brushes and patterns.
*
* This replaces the KisKrayon facility that used to be present in Krayon.
*/
class KRITAIMAGE_EXPORT KisResource : public QObject {
typedef QObject super;
Q_OBJECT
public:
/**
* Creates a new KisResource object using @p filename. No file is opened
* in the constructor, you have to call load.
*
* @param filename the file name to save and load from.
*/
KisResource(const QString& filename);
virtual ~KisResource();
public:
/**
* Load this resource.
*/
virtual bool load() = 0;
/**
* Save this resource asynchronously. The signal saveComplete is emitted when
* the resource has been saved.
*/
virtual bool save() = 0;
/**
* Returns a QImage representing this resource. This image could be null.
*/
virtual QImage img() = 0;
public:
QString filename() const;
void setFilename(const QString& filename);
QString name() const;
void setName(const QString& name);
bool valid() const;
void setValid(bool valid);
private:
KisResource(const KisResource&);
KisResource& operator=(const KisResource&);
private:
QString m_name;
QString m_filename;
bool m_valid;
};
#endif // KIS_RESOURCE_H_
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