summaryrefslogtreecommitdiffstats
path: root/core/polkit-tqt-temporaryauthorization.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2021-11-10 10:02:01 +0900
committerMichele Calgaro <[email protected]>2021-11-10 10:02:01 +0900
commit4606c91f4c62ae540df8edca973c2c5e405227d7 (patch)
tree6496977cbd591c7b530fc49ccdf115cd9673137c /core/polkit-tqt-temporaryauthorization.h
parenteb2210c94488f6c57159fede9a98891e4f3a1a52 (diff)
downloadpolkit-tqt-4606c91f4c62ae540df8edca973c2c5e405227d7.tar.gz
polkit-tqt-4606c91f4c62ae540df8edca973c2c5e405227d7.zip
Completed conversion of 'core' library module.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'core/polkit-tqt-temporaryauthorization.h')
-rw-r--r--core/polkit-tqt-temporaryauthorization.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/core/polkit-tqt-temporaryauthorization.h b/core/polkit-tqt-temporaryauthorization.h
new file mode 100644
index 000000000..505396500
--- /dev/null
+++ b/core/polkit-tqt-temporaryauthorization.h
@@ -0,0 +1,125 @@
+/*
+ * This file is part of the PolKit-tqt project
+ * Copyright (C) 2009 Radek Novacek <[email protected]>
+ *
+ * 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.
+ */
+
+#ifndef POLKIT_TQT_TEMPORARY_AUTHORIZATION_H
+#define POLKIT_TQT_TEMPORARY_AUTHORIZATION_H
+
+#include "polkit-tqt-export.h"
+#include "polkit-tqt-subject.h"
+
+typedef struct _PolkitTemporaryAuthorization PolkitTemporaryAuthorization;
+
+class TQDateTime;
+class TQString;
+template<typename> class TQValueList;
+
+
+/**
+ * \namespace PolkitTQt PolkitTQt
+ *
+ * \brief Namespace wrapping PolicyKit-TQt classes
+ *
+ * This namespace wraps all PolicyKit-TQt classes.
+ */
+namespace PolkitTQt
+{
+
+/**
+ * \class TemporaryAuthorization polkit-tqt-temporaryauthorization.h TemporaryAuthorization
+ * \author Radek Novacek <[email protected]>
+ *
+ * \brief This class represents PolicyKit temporary authorization
+ *
+ * This class encapsulates the PolkitTemporaryAuthorization interface.
+ */
+class POLKIT_TQT_EXPORT TemporaryAuthorization
+{
+ public:
+ typedef TQValueList<TemporaryAuthorization> List;
+
+ TemporaryAuthorization();
+ TemporaryAuthorization(const TemporaryAuthorization &other);
+ ~TemporaryAuthorization();
+
+ /**
+ * 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
+ */
+ TemporaryAuthorization(PolkitTemporaryAuthorization *pkTemporaryAuthorization);
+
+ TemporaryAuthorization& operator=(const TemporaryAuthorization &other);
+
+ /**
+ * \brief Gets the identifier for the authorization.
+ *
+ * This identifier can be user by the revokeTemporaryAuthorization function
+ *
+ * \return Unique identifier for the authorization
+ */
+ TQString id() const;
+
+ /**
+ * \brief Gets the identifier of the action that authorization is for
+ *
+ * \return String that identifies the action
+ */
+ TQString actionId() const;
+
+ /**
+ * \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
+ */
+ TQDateTime obtainedAt() const;
+
+ /**
+ * \brief Gets the time when authorizaton will expire
+ *
+ * \return Time of expiration
+ */
+ TQDateTime expirationTime() const;
+
+ /**
+ * \brief Revoke temporary authorization
+ *
+ * \return \c true Authorization has been revoked
+ * \c false Revoking authorization failed
+ */
+ bool revoke();
+
+ private:
+ class Data;
+ Data *d;
+};
+
+}
+
+#endif
+