summaryrefslogtreecommitdiff
path: root/src/ui.h
blob: 41d551f67f6c42eec801a1510c3d03bdc19f8b8f (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
/*
 * Copyright (C) 2009 Canonical Ltd.
 * Author: Robert Ancell <robert.ancell@canonical.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. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#ifndef _UI_H_
#define _UI_H_

#include <glib-object.h>
#include "book.h"
#include "scanner.h"

G_BEGIN_DECLS

#define SIMPLE_SCAN_TYPE  (ui_get_type ())
#define SIMPLE_SCAN(obj)  (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIMPLE_SCAN_TYPE, SimpleScan))


typedef struct SimpleScanPrivate SimpleScanPrivate;

typedef struct
{
    GObject             parent_instance;
    SimpleScanPrivate  *priv;
} SimpleScan;

typedef struct
{
    GObjectClass parent_class;

    void (*start_scan) (SimpleScan *ui, ScanOptions *options);
    void (*stop_scan) (SimpleScan *ui);
    void (*save) (SimpleScan *ui, const gchar *format);
    void (*email) (SimpleScan *ui, const gchar *profile);
    void (*quit) (SimpleScan *ui);
} SimpleScanClass;


GType ui_get_type (void);

SimpleScan *ui_new (void);

Book *ui_get_book (SimpleScan *ui);

void ui_set_selected_page (SimpleScan *ui, Page *page);

Page *ui_get_selected_page (SimpleScan *ui);

void ui_set_default_file_name (SimpleScan *ui, const gchar *default_file_name);

void ui_authorize (SimpleScan *ui, const gchar *resource, gchar **username, gchar **password);

void ui_set_scan_devices (SimpleScan *ui, GList *devices);

gchar *ui_get_selected_device (SimpleScan *ui);

void ui_set_selected_device (SimpleScan *ui, const gchar *device);

void ui_set_scanning (SimpleScan *ui, gboolean scanning);

void ui_show_error (SimpleScan *ui, const gchar *error_title, const gchar *error_text, gboolean change_scanner_hint);

void ui_start (SimpleScan *ui);

#endif /* _UI_H_ */