[Csmail-patches] CVS: csmail/src/CSMail ContentDisposition.cs,1.1,1.2 ContentType.cs,1.1,1.2 EMailAd
Status: Pre-Alpha
Brought to you by:
mastergaurav
From: Gaurav V. <mas...@us...> - 2002-09-05 05:17:52
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv9467 Modified Files: ContentDisposition.cs ContentType.cs EMailAddress.cs FolderOpenMode.cs IAddress.cs IAddressList.cs IEncode.cs IMimePart.cs IPart.cs MessageSortStyle.cs TransferEncoding.cs ChangeLog Log Message: 2002-09-04 * ContentDisposition.cs, * ContentType.cs, * EMailAddress.cs, * FolderOpenMode.cs, * IAddress.cs, * IAddressList.cs, * IEncode.cs, * IMimePart.cs, * IPart.cs, * MessageSortStyle.cs, * TransferEncoding.cs : On documentation spree. Index: ContentDisposition.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ContentDisposition.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ContentDisposition.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ContentDisposition.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,9 +10,18 @@ namespace CSMail { + /// <summary> + /// The "Content-Disposition" options. + /// </summary> public enum ContentDisposition { + /// <summary> + /// The current part is an attachment. + /// </summary> Attachment, + /// <summary> + /// The current part is an inline content. + /// </summary> Inline } } Index: ContentType.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ContentType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ContentType.cs 20 Jun 2002 02:43:24 -0000 1.1 +++ ContentType.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -12,25 +12,47 @@ namespace CSMail { + /// <summary> + /// Class that encapsulates the "Content-Type" header + /// </summary> + /// <remarks> + /// Note that this header may be applied to any part + /// as well as to the message as a whole. + /// </remarks> public class ContentType { private string primaryType; private string subType; private ParameterList parameters; + /// <summary> + /// Create an instance with the primary as the <c>PrimaryType</c> + /// and sub as the <c>SubType</c> + /// </summary> public ContentType(string primary, string sub) { primaryType = primary; subType = sub; } + /// <summary> + /// Create an instance with the primary as the <c>PrimaryType</c> + /// and sub as the <c>SubType</c>, and a list of associated + /// parameters. + /// </summary> public ContentType(string primary, string sub, ParameterList parameters) { primaryType = primary; subType = sub; this.parameters = parameters; } - + + /// <summary> + /// Gets the primary type of the content. + /// </summary> + /// <remarks> + /// Returns an empty string, if a <b>null</b> was set + /// </remarks> public string PrimaryType { get @@ -40,7 +62,13 @@ return String.Empty; } } - + + /// <summary> + /// Returns the sub-type of the content. + /// </summary> + /// <remarks> + /// Returns an empty string, if a <b>null</b> was set + /// </remarks> public string SubType { get @@ -50,7 +78,10 @@ return String.Empty; } } - + + /// <summary> + /// Returns the parameters. + /// </summary> public ParameterList Parameters { get @@ -58,7 +89,14 @@ return parameters; } } - + + /// <summary> + /// Checks for the equality with an object. + /// </summary> + /// <remarks> + /// <c>obj</c> may be of type <c>ContentType</c> or + /// <c>string</c>. + /// </remarks> public override bool Equals(object obj) { if(obj is ContentType) @@ -71,7 +109,10 @@ } return false; } - + + /// <summary> + /// Checks for the equality. + /// </summary> public bool Equals(ContentType cType) { if(cType != null) @@ -80,12 +121,25 @@ } return false; } - + + /// <summary> + /// Checks for the equality with a string representation + /// of the object. + /// </summary> public bool Equals(string cType) { return (cType.Equals(this.ToString())); } + /// <summary> + /// Convert to string representation. + /// </summary> + /// <remarks> + /// The returned value is of the form: + /// <code> + /// PrimaryType/SubType; Parameters.ToString() + /// </code> + /// </remarks> public override string ToString() { string retVal; @@ -100,7 +154,10 @@ } return retVal; } - + + /// <summary> + /// Get the hash-code of the current instance. + /// </summary> public override int GetHashCode() { return (primaryType.GetHashCode() + subType.GetHashCode()); Index: EMailAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/EMailAddress.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EMailAddress.cs 30 Aug 2002 10:31:26 -0000 1.2 +++ EMailAddress.cs 5 Sep 2002 05:17:49 -0000 1.3 @@ -12,12 +12,27 @@ namespace CSMail { + /// <summary> + /// Class to represent an email address. + /// </summary> + /// <remarks> + /// Note that an email address must have a userid and hostname + /// to be a valid email address, besides the userid and hostname + /// being themselves a valid string. + /// </remarks> public class EMailAddress: IAddress { private string user; private string host; private string name; + /// <summary> + /// Creates an instance of using userid and hostname. + /// </summary> + /// <remarks> + /// The associated string representation would be + /// <c>user</c>@<c>host</c> + /// </remarks> public EMailAddress(string user, string host) { this.user = user; @@ -122,4 +137,4 @@ return retVal; } } -} \ No newline at end of file +} Index: FolderOpenMode.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/FolderOpenMode.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FolderOpenMode.cs 4 Sep 2002 09:59:18 -0000 1.3 +++ FolderOpenMode.cs 5 Sep 2002 05:17:49 -0000 1.4 @@ -21,7 +21,7 @@ { /// <summary> /// Default mode of opening a folder. - /// <summary> + /// </summary> /// <remarks> /// Though it is implementation dependent, but a /// <code>ReadOnly</code> mode corresponding to this @@ -44,7 +44,7 @@ /// raise an exception. Also, any changes made to the folder, /// if the exceptions are caught internally and not allowed to /// propagate, are lost. - /// </summary> + /// </remarks> ReadOnly, /// <summary> /// The folder can not be used for writing. Index: IAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IAddress.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IAddress.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IAddress.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,10 +10,20 @@ namespace CSMail { + /// <summary> + /// IAddress interface + /// </summary> public interface IAddress { + /// <summary> + /// When implemented, returns the type of address it is holding. + /// </summary> + /// <seealso cref="CSMail.AddressType"/> AddressType AddressType { get; } - + + /// <summary> + /// When implemented, tests for equality of two addresses. + /// </summary> bool Equals(IAddress address); } } Index: IAddressList.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IAddressList.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IAddressList.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IAddressList.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,15 +10,39 @@ namespace CSMail { + /// <summary> + /// Interface to handle collection of addresses. + /// </summary> public interface IAddressList { + /// <summary> + /// When implemented, returns the number of addresses in the list. + /// </summary> int Count { get; } + /// <summary> + /// When implemented, adds the address to the list. + /// </summary> int Add(IAddress address); + /// <summary> + /// When implemented, adds the address at a given index. + /// </summary> void AddAt(int index, IAddress address); + /// <summary> + /// When implemented, clears the list. + /// </summary> void Clear(); + /// <summary> + /// When implemented, returns the address as the given index. + /// </summary> IAddress GetAddress(int index); + /// <summary> + /// When implemented, removes an address from the list. + /// </summary> void Remove(IAddress iaddress); + /// <summary> + /// When implemented, removes the address at a given index from the list. + /// </summary> void RemoveAt(int index); } } Index: IEncode.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IEncode.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IEncode.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IEncode.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,17 +10,45 @@ namespace CSMail { + /// <summary> + /// Interface for retrieving encoding or decoding data. + /// </summary> public interface IEncode { + /// <summary> + /// When implemented, returns the content type associated. + /// </summary> string ContentType { get; } /** * I think, I should replace them with a stream (reader) */ + /// <summary> + /// When implemented, returns the decoded data (as should be + /// visible to the end user). + /// </summary> + /// <remarks> + /// I guess, I should replace <code>string</code> with + /// <code>StreamReader</code> + /// </remarks> string DecodedData { get; } + /// <summary> + /// When implemented, returns the encoded data (as should be + /// available for transferring over the network). + /// </summary> + /// <remarks> + /// I guess, I should replace <code>string</code> with + /// <code>StreamReader</code> + /// </remarks> string EncodedData { get; } + /// <summary> + /// When implemented, gets or sets the transfer encoding scheme. + /// </summary> TransferEncoding TransferEncoding { get; set; } + /// <summary> + /// When implemented, gets or sets the content disposition. + /// </summary> ContentDisposition ContentDisposition { get; set; } } } Index: IMimePart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IMimePart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IMimePart.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IMimePart.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,13 +10,37 @@ namespace CSMail { + /// <summary> + /// Interface to handle "Mime" encoded messages. + /// </summary> public interface IMimePart: IPart { + /// <summary> + /// When implemented, gets or sets the content id associated. + /// </summary> string ContentID { get; set; } + /// <summary> + /// When implemented, gets or sets the content language associated. + /// </summary> string ContentLanguage { get; set; } + /// <summary> + /// When implemented, gets or sets the content-MD5 associated. + /// </summary> string ContentMD5 { get; set; } + //HeaderList Headers { get; set; } + /// <summary> + /// When implemented, gets or sets the actual text. + /// </summary> + /// <remarks> + /// Since the actual text may be very long, I think it should + /// better be replaced by either a <code>StreamReader</code> + /// or a simple <code>byte[]</code>. + /// </remarks> string Text { get; set; } + /// <summary> + /// When implemented, gets or sets the transfer encoding scheme. + /// </summary> TransferEncoding TransferEncoding { get; set; } } } Index: IPart.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/IPart.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IPart.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ IPart.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -13,18 +13,55 @@ namespace CSMail { + /// <summary> + /// Interface to the parts of a message. + /// </summary> public interface IPart { + /// <summary> + /// When implemented, gets or sets the content of the part. + /// </summary> Multipart Content { get; set; } + /// <summary> + /// When implemented, gets or sets the content type of the part. + /// </summary> ContentType ContentType { get; set; } + /// <summary> + /// When implemented, gets or sets the description for this part. + /// </summary> string Description { get; set; } + /// <summary> + /// When implemented, gets or sets the content disposition. + /// </summary> ContentDisposition Disposition { get; set; } + /// <summary> + /// When implemented, gets or sets the filename associated. + /// </summary> string Filename { get; set; } + /// <summary> + /// When implemented, gets or sets the headers. + /// </summary> HeaderList Headers { get; set; } + /// <summary> + /// When implemented, gets or sets the size of the part. + /// </summary> int Size { get; set; } - + + /// <summary> + /// When implemented, adds a header to the part. + /// </summary> int AddHeader(Header header); + /// <summary> + /// When implemented, adds headers to the part. + /// </summary> int AddHeaders(HeaderList headers); + /// <summary> + /// When implemented, writes the content. + /// </summary> + /// <remarks> + /// Should <code>TextWriter</code> be replaced by + /// <code>StreamWriter</code>? + /// </remarks> void Write(TextWriter writer); } } Index: MessageSortStyle.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/MessageSortStyle.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessageSortStyle.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ MessageSortStyle.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,12 +10,30 @@ namespace CSMail { + /// <summary> + /// The criterion for sorting messages (for viewing). + /// </summary> public enum MessageSortStyle { + /// <summary> + /// Use the implementation defaults. + /// </summary> Default, + /// <summary> + /// Sort using "From" header (alphabetically). + /// </summary> From, + /// <summary> + /// Sort using the size of the message. + /// </summary> Size, + /// <summary> + /// Sort by date (which - arrival or sent?) + /// </summary> Date, + /// <summary> + /// Sort by the subject (alphabetically) + /// </summary> Subject } } Index: TransferEncoding.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/TransferEncoding.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TransferEncoding.cs 20 Jun 2002 02:43:25 -0000 1.1 +++ TransferEncoding.cs 5 Sep 2002 05:17:49 -0000 1.2 @@ -10,15 +10,42 @@ namespace CSMail { + /// <summary> + /// The "Transfer-Encoding" values. + /// </summary> public enum TransferEncoding { + /// <summary> + /// Default encoding. + /// </summary> Default, + /// <summary> + /// Encoded using "7-bit" encoding scheme. + /// </summary> Bit7, + /// <summary> + /// Encoded using "8-bit" encoding scheme. + /// </summary> Bit8, + /// <summary> + /// Encoded using "quoted-printable" scheme. + /// </summary> QuotedPrintable, + /// <summary> + /// Encoded using "base64" scheme. + /// </summary> Base64, + /// <summary> + /// Encoded using "binary" scheme. + /// </summary> Binary, + /// <summary> + /// The content is uuencode-d. + /// </summary> UUEncode, + /// <summary> + /// Any used defined encoding method. + /// </summary> UserDefined } } Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- ChangeLog 4 Sep 2002 09:59:18 -0000 1.28 +++ ChangeLog 5 Sep 2002 05:17:49 -0000 1.29 @@ -1,6 +1,21 @@ 2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * ContentDisposition.cs, + * ContentType.cs, + * EMailAddress.cs, + * FolderOpenMode.cs, + * IAddress.cs, + * IAddressList.cs, + * IEncode.cs, + * IMimePart.cs, + * IPart.cs, + * MessageSortStyle.cs, + * TransferEncoding.cs + : On documentation spree. + +2002-09-04 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * AddressType.cs, * ConnectionEventType.cs, * FolderEventType.cs, |