You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
3.4 KiB
126 lines
3.4 KiB
3 years ago
|
/*
|
||
3 years ago
|
* This file is part of the PolKit-tqt project
|
||
3 years ago
|
* Copyright (C) 2009 Radek Novacek <rnovacek@redhat.com>
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2 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
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
3 years ago
|
#ifndef POLKIT_TQT_TEMPORARY_AUTHORIZATION_H
|
||
|
#define POLKIT_TQT_TEMPORARY_AUTHORIZATION_H
|
||
3 years ago
|
|
||
3 years ago
|
#include "polkit-tqt-export.h"
|
||
|
#include "polkit-tqt-subject.h"
|
||
3 years ago
|
|
||
|
typedef struct _PolkitTemporaryAuthorization PolkitTemporaryAuthorization;
|
||
|
|
||
3 years ago
|
class TQDateTime;
|
||
|
class TQString;
|
||
|
template<typename> class TQValueList;
|
||
|
|
||
|
|
||
3 years ago
|
/**
|
||
3 years ago
|
* \namespace PolkitTQt PolkitTQt
|
||
3 years ago
|
*
|
||
3 years ago
|
* \brief Namespace wrapping PolicyKit-TQt classes
|
||
3 years ago
|
*
|
||
3 years ago
|
* This namespace wraps all PolicyKit-TQt classes.
|
||
3 years ago
|
*/
|
||
3 years ago
|
namespace PolkitTQt
|
||
3 years ago
|
{
|
||
|
|
||
|
/**
|
||
3 years ago
|
* \class TemporaryAuthorization polkit-tqt-temporaryauthorization.h TemporaryAuthorization
|
||
3 years ago
|
* \author Radek Novacek <rnovacek@redhat.com>
|
||
|
*
|
||
|
* \brief This class represents PolicyKit temporary authorization
|
||
|
*
|
||
|
* This class encapsulates the PolkitTemporaryAuthorization interface.
|
||
|
*/
|
||
3 years ago
|
class POLKIT_TQT_EXPORT TemporaryAuthorization
|
||
3 years ago
|
{
|
||
3 years ago
|
public:
|
||
|
typedef TQValueList<TemporaryAuthorization> List;
|
||
|
|
||
3 years ago
|
TemporaryAuthorization();
|
||
3 years ago
|
TemporaryAuthorization(const TemporaryAuthorization &other);
|
||
|
~TemporaryAuthorization();
|
||
|
|
||
3 years ago
|
/**
|
||
|
* Creates TemporaryAuthorization object from PolkitTemporaryAuthorization
|
||
|
*
|
||
|
* \warning It shouldn't be used directly unless you are completely aware of what are you doing
|
||
|
*
|
||
|
* \param pkTemporaryAuthorization PolkitTemporaryAuthorization object
|
||
|
*/
|
||
3 years ago
|
TemporaryAuthorization(PolkitTemporaryAuthorization *pkTemporaryAuthorization);
|
||
3 years ago
|
|
||
3 years ago
|
TemporaryAuthorization& operator=(const TemporaryAuthorization &other);
|
||
3 years ago
|
|
||
|
/**
|
||
|
* \brief Gets the identifier for the authorization.
|
||
|
*
|
||
|
* This identifier can be user by the revokeTemporaryAuthorization function
|
||
|
*
|
||
|
* \return Unique identifier for the authorization
|
||
|
*/
|
||
3 years ago
|
TQString id() const;
|
||
3 years ago
|
|
||
|
/**
|
||
|
* \brief Gets the identifier of the action that authorization is for
|
||
|
*
|
||
|
* \return String that identifies the action
|
||
|
*/
|
||
3 years ago
|
TQString actionId() const;
|
||
3 years ago
|
|
||
|
/**
|
||
|
* \brief Gets the subject that authorization is for
|
||
|
*
|
||
|
* \return A Subject.
|
||
|
*/
|
||
|
Subject subject() const;
|
||
|
|
||
|
/**
|
||
|
* \brief Gets the time when authorization was obtained
|
||
|
*
|
||
|
* \return Time of obtaining the authorization
|
||
|
*/
|
||
3 years ago
|
TQDateTime obtainedAt() const;
|
||
3 years ago
|
|
||
|
/**
|
||
|
* \brief Gets the time when authorizaton will expire
|
||
|
*
|
||
|
* \return Time of expiration
|
||
|
*/
|
||
3 years ago
|
TQDateTime expirationTime() const;
|
||
3 years ago
|
|
||
|
/**
|
||
|
* \brief Revoke temporary authorization
|
||
|
*
|
||
|
* \return \c true Authorization has been revoked
|
||
|
* \c false Revoking authorization failed
|
||
|
*/
|
||
|
bool revoke();
|
||
|
|
||
3 years ago
|
private:
|
||
3 years ago
|
class Data;
|
||
3 years ago
|
Data *d;
|
||
3 years ago
|
};
|
||
3 years ago
|
|
||
3 years ago
|
}
|
||
|
|
||
3 years ago
|
#endif
|
||
3 years ago
|
|