chatty-buddy-list.h 1.63 KB
Newer Older
Andrea Schaefer's avatar
Andrea Schaefer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * Copyright (C) 2018 Purism SPC
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */


#ifndef __BUDDY_LIST_H_INCLUDE__
#define __BUDDY_LIST_H_INCLUDE__

#include "purple.h"


typedef struct {
  GtkBox            *box;
  GtkTreeView       *treeview;
  GtkListStore      *treemodel;
  GtkTreeViewColumn *text_column;
  GtkScrolledWindow *scroll;
  GdkPixbuf         *empty_avatar;

  PurpleBlistNode   *selected_node;

  guint             *messaging_mode;
  guint             refresh_timer;

  gpointer          priv;
} ChattyBuddyList;


typedef enum {
  CHATTY_BLIST_NODE_HAS_PENDING_MESSAGE            =  1 << 0,
  CHATTY_BLIST_CHAT_HAS_PENDING_MESSAGE_WITH_NICK  =  1 << 1,
} ChattyBlistNodeFlags;


typedef struct _chatty_blist_node {
  GtkTreeRowReference *row;
  GtkTreeIter         iter;
  gboolean            contact_expanded;
  gboolean            recent_signonoff;
  gint                recent_signonoff_timer;

  struct {
    PurpleConversation   *conv;
    time_t               last_message;
    ChattyBlistNodeFlags flags;
  } conv;
} ChattyBlistNode;


enum
{
  COLUMN_NODE,
  COLUMN_AVATAR,
  COLUMN_NAME,
  COLUMN_TIME,
  NUM_COLUMNS,
};


enum {
  CHATTY_MSG_MODE_XMPP,
  CHATTY_MSG_MODE_OMEMO,
  CHATTY_MSG_MODE_SMS
} e_messaging_modes;


enum {
  CHATTY_STATUS_ICON_LARGE,
  CHATTY_STATUS_ICON_SMALL
} e_icon_size;


#define CHATTY_BLIST(list) ((ChattyBuddyList *)purple_blist_get_ui_data())
#define CHATTY_IS_CHATTY_BLIST(list) \
  (purple_blist_get_ui_ops() == chatty_blist_get_ui_ops())

PurpleBlistUiOps *chatty_blist_get_ui_ops (void);

void chatty_blist_init (void);
void chatty_blist_uninit (void);
void chatty_blist_add_buddy (void);

#endif