Blame lang/cpp/src/trustitem.h

Packit Service 672cf4
/*
Packit Service 672cf4
  trustitem.h - wraps a gpgme trust item
Packit Service 672cf4
  Copyright (C) 2003 Klarälvdalens Datakonsult AB
Packit Service 672cf4
  2016 Bundesamt für Sicherheit in der Informationstechnik
Packit Service 672cf4
  Software engineering by Intevation GmbH
Packit Service 672cf4
Packit Service 672cf4
  This file is part of GPGME.
Packit Service 672cf4
Packit Service 672cf4
  GPGME++ is free software; you can redistribute it and/or
Packit Service 672cf4
  modify it under the terms of the GNU Library General Public
Packit Service 672cf4
  License as published by the Free Software Foundation; either
Packit Service 672cf4
  version 2 of the License, or (at your option) any later version.
Packit Service 672cf4
Packit Service 672cf4
  GPGME++ is distributed in the hope that it will be useful,
Packit Service 672cf4
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 672cf4
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 672cf4
  GNU Library General Public License for more details.
Packit Service 672cf4
Packit Service 672cf4
  You should have received a copy of the GNU Library General Public License
Packit Service 672cf4
  along with GPGME++; see the file COPYING.LIB.  If not, write to the
Packit Service 672cf4
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit Service 672cf4
  Boston, MA 02110-1301, USA.
Packit Service 672cf4
*/
Packit Service 672cf4
Packit Service 672cf4
// -*- c++ -*-
Packit Service 672cf4
#ifndef __GPGMEPP_TRUSTITEM_H__
Packit Service 672cf4
#define __GPGMEPP_TRUSTITEM_H__
Packit Service 672cf4
Packit Service 672cf4
#include "gpgmefw.h"
Packit Service 672cf4
#include <key.h>
Packit Service 672cf4
#include "gpgmepp_export.h"
Packit Service 672cf4
Packit Service 672cf4
#include <algorithm>
Packit Service 672cf4
Packit Service 672cf4
namespace GpgME
Packit Service 672cf4
{
Packit Service 672cf4
Packit Service 672cf4
class Context;
Packit Service 672cf4
Packit Service 672cf4
class GPGMEPP_EXPORT TrustItem
Packit Service 672cf4
{
Packit Service 672cf4
    friend class ::GpgME::Context;
Packit Service 672cf4
public:
Packit Service 6c01f9
    explicit TrustItem(gpgme_trust_item_t item = 0);
Packit Service 672cf4
    TrustItem(const TrustItem &other);
Packit Service 672cf4
    virtual ~TrustItem();
Packit Service 672cf4
Packit Service 672cf4
    const TrustItem &operator=(TrustItem other)
Packit Service 672cf4
    {
Packit Service 672cf4
        swap(other);
Packit Service 672cf4
        return *this;
Packit Service 672cf4
    }
Packit Service 672cf4
Packit Service 672cf4
    void swap(TrustItem &other)
Packit Service 672cf4
    {
Packit Service 672cf4
        using std::swap;
Packit Service 672cf4
        swap(this->d, other.d);
Packit Service 672cf4
    }
Packit Service 672cf4
Packit Service 672cf4
    bool isNull() const;
Packit Service 672cf4
Packit Service 672cf4
    const char *keyID() const;
Packit Service 672cf4
    const char *userID() const;
Packit Service 672cf4
Packit Service 672cf4
    const char *ownerTrustAsString() const;
Packit Service 672cf4
    const char *validityAsString() const;
Packit Service 672cf4
Packit Service 672cf4
    int trustLevel() const;
Packit Service 672cf4
Packit Service 672cf4
    enum Type { Unknown = 0, Key = 1, UserID = 2 };
Packit Service 672cf4
    Type type() const;
Packit Service 672cf4
Packit Service 672cf4
private:
Packit Service 672cf4
    gpgme_trust_item_t impl() const;
Packit Service 672cf4
    class Private;
Packit Service 672cf4
    Private *d;
Packit Service 672cf4
};
Packit Service 672cf4
Packit Service 672cf4
} // namepace GpgME
Packit Service 672cf4
Packit Service 672cf4
GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION(TrustItem)
Packit Service 672cf4
Packit Service 672cf4
#endif // __GPGMEPP_TRUSTITEM_H__