Broke out Commands into separate files with barebone Valadocs.

This commit is contained in:
Jim Nelson 2013-06-05 15:02:12 -07:00
parent 2224928647
commit 1f71f02a9d
18 changed files with 390 additions and 204 deletions

View file

@ -62,18 +62,33 @@ engine/db/db-transaction-outcome.vala
engine/db/db-transaction-type.vala
engine/db/db-versioned-database.vala
engine/imap/imap.vala
engine/imap/imap-error.vala
engine/imap/api/imap-account.vala
engine/imap/api/imap-email-flags.vala
engine/imap/api/imap-email-identifier.vala
engine/imap/api/imap-email-properties.vala
engine/imap/api/imap-folder-properties.vala
engine/imap/api/imap-folder.vala
engine/imap/command/imap-commands.vala
engine/imap/command/imap-capability-command.vala
engine/imap/command/imap-close-command.vala
engine/imap/command/imap-command.vala
engine/imap/command/imap-compress-command.vala
engine/imap/command/imap-copy-command.vala
engine/imap/command/imap-examine-command.vala
engine/imap/command/imap-expunge-command.vala
engine/imap/command/imap-fetch-command.vala
engine/imap/command/imap-id-command.vala
engine/imap/command/imap-idle-command.vala
engine/imap/command/imap-list-command.vala
engine/imap/command/imap-login-command.vala
engine/imap/command/imap-logout-command.vala
engine/imap/command/imap-message-set.vala
engine/imap/imap.vala
engine/imap/imap-error.vala
engine/imap/command/imap-noop-command.vala
engine/imap/command/imap-select-command.vala
engine/imap/command/imap-starttls-command.vala
engine/imap/command/imap-status-command.vala
engine/imap/command/imap-store-command.vala
engine/imap/message/imap-data-format.vala
engine/imap/message/imap-fetch-body-data-type.vala
engine/imap/message/imap-fetch-data-type.vala

View file

@ -0,0 +1,20 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.1.1]]
*
* @see Capabilities
*/
public class Geary.Imap.CapabilityCommand : Command {
public const string NAME = "capability";
public CapabilityCommand() {
base (NAME);
}
}

View file

@ -0,0 +1,18 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.4.2]]
*/
public class Geary.Imap.CloseCommand : Command {
public const string NAME = "close";
public CloseCommand() {
base (NAME);
}
}

View file

@ -1,201 +0,0 @@
/* Copyright 2011-2013 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 class Geary.Imap.CapabilityCommand : Command {
public const string NAME = "capability";
public CapabilityCommand() {
base (NAME);
}
}
public class Geary.Imap.CompressCommand : Command {
public const string NAME = "compress";
public const string ALGORITHM_DEFLATE = "deflate";
public CompressCommand(string algorithm) {
base (NAME, { algorithm });
}
}
public class Geary.Imap.StarttlsCommand : Command {
public const string NAME = "starttls";
public StarttlsCommand() {
base (NAME);
}
}
public class Geary.Imap.NoopCommand : Command {
public const string NAME = "noop";
public NoopCommand() {
base (NAME);
}
}
public class Geary.Imap.LoginCommand : Command {
public const string NAME = "login";
public LoginCommand(string user, string pass) {
base (NAME, { user, pass });
}
public override string to_string() {
return "%s %s <user> <pass>".printf(tag.to_string(), name);
}
}
public class Geary.Imap.LogoutCommand : Command {
public const string NAME = "logout";
public LogoutCommand() {
base (NAME);
}
}
public class Geary.Imap.ListCommand : Command {
public const string NAME = "list";
public const string XLIST_NAME = "xlist";
public ListCommand(MailboxSpecifier mailbox, bool use_xlist) {
base (use_xlist ? XLIST_NAME : NAME, { "" });
add(mailbox.to_parameter());
}
public ListCommand.wildcarded(string reference, MailboxSpecifier mailbox, bool use_xlist) {
base (use_xlist ? XLIST_NAME : NAME, { reference });
add(mailbox.to_parameter());
}
}
public class Geary.Imap.ExamineCommand : Command {
public const string NAME = "examine";
public ExamineCommand(MailboxSpecifier mailbox) {
base (NAME);
add(mailbox.to_parameter());
}
}
public class Geary.Imap.SelectCommand : Command {
public const string NAME = "select";
public SelectCommand(MailboxSpecifier mailbox) {
base (NAME);
add(mailbox.to_parameter());
}
}
public class Geary.Imap.CloseCommand : Command {
public const string NAME = "close";
public CloseCommand() {
base (NAME);
}
}
public class Geary.Imap.StatusCommand : Command {
public const string NAME = "status";
public StatusCommand(MailboxSpecifier mailbox, StatusDataType[] data_items) {
base (NAME);
add(mailbox.to_parameter());
assert(data_items.length > 0);
ListParameter data_item_list = new ListParameter(this);
foreach (StatusDataType data_item in data_items)
data_item_list.add(data_item.to_parameter());
add(data_item_list);
}
}
public class Geary.Imap.StoreCommand : Command {
public const string NAME = "store";
public const string UID_NAME = "uid store";
public StoreCommand(MessageSet message_set, Gee.List<MessageFlag> flag_list, bool add_flag,
bool silent) {
base (message_set.is_uid ? UID_NAME : NAME);
add(message_set.to_parameter());
add(new StringParameter("%sflags%s".printf(add_flag ? "+" : "-", silent ? ".silent" : "")));
ListParameter list = new ListParameter(this);
foreach(MessageFlag flag in flag_list)
list.add(new StringParameter(flag.value));
add(list);
}
}
// Results of this command automatically handled by Geary.Imap.UnsolicitedServerData
public class Geary.Imap.ExpungeCommand : Command {
public const string NAME = "expunge";
public const string UID_NAME = "uid expunge";
public ExpungeCommand() {
base (NAME);
}
public ExpungeCommand.uid(MessageSet message_set) {
base (UID_NAME);
assert(message_set.is_uid);
add(message_set.to_parameter());
}
}
public class Geary.Imap.IdleCommand : Command {
public const string NAME = "idle";
public IdleCommand() {
base (NAME);
}
}
public class Geary.Imap.CopyCommand : Command {
public const string NAME = "copy";
public const string UID_NAME = "uid copy";
public CopyCommand(MessageSet message_set, MailboxSpecifier destination) {
base (message_set.is_uid ? UID_NAME : NAME);
add(message_set.to_parameter());
add(destination.to_parameter());
}
}
public class Geary.Imap.IdCommand : Command {
public const string NAME = "id";
public IdCommand(Gee.HashMap<string, string> fields) {
base (NAME);
ListParameter list = new ListParameter(this);
foreach (string key in fields.keys) {
list.add(new QuotedStringParameter(key));
list.add(new QuotedStringParameter(fields.get(key)));
}
add(list);
}
public IdCommand.nil() {
base (NAME);
add(NilParameter.instance);
}
}

View file

@ -0,0 +1,20 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc4978]]
*/
public class Geary.Imap.CompressCommand : Command {
public const string NAME = "compress";
public const string ALGORITHM_DEFLATE = "deflate";
public CompressCommand(string algorithm) {
base (NAME, { algorithm });
}
}

View file

@ -0,0 +1,22 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.4.7]]
*/
public class Geary.Imap.CopyCommand : Command {
public const string NAME = "copy";
public const string UID_NAME = "uid copy";
public CopyCommand(MessageSet message_set, MailboxSpecifier destination) {
base (message_set.is_uid ? UID_NAME : NAME);
add(message_set.to_parameter());
add(destination.to_parameter());
}
}

View file

@ -0,0 +1,22 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.3.2]]
*
* @see SelectCommand
*/
public class Geary.Imap.ExamineCommand : Command {
public const string NAME = "examine";
public ExamineCommand(MailboxSpecifier mailbox) {
base (NAME);
add(mailbox.to_parameter());
}
}

View file

@ -0,0 +1,28 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.4.3]] and
* [[http://tools.ietf.org/html/rfc4315#section-2.1]]
*/
public class Geary.Imap.ExpungeCommand : Command {
public const string NAME = "expunge";
public const string UID_NAME = "uid expunge";
public ExpungeCommand() {
base (NAME);
}
public ExpungeCommand.uid(MessageSet message_set) {
base (UID_NAME);
assert(message_set.is_uid);
add(message_set.to_parameter());
}
}

View file

@ -0,0 +1,32 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://www.ietf.org/rfc/rfc2971.txt]]
*/
public class Geary.Imap.IdCommand : Command {
public const string NAME = "id";
public IdCommand(Gee.HashMap<string, string> fields) {
base (NAME);
ListParameter list = new ListParameter(this);
foreach (string key in fields.keys) {
list.add(new QuotedStringParameter(key));
list.add(new QuotedStringParameter(fields.get(key)));
}
add(list);
}
public IdCommand.nil() {
base (NAME);
add(NilParameter.instance);
}
}

View file

@ -0,0 +1,20 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc2177]]
*
* @see NoopCommand
*/
public class Geary.Imap.IdleCommand : Command {
public const string NAME = "idle";
public IdleCommand() {
base (NAME);
}
}

View file

@ -0,0 +1,29 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.3.8]]
*
* @see MailboxInformation
*/
public class Geary.Imap.ListCommand : Command {
public const string NAME = "list";
public const string XLIST_NAME = "xlist";
public ListCommand(MailboxSpecifier mailbox, bool use_xlist) {
base (use_xlist ? XLIST_NAME : NAME, { "" });
add(mailbox.to_parameter());
}
public ListCommand.wildcarded(string reference, MailboxSpecifier mailbox, bool use_xlist) {
base (use_xlist ? XLIST_NAME : NAME, { reference });
add(mailbox.to_parameter());
}
}

View file

@ -0,0 +1,22 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.2.3]]
*/
public class Geary.Imap.LoginCommand : Command {
public const string NAME = "login";
public LoginCommand(string user, string pass) {
base (NAME, { user, pass });
}
public override string to_string() {
return "%s %s <user> <pass>".printf(tag.to_string(), name);
}
}

View file

@ -0,0 +1,18 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.1.3]]
*/
public class Geary.Imap.LogoutCommand : Command {
public const string NAME = "logout";
public LogoutCommand() {
base (NAME);
}
}

View file

@ -0,0 +1,20 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.1.2]]
*
* @see IdleCommand
*/
public class Geary.Imap.NoopCommand : Command {
public const string NAME = "noop";
public NoopCommand() {
base (NAME);
}
}

View file

@ -0,0 +1,22 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.3.1]]
*
* @see ExamineCommand
*/
public class Geary.Imap.SelectCommand : Command {
public const string NAME = "select";
public SelectCommand(MailboxSpecifier mailbox) {
base (NAME);
add(mailbox.to_parameter());
}
}

View file

@ -0,0 +1,18 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.2.1]]
*/
public class Geary.Imap.StarttlsCommand : Command {
public const string NAME = "starttls";
public StarttlsCommand() {
base (NAME);
}
}

View file

@ -0,0 +1,29 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.3.10]]
*
* @see StatusData
*/
public class Geary.Imap.StatusCommand : Command {
public const string NAME = "status";
public StatusCommand(MailboxSpecifier mailbox, StatusDataType[] data_items) {
base (NAME);
add(mailbox.to_parameter());
assert(data_items.length > 0);
ListParameter data_item_list = new ListParameter(this);
foreach (StatusDataType data_item in data_items)
data_item_list.add(data_item.to_parameter());
add(data_item_list);
}
}

View file

@ -0,0 +1,32 @@
/* Copyright 2011-2013 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.
*/
/**
* See [[http://tools.ietf.org/html/rfc3501#section-6.4.6]]
*
* @see FetchCommand
* @see FetchedData
*/
public class Geary.Imap.StoreCommand : Command {
public const string NAME = "store";
public const string UID_NAME = "uid store";
public StoreCommand(MessageSet message_set, Gee.List<MessageFlag> flag_list, bool add_flag,
bool silent) {
base (message_set.is_uid ? UID_NAME : NAME);
add(message_set.to_parameter());
add(new StringParameter("%sflags%s".printf(add_flag ? "+" : "-", silent ? ".silent" : "")));
ListParameter list = new ListParameter(this);
foreach(MessageFlag flag in flag_list)
list.add(new StringParameter(flag.value));
add(list);
}
}