2010-10-30 16:14:30 -04:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
|
|
|
*
|
|
|
|
* Copyright 2009-2010 Red Hat, Inc,
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2012-09-06 07:43:05 -04:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
2010-10-30 16:14:30 -04:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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
|
2014-01-23 12:57:27 +01:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2010-10-30 16:14:30 -04:00
|
|
|
*
|
|
|
|
* Written by: Matthias Clasen <mclasen@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2018-05-31 10:44:37 +12:00
|
|
|
#pragma once
|
2010-10-30 16:14:30 -04:00
|
|
|
|
2023-10-17 13:33:59 +02:00
|
|
|
#include <adwaita.h>
|
2010-10-30 16:14:30 -04:00
|
|
|
#include <gtk/gtk.h>
|
2019-02-04 15:46:16 +00:00
|
|
|
#include <act/act.h>
|
2010-10-30 16:14:30 -04:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2023-10-05 11:32:44 +02:00
|
|
|
#define AVATAR_PIXEL_SIZE 512
|
|
|
|
|
2023-10-09 18:41:58 +02:00
|
|
|
/* Key and values that are written as metadata to the exported user avatar this
|
|
|
|
* way it's possible to know how the image was initially created.
|
|
|
|
* If set to generated we can regenerated the avatar when the style changes or
|
|
|
|
* when the users full name changes. The other two values don't have a specific use yet */
|
|
|
|
#define IMAGE_SOURCE_KEY "tEXt::source"
|
|
|
|
#define IMAGE_SOURCE_VALUE_GENERATED "gnome-generated"
|
|
|
|
#define IMAGE_SOURCE_VALUE_FACE "gnome-face"
|
|
|
|
#define IMAGE_SOURCE_VALUE_CUSTOM "gnome-custom"
|
|
|
|
|
2013-08-06 15:43:23 +02:00
|
|
|
void set_entry_generation_icon (GtkEntry *entry);
|
2013-07-23 13:22:49 +02:00
|
|
|
void set_entry_validation_checkmark (GtkEntry *entry);
|
2010-10-30 16:14:30 -04:00
|
|
|
void set_entry_validation_error (GtkEntry *entry,
|
|
|
|
const gchar *text);
|
|
|
|
void clear_entry_validation_error (GtkEntry *entry);
|
|
|
|
|
2023-10-17 13:33:59 +02:00
|
|
|
const gchar *get_real_or_user_name (ActUser *user);
|
2018-11-10 09:59:14 +13:00
|
|
|
gsize get_username_max_length (void);
|
2018-11-13 13:33:15 +13:00
|
|
|
gboolean is_username_used (const gchar *username);
|
|
|
|
gboolean is_valid_name (const gchar *name);
|
2019-01-25 16:32:20 +01:00
|
|
|
void is_valid_username_async (const gchar *username,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer callback_data);
|
|
|
|
gboolean is_valid_username_finish (GAsyncResult *result,
|
|
|
|
gchar **tip,
|
|
|
|
gchar **username,
|
|
|
|
GError **error);
|
2023-10-05 11:32:44 +02:00
|
|
|
GdkTexture *draw_avatar_to_texture (AdwAvatar *avatar,
|
|
|
|
int size);
|
2019-02-04 15:46:16 +00:00
|
|
|
void set_user_icon_data (ActUser *user,
|
2023-10-09 18:41:58 +02:00
|
|
|
GdkTexture *texture,
|
|
|
|
const gchar *image_source);
|
2023-10-17 13:33:59 +02:00
|
|
|
void setup_avatar_for_user (AdwAvatar *avatar,
|
|
|
|
ActUser *user);
|
|
|
|
GSettings *settings_or_null (const gchar *schema);
|
2019-02-04 15:46:16 +00:00
|
|
|
|
2010-10-30 16:14:30 -04:00
|
|
|
G_END_DECLS
|