2012-04-14 15:38:20 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
|
|
|
*
|
|
|
|
* 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 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KEEPASSX_ENTRYATTACHMENTS_H
|
|
|
|
#define KEEPASSX_ENTRYATTACHMENTS_H
|
|
|
|
|
2013-10-03 15:18:16 +02:00
|
|
|
#include <QMap>
|
|
|
|
#include <QObject>
|
2012-04-14 15:38:20 +02:00
|
|
|
|
2017-10-22 21:15:25 +03:00
|
|
|
class QStringList;
|
|
|
|
|
2012-04-14 15:38:20 +02:00
|
|
|
class EntryAttachments : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-07-24 18:28:12 +02:00
|
|
|
explicit EntryAttachments(QObject* parent = nullptr);
|
2012-04-14 15:38:20 +02:00
|
|
|
QList<QString> keys() const;
|
2014-12-03 23:36:24 +01:00
|
|
|
bool hasKey(const QString& key) const;
|
2012-07-20 00:45:34 +02:00
|
|
|
QList<QByteArray> values() const;
|
2012-04-14 15:38:20 +02:00
|
|
|
QByteArray value(const QString& key) const;
|
2012-04-21 16:45:46 +02:00
|
|
|
void set(const QString& key, const QByteArray& value);
|
2012-04-14 15:38:20 +02:00
|
|
|
void remove(const QString& key);
|
2017-10-22 21:15:25 +03:00
|
|
|
void remove(const QStringList& keys);
|
2012-04-14 15:38:20 +02:00
|
|
|
void clear();
|
2012-07-20 12:13:26 +02:00
|
|
|
void copyDataFrom(const EntryAttachments* other);
|
2012-04-23 21:06:04 +02:00
|
|
|
bool operator==(const EntryAttachments& other) const;
|
2012-04-14 15:38:20 +02:00
|
|
|
bool operator!=(const EntryAttachments& other) const;
|
|
|
|
|
2017-03-10 15:58:42 +01:00
|
|
|
signals:
|
2012-04-14 15:38:20 +02:00
|
|
|
void modified();
|
2012-04-28 21:42:23 +02:00
|
|
|
void keyModified(const QString& key);
|
|
|
|
void aboutToBeAdded(const QString& key);
|
|
|
|
void added(const QString& key);
|
|
|
|
void aboutToBeRemoved(const QString& key);
|
|
|
|
void removed(const QString& key);
|
2012-04-14 15:38:20 +02:00
|
|
|
void aboutToBeReset();
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QMap<QString, QByteArray> m_attachments;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_ENTRYATTACHMENTS_H
|