diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-11-16 00:33:12 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-11-16 00:33:12 +0900 |
commit | a8e9f8dd80bddc39a64cd807880b5630fb9efec7 (patch) | |
tree | 866a00fc55bdfada1dd3d46c61feb1440d960526 /agent/polkitqt1-agent-session.h | |
parent | 98b37ff3b1d307add5fe3f9e1f9c7923831debd4 (diff) | |
download | polkit-tqt-a8e9f8dd80bddc39a64cd807880b5630fb9efec7.tar.gz polkit-tqt-a8e9f8dd80bddc39a64cd807880b5630fb9efec7.zip |
Conversion of 'agent' library module.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'agent/polkitqt1-agent-session.h')
-rw-r--r-- | agent/polkitqt1-agent-session.h | 180 |
1 files changed, 0 insertions, 180 deletions
diff --git a/agent/polkitqt1-agent-session.h b/agent/polkitqt1-agent-session.h deleted file mode 100644 index c4a5ac531..000000000 --- a/agent/polkitqt1-agent-session.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * This file is part of the PolKit1-tqt project - * 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. - */ - -#ifndef POLKIT_TQT_AGENT_SESSION_H -#define POLKIT_TQT_AGENT_SESSION_H - -#include <TQtCore/TQObject> -#include "polkittqt1-identity.h" - -typedef struct _GSimpleAsyncResult GSimpleAsyncResult; -typedef struct _PolkitAgentSession PolkitAgentSession; - -namespace PolkitTQt -{ - -/** - * \namespace Agent Agent - * - * \brief Namespace wrapping Polkit-TQt Agent classes - * - * This namespace wraps all Polkit-TQt Agent classes. - */ - -namespace Agent -{ - -/** - * \internal - * \brief Encapsulation of GSimpleAsyncResult to TQObject class - */ -class POLKIT_TQT_EXPORT AsyncResult -{ -public: - explicit AsyncResult(GSimpleAsyncResult *result); - virtual ~AsyncResult(); - - /** - * \brief Mark the action that is tied to this result as completed. - */ - void setCompleted(); - - /** - * \brief Sets an error for the asynchronous result. - * Method complete() must be called anyway. - * - * \param text text of the error message - */ - void setError(const TQString &text); - -private: - class Private; - Private * const d; -}; - -/** - * \class Session polkittqt1-agent-session.h Session - * \author Radek Novacek <rnovacek@redhat.com> - * - * This class is interface for interacting with native - * authentication system for obtaining authorizations. - * - */ -class POLKIT_TQT_EXPORT Session : public TQObject -{ - Q_OBJECT - TQ_DISABLE_COPY(Session) -public: - /** - * Create a new authentication session. - * - * \param identity The identity to authenticate - * \param cookie The cookie obtained from the PolicyKit daemon - * \param result Result of the authentication action. Must be finished using complete() method. - * \param parent - */ - Session(const PolkitTQt::Identity& identity, const TQString &cookie, AsyncResult *result = 0, TQObject *parent = 0); - - /** - * Create a new authentication session from PolkitAgentSession object - * - * \warning Use this only if you are completely aware of what are you doing! - * - * \param pkAgentSession PolkitAgentSession object - * \param parent - */ - explicit Session(PolkitAgentSession *pkAgentSession, TQObject *parent = 0); - - /** - * Destroy authentication session. - */ - ~Session(); - - /** - * Initiate the authentication session. - * - * Use cancel() to cancel the session. - */ - void initiate(); - - /** - * Method for providing response to requests received via request signal. - * - * \param response Response from the user, typically a password - */ - void setResponse(const TQString &response); - - /** - * Cancel the authentication session. - * This will emit the completed() signal. - */ - void cancel(); - - /** - * Get AsyncResult that can be used to finish authentication operation - * - * \return AsyncResult object or NULL if it is not set - */ - AsyncResult *result(); - -Q_SIGNALS: - /** - * This signal will be emitted when the authentication - * polkittqt1-agent-session.has been completed or cancelled. - * - * \param gainedAuthorization \c True if authorization was successfully obtained. - */ - void completed(bool gainedAuthorization); - - /** - * This signal will be emitted when user is requested to answer a question. - * - * \param request The request to show the user, e.g. "name: " or "password: ". - * \param echo \c True if the response to the request SHOULD be echoed on the screen, - * \c False if the response MUST NOT be echoed to the screen. - */ - void request(const TQString &request, bool echo); - - /** - * This signal will be emitted when there is information - * related to an error condition to be displayed to the user. - * - * \param text An error string to display to the user. - */ - void showError(const TQString &text); - - /** - * This signal will be emitted when there is information - * to be displayed to the user. - * - * \param text A string to be displayed to the user. - */ - void showInfo(const TQString &text); - -private: - class Private; - Private * const d; -}; - -} - -} - -#endif // SESSION_H |