summaryrefslogtreecommitdiff
path: root/src/trg-state-selector.h
blob: a2f602131a89902f2818ef47b528d8c122b4c8c2 (plain)
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
/*
 * transmission-remote-gtk - Transmission RPC client for GTK
 * Copyright (C) 2011  Alan Fitton

 * 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 2 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 TRG_STATE_LIST_H_
#define TRG_STATE_LIST_H_

#include <glib-object.h>
#include <json-glib/json-glib.h>

#include "trg-torrent-model.h"
#include "trg-client.h"

enum {
    STATE_SELECTOR_ICON,
    STATE_SELECTOR_NAME,
    STATE_SELECTOR_BIT,
    STATE_SELECTOR_SERIAL,
    STATE_SELECTOR_INDEX,
    STATE_SELECTOR_COLUMNS
};

G_BEGIN_DECLS
#define TRG_TYPE_STATE_SELECTOR trg_state_selector_get_type()
#define TRG_STATE_SELECTOR(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRG_TYPE_STATE_SELECTOR, TrgStateSelector))
#define TRG_STATE_SELECTOR_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), TRG_TYPE_STATE_SELECTOR, TrgStateSelectorClass))
#define TRG_IS_STATE_SELECTOR(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRG_TYPE_STATE_SELECTOR))
#define TRG_IS_STATE_SELECTOR_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), TRG_TYPE_STATE_SELECTOR))
#define TRG_STATE_SELECTOR_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), TRG_TYPE_STATE_SELECTOR, TrgStateSelectorClass))
    typedef struct {
    GtkTreeView parent;
} TrgStateSelector;

typedef struct {
    GtkTreeViewClass parent_class;

    void (*torrent_state_changed) (TrgStateSelector * selector,
                                   guint flag, gpointer data);

} TrgStateSelectorClass;

GType trg_state_selector_get_type(void);
TrgStateSelector *trg_state_selector_new(TrgClient * client);

G_END_DECLS guint32 trg_state_selector_get_flag(TrgStateSelector * s);
void trg_state_selector_update(TrgStateSelector * s);
gchar *trg_state_selector_get_selected_text(TrgStateSelector * s);
GRegex *trg_state_selector_get_url_host_regex(TrgStateSelector * s);
void trg_state_selector_disconnect(TrgStateSelector * s);
void trg_state_selector_set_show_trackers(TrgStateSelector * s,
                                          gboolean show);
void trg_state_selector_set_show_dirs(TrgStateSelector * s, gboolean show);
void trg_state_selector_set_queues_enabled(TrgStateSelector *s, gboolean enabled);
void trg_state_selector_stats_update(TrgStateSelector * s, trg_torrent_model_update_stats *stats);

#endif                          /* TRG_STATE_LIST_H_ */