aboutsummaryrefslogtreecommitdiffstats
path: root/shell/importer/GNOME_Evolution_Importer.idl
blob: fe49ab82c5ad3b3f4d4356541e8372900950829f (plain) (blame)
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
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Interfaces for the importer framework.
 *
 * Authors:
 *   Iain Holmes  <iain@helixcode.com>
 *
 * Copyright (C) 2000 Helix Code, Inc.
 */

#include <Bonobo.idl>

module GNOME {
module Evolution {
    interface ImporterListener : Bonobo::Unknown {
        enum ImporterResult {
            OK,
            UNSUPPORTED_OPERATION,
            NOT_READY,
            BUSY,
            UNKNOWN_DATA,
            BAD_DATA,
            BAD_FILE
        };

        /**
         * notifyResult:
         * @result: The result of the import.
         * @more_items: Are there any more items to be processed?
         *
         * Notifies the listener of the result and whether there are
         * any more items to be imported.
         */
        oneway void notifyResult (in ImporterResult result,
                       in boolean more_items);
    };

    interface Importer : Bonobo::Unknown {

        /**
         * processItem:
         * @listener: The ImporterListener that will be notified of the
         * progress.
         *
         * Processes the next item.
         *
         */
        oneway void processItem (in ImporterListener listener);

        /**
         * getError:
         * 
         * Retrieve a detailed explaination of the error.
         *
         * Returns: A string.
         */
        string getError ();

        /**
         * supportFormat:
         * @filename: The filename of the file.
         *
         * Checks if the importer created by this factory can 
         * import the file specified.
         *
         * Returns: A boolean, TRUE if it can import the file,
         * FALSE otherwise.
         */
        boolean supportFormat (in string filename);

        /**
         * loadFile:
         * @filename: The filename of the file.
         * 
         * Loads the file and prepares an Importer object that can
         * process files of this type.
         *
         * Returns: An Importer object.
         */
        boolean loadFile (in string filename);
    };
};
};