133 lines
5.0 KiB
C++
133 lines
5.0 KiB
C++
/*
|
|
Copyright 2015-2016 Amebis
|
|
Copyright 2016 GÉANT
|
|
|
|
This file is part of GÉANTLink.
|
|
|
|
GÉANTLink 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 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
GÉANTLink 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 GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
namespace eap
|
|
{
|
|
///
|
|
/// EAP UI peer base abstract class template
|
|
///
|
|
/// A group of methods all EAP UI peers must or should implement.
|
|
///
|
|
template <class _Tmeth, class _Tcred, class _Tint, class _Tintres> class peer_ui;
|
|
}
|
|
|
|
#pragma once
|
|
|
|
#include "../../EAPBase/include/Module.h"
|
|
|
|
|
|
namespace eap
|
|
{
|
|
template <class _Tmeth, class _Tcred, class _Tint, class _Tintres>
|
|
class peer_ui : public module
|
|
{
|
|
public:
|
|
///
|
|
/// Method configuration data type
|
|
///
|
|
typedef _Tmeth config_method_type;
|
|
|
|
///
|
|
/// Credentials data type
|
|
///
|
|
typedef _Tcred credentials_type;
|
|
|
|
///
|
|
/// Interactive request data type
|
|
///
|
|
typedef _Tint interactive_request_type;
|
|
|
|
///
|
|
/// Interactive response data type
|
|
///
|
|
typedef _Tintres interactive_response_type;
|
|
|
|
public:
|
|
///
|
|
/// Constructs a EAP UI peer module for the given EAP type
|
|
///
|
|
/// \param[in] eap_method EAP method type ID
|
|
///
|
|
peer_ui(_In_ winstd::eap_type_t eap_method) : module(eap_method) {}
|
|
|
|
///
|
|
/// Raises the EAP method's specific connection configuration user interface dialog on the client.
|
|
///
|
|
/// \sa [EapPeerInvokeConfigUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363614.aspx)
|
|
///
|
|
/// \param[in] hwndParent Parent window
|
|
/// \param[inout] cfg Configuration to edit
|
|
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
|
|
///
|
|
/// \returns
|
|
/// - \c true if succeeded
|
|
/// - \c false otherwise. See \p ppEapError for details.
|
|
///
|
|
virtual bool invoke_config_ui(
|
|
_In_ HWND hwndParent,
|
|
_Inout_ config_providers &cfg,
|
|
_Out_ EAP_ERROR **ppEapError) = 0;
|
|
|
|
///
|
|
/// Raises a custom interactive user interface dialog to obtain user identity information for the EAP method on the client.
|
|
///
|
|
/// \sa [EapPeerInvokeIdentityUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363615.aspx)
|
|
///
|
|
/// \param[in] hwndParent Parent window
|
|
/// \param[in] dwFlags Flags passed to `EapPeerInvokeIdentityUI()` call
|
|
/// \param[inout] cfg Configuration
|
|
/// \param[inout] cred User credentials to edit
|
|
/// \param[out] ppwszIdentity Pointer to user identity. Free using `module::free_memory()`.
|
|
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
|
|
///
|
|
/// \returns
|
|
/// - \c true if succeeded
|
|
/// - \c false otherwise. See \p ppEapError for details.
|
|
///
|
|
virtual bool invoke_identity_ui(
|
|
_In_ HWND hwndParent,
|
|
_In_ DWORD dwFlags,
|
|
_Inout_ config_providers &cfg,
|
|
_Inout_ credentials_type &cred,
|
|
_Out_ LPWSTR *ppwszIdentity,
|
|
_Out_ EAP_ERROR **ppEapError) = 0;
|
|
|
|
///
|
|
/// Raises a custom interactive user interface dialog for the EAP method on the client.
|
|
///
|
|
/// \sa [EapPeerInvokeInteractiveUI function](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363616.aspx)
|
|
///
|
|
/// \param[in] hwndParent Parent window
|
|
/// \param[in] req Interactive request
|
|
/// \param[out] res Interactive response
|
|
/// \param[out] ppEapError Pointer to error descriptor in case of failure. Free using `module::free_error_memory()`.
|
|
///
|
|
/// \returns
|
|
/// - \c true if succeeded
|
|
/// - \c false otherwise. See \p ppEapError for details.
|
|
///
|
|
virtual bool invoke_interactive_ui(
|
|
_In_ HWND hwndParent,
|
|
_In_ const interactive_request_type &req,
|
|
_Out_ interactive_response_type &res,
|
|
_Out_ EAP_ERROR **ppEapError) = 0;
|
|
};
|
|
}
|