geary/src/engine/api/geary-account.vala
Jim Nelson 7f293f9a6f No longer crashes when running for the first time: #3798
Problem was that the client fetches folder objects for the special folders (Inbox, Drafts, etc.) prior to fetching the full folder list and the Engine's fetch_folder_async() call wasn't prepared to handle fetches for folders not located in the local database.
2011-07-04 13:54:00 -07:00

52 lines
2.2 KiB
Vala

/* 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.Account : Object {
public signal void folders_added_removed(Gee.Collection<Geary.Folder>? added,
Gee.Collection<Geary.Folder>? removed);
protected abstract void notify_folders_added_removed(Gee.Collection<Geary.Folder>? added,
Gee.Collection<Geary.Folder>? removed);
/**
* This method returns which Geary.Email.Field fields must be available in a Geary.Email to
* write (or save or store) the message to the backing medium. Different implementations will
* have different requirements, which must be reconciled.
*
* In this case, Geary.Email.Field.NONE means "any".
*
* If a write operation is attempted on an email that does not have all these fields fulfilled,
* an EngineError.INCOMPLETE_MESSAGE will be thrown.
*/
public abstract Geary.Email.Field get_required_fields_for_writing();
/**
* Lists all the folders found under the parent path unless it's null, in which case it lists
* all the root folders. If the parent path cannot be found, EngineError.NOT_FOUND is thrown.
* If no folders exist in the root, EngineError.NOT_FOUND may be thrown as well. However,
* the caller should be prepared to deal with an empty list being returned instead.
*/
public abstract async Gee.Collection<Geary.Folder> list_folders_async(Geary.FolderPath? parent,
Cancellable? cancellable = null) throws Error;
/**
* Returns true if the folder exists.
*
* This method never throws EngineError.NOT_FOUND.
*/
public abstract async bool folder_exists_async(Geary.FolderPath path, Cancellable? cancellable = null)
throws Error;
/**
* Fetches a Folder object corresponding to the supplied path. If the backing medium does
* not have a record of a folder at the path, EngineError.NOT_FOUND will be thrown.
*/
public abstract async Geary.Folder fetch_folder_async(Geary.FolderPath path,
Cancellable? cancellable = null) throws Error;
public abstract string to_string();
}