avatarmanipulation.h 3.07 KB
Newer Older
1
/*
2
 *  Copyright (C) 2016-2019 Savoir-faire Linux Inc.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *  Author: Nicolas Jager <nicolas.jager@savoirfairelinux.com>
 *
 *  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
 *  the Free Software Foundation; either version 3 of the License, or
 *  (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
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
 */

#ifndef _AVATARMANIPULATION_H
#define _AVATARMANIPULATION_H

#include <gtk/gtk.h>
24 25 26 27
#include <api/account.h>
#include <api/profile.h>

#include "accountinfopointer.h"
28

29 30 31 32 33 34 35 36
namespace lrc
{
namespace api
{
    class AVModel;
}
}

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
G_BEGIN_DECLS

#define AVATAR_MANIPULATION_TYPE            (avatar_manipulation_get_type ())
#define AVATAR_MANIPULATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), AVATAR_MANIPULATION_TYPE, AvatarManipulation))
#define AVATAR_MANIPULATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), AVATAR_MANIPULATION_TYPE, AvatarManipulation))
#define IS_AVATAR_MANIPULATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), AVATAR_MANIPULATION_TYPE))
#define IS_AVATAR_MANIPULATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), AVATAR_MANIPULATION_TYPE))


typedef struct _AvatarManipulation      AvatarManipulation;
typedef struct _AvatarManipulationClass AvatarManipulationClass;

/**
 * AvatarManipulationState:
 * @AVATAR_MANIPULATION_STATE_CURRENT: The initial state. The widget will display the current
52 53 54 55 56 57 58
 *  or the default avatar, with the possible actions being to start the camera (if available) to
 *  take a new photo) or to select an existing image.
 * @AVATAR_MANIPULATION_STATE_PHOTO: The state in which the camera is on and the video is being
 *  shown. The possible actions are to take a snapshot or to return to the previous state.
 * @AVATAR_MANIPULATION_STATE_EDIT: The state after selecting a new image (or snapping a photo). The
 *  user must select the square area they wish to use for the avatar. The possible actions are to
 *  confirm the selection or to return to the previous state.
59 60 61 62
 */
typedef enum
{
    AVATAR_MANIPULATION_STATE_CURRENT,
63
    AVATAR_MANIPULATION_STATE_PHOTO,
64 65 66 67
    AVATAR_MANIPULATION_STATE_EDIT
} AvatarManipulationState;


68
GType      avatar_manipulation_get_type        (void) G_GNUC_CONST;
69
GtkWidget *avatar_manipulation_new             (AccountInfoPointer const & accountInfo, lrc::api::AVModel* avModel);
70 71

/* used from the account creation wizard */
72
GtkWidget *avatar_manipulation_new_from_wizard(lrc::api::AVModel* avModel);
73
void       avatar_manipulation_wizard_completed(AvatarManipulation *);
74
gchar*     avatar_manipulation_get_temporary   (AvatarManipulation *view);
75 76 77 78

G_END_DECLS

#endif /* _AVATARMANIPULATION_H */