2011-06-10 19:17:35 -07:00
|
|
|
/* Copyright 2011 Yorba Foundation
|
|
|
|
|
*
|
|
|
|
|
* This software is licensed under the GNU Lesser General Public License
|
|
|
|
|
* (version 2.1 or later). See the COPYING file in this distribution.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public interface Geary.Folder : Object {
|
|
|
|
|
public enum CloseReason {
|
|
|
|
|
LOCAL_CLOSE,
|
|
|
|
|
REMOTE_CLOSE,
|
|
|
|
|
FOLDER_CLOSED
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public signal void opened();
|
|
|
|
|
|
|
|
|
|
public signal void closed(CloseReason reason);
|
|
|
|
|
|
|
|
|
|
public signal void updated();
|
|
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
public virtual void notify_opened() {
|
|
|
|
|
opened();
|
|
|
|
|
}
|
2011-06-13 15:16:57 -07:00
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
public virtual void notify_closed(CloseReason reason) {
|
|
|
|
|
closed(reason);
|
|
|
|
|
}
|
2011-06-13 15:16:57 -07:00
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
public virtual void notify_updated() {
|
|
|
|
|
updated();
|
|
|
|
|
}
|
2011-06-13 15:16:57 -07:00
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
public abstract string get_name();
|
2011-06-13 15:16:57 -07:00
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
public abstract Geary.FolderProperties? get_properties();
|
2011-06-13 15:16:57 -07:00
|
|
|
|
2011-06-10 19:17:35 -07:00
|
|
|
public abstract async void open_async(bool readonly, Cancellable? cancellable = null) throws Error;
|
|
|
|
|
|
|
|
|
|
public abstract async void close_async(Cancellable? cancellable = null) throws Error;
|
|
|
|
|
|
|
|
|
|
public abstract int get_message_count() throws Error;
|
|
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
public abstract async void create_email_async(Geary.Email email, Geary.EmailOrdering ordering,
|
2011-06-10 19:17:35 -07:00
|
|
|
Cancellable? cancellable = null) throws Error;
|
|
|
|
|
|
2011-06-16 16:27:08 -07:00
|
|
|
/**
|
|
|
|
|
* low is one-based.
|
|
|
|
|
*/
|
|
|
|
|
public abstract async Gee.List<Geary.Email> list_email_async(int low, int count,
|
|
|
|
|
Geary.Email.Field fields, Cancellable? cancellable = null) throws Error;
|
|
|
|
|
|
|
|
|
|
public abstract async Geary.Email fetch_email_async(int msg_num, Geary.Email.Field fields,
|
2011-06-10 19:17:35 -07:00
|
|
|
Cancellable? cancellable = null) throws Error;
|
|
|
|
|
}
|
|
|
|
|
|