| 1 | /* |
| 2 | * Copyright (C) 2013 Samsung Electronics Inc. All rights reserved. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) |
| 21 | #error "Only <webkit2/webkit2.h> can be included directly." |
| 22 | #endif |
| 23 | |
| 24 | #ifndef WebKitCredential_h |
| 25 | #define WebKitCredential_h |
| 26 | |
| 27 | #include <glib-object.h> |
| 28 | #include <webkit2/WebKitDefines.h> |
| 29 | |
| 30 | G_BEGIN_DECLS |
| 31 | |
| 32 | #define WEBKIT_TYPE_CREDENTIAL (webkit_credential_get_type()) |
| 33 | |
| 34 | typedef struct _WebKitCredential WebKitCredential; |
| 35 | |
| 36 | /** |
| 37 | * WebKitCredentialPersistence: |
| 38 | * @WEBKIT_CREDENTIAL_PERSISTENCE_NONE: Credential does not persist |
| 39 | * @WEBKIT_CREDENTIAL_PERSISTENCE_FOR_SESSION: Credential persists for session only |
| 40 | * @WEBKIT_CREDENTIAL_PERSISTENCE_PERMANENT: Credential persists permanently |
| 41 | * |
| 42 | * Enum values representing the duration for which a credential persists. |
| 43 | * |
| 44 | * Since: 2.2 |
| 45 | */ |
| 46 | typedef enum { |
| 47 | WEBKIT_CREDENTIAL_PERSISTENCE_NONE, |
| 48 | WEBKIT_CREDENTIAL_PERSISTENCE_FOR_SESSION, |
| 49 | WEBKIT_CREDENTIAL_PERSISTENCE_PERMANENT |
| 50 | } WebKitCredentialPersistence; |
| 51 | |
| 52 | WEBKIT_API GType |
| 53 | webkit_credential_get_type (void); |
| 54 | |
| 55 | WEBKIT_API WebKitCredential * |
| 56 | webkit_credential_new (const gchar *username, |
| 57 | const gchar *password, |
| 58 | WebKitCredentialPersistence persistence); |
| 59 | |
| 60 | WEBKIT_API WebKitCredential * |
| 61 | webkit_credential_copy (WebKitCredential *credential); |
| 62 | |
| 63 | WEBKIT_API void |
| 64 | webkit_credential_free (WebKitCredential *credential); |
| 65 | |
| 66 | WEBKIT_API const gchar * |
| 67 | webkit_credential_get_username (WebKitCredential *credential); |
| 68 | |
| 69 | WEBKIT_API const gchar * |
| 70 | webkit_credential_get_password (WebKitCredential *credential); |
| 71 | |
| 72 | WEBKIT_API gboolean |
| 73 | webkit_credential_has_password (WebKitCredential *credential); |
| 74 | |
| 75 | WEBKIT_API WebKitCredentialPersistence |
| 76 | webkit_credential_get_persistence (WebKitCredential *credential); |
| 77 | |
| 78 | G_END_DECLS |
| 79 | |
| 80 | #endif |
| 81 | |