Aspose::Email::Tools::Search::MailQuery Class Reference

Represents the search criteria, that are used to match several message properties in the mailbox. More...

Inherits IEquatable< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery > >.

Inherited by Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxMailQuery.

Public Member Functions

virtual System::String get_QueryString ()
 The query string. More...
 
virtual void set_QueryString (System::String value)
 The query string. More...
 
System::String get_OrderByString () const
 The sort query string. More...
 
virtual System::SharedPtr< System::Collections::Generic::Dictionary< System::String, System::SharedPtr< System::Object > > > get_Options ()
 The query options. More...
 
virtual void set_Options (System::SharedPtr< System::Collections::Generic::Dictionary< System::String, System::SharedPtr< System::Object >>> value)
 The query options. More...
 
 MailQuery (System::String queryString)
 Initializes a new instance of the MailQuery class. More...
 
 MailQuery (System::String queryString, System::String orderByString)
 Initializes a new instance of the MailQuery class. More...
 
 MailQuery ()
 Initializes a new instance of the MailQuery class. More...
 
 MailQuery (System::String queryString, bool validate)
 Initializes a new instance of the MailQuery class. More...
 
 MailQuery (System::String queryString, System::String orderByString, bool validate)
 Initializes a new instance of the MailQuery class. More...
 
 MailQuery (System::String queryString, System::String orderByString, System::SharedPtr< System::Collections::Generic::Dictionary< System::String, System::SharedPtr< System::Object >>> options, bool validate)
 
 MailQuery (System::String fieldName, System::String value, System::String comparsionOperator)
 Initializes a new instance of the MailQuery class. More...
 
 MailQuery (System::String fieldName, System::String value, System::String comparsionOperator, System::String parameters)
 Initializes a new instance of the MailQuery class. More...
 
System::SharedPtr< System::Xml::Schema::XmlSchema > GetSchema ()
 This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the T:System::Xml::Serialization::XmlSchemaProviderAttribute to the class. More...
 
virtual void ReadXml (System::SharedPtr< System::Xml::XmlReader > reader)
 Generates an object from its XML representation. More...
 
virtual void WriteXml (System::SharedPtr< System::Xml::XmlWriter > writer)
 Converts an object into its XML representation. More...
 
virtual void WriteOrderByXml (System::SharedPtr< System::Xml::XmlWriter > writer)
 Converts an object into its XML representation. More...
 
bool Equals (System::SharedPtr< MailQuery > other) override
 Indicates whether the current object is equal to another object of the same type. More...
 
int32_t GetHashCode () const override
 Returns a hash code for this instance. More...
 
bool Equals (System::SharedPtr< System::Object > obj) override
 Determines whether the specified System::Object, is equal to this instance. More...
 
System::String ToString () const override
 Returns a System::String that represents this instance. More...
 

Static Public Member Functions

static bool ValidateExpression (System::String expression)
 Validates the expression. More...
 
static System::String NormalizeExpression (System::String expression)
 Normalizes the expression. More...
 

Protected Member Functions

virtual ~MailQuery ()
 

Friends

class Aspose::Email::Tools::Search::ComparisonField
 
class Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxMailQuery
 
class Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxQueryBuilder
 
class Aspose::Email::Tools::Search::MailQueryBuilder
 
class Aspose::Email::Clients::Exchange::ExchangeQueryBuilder
 
class Aspose::Email::Clients::Exchange::WebService::Extensions::MailQueryExtensions
 
class Aspose::Email::Clients::Exchange::WebService::Implementation::Items::List::Helpers::ListItemsProcessor
 
class Aspose::Email::Clients::Graph::V1::Commands::ListMessagesWithPagingCommand
 
class Aspose::Email::Clients::Imap::ESearchOptions
 
class Aspose::Email::Clients::Imap::ImapQueryBuilder
 
class Aspose::Email::Clients::Imap::ModificationSequenceField
 
class Aspose::Email::Clients::Imap::SequenceSetField
 
class Aspose::Email::Storage::Pst::PersonalStorageQueryBuilder
 
class Aspose::Email::Storage::Pst::PstDoer
 
class Aspose::Email::Tools::Search::EnumComparisonField
 
class Aspose::Email::Tools::Search::StringComparisonField
 

Detailed Description

Represents the search criteria, that are used to match several message properties in the mailbox.

Constructor & Destructor Documentation

◆ MailQuery() [1/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  queryString)

Initializes a new instance of the MailQuery class.

The query string should have the following view.

The example of a simple expression:

'<Field name>' <Comparison operator> '<Field value>',

where <Field Name> - the name of a message field through which filtering is made, <Comparison operator> - comparison operators, as their name implies, allow to compare message field and specified value, <Field value> - value to be compared with a message field.

The number of simple expressions can make a compound one, ex.: (<Simple expression 1> & <Simple expression 2>) | <Simple expression 3>,

where "&amp;" - logical-AND operator, "|" - logical-OR operator

At present the following values are allowed as a field name (<Field name>):

"To" - represents a TO field of message, "Text" - represents string in the header or body of the message, "Bcc" - represents a BCC field of message, "Body" - represents a string in the body of message, "Cc" - represents a CC field of message, "From" - represents a From field of message, "Subject" - represents a string in the subject of message, "InternalDate" - represents an internal date of message, "SentDate" - represents a sent date of message

Additionally, the following field names are allowed for IMAP-protocol:

"Answered" - represents an /Answered flag of message "Seen" - represents a /Seen flag of message "Flagged" - represents a /Flagged flag of message "Draft" - represents a /Draft flag of message "Deleted" - represents a Deleted/ flag of message "Recent" - represents a Deleted/ flag of message "MessageSize" - represents a size (in bytes) of message

Additionally, the following field names are allowed for Exchange:

"IsRead" - Indicates whether the message has been read "HasAttachment" - Indicates whether or not the message has attachments "IsSubmitted" - Indicates whether the message has been submitted to the Outbox "ContentClass" - represents a content class of item

Additionally, the following field names are allowed for pst/ost files:

"MessageClass" - Represents a message class "ContainerClass" - Represents a folder container class "Importance" - Represents a message importance "MessageSize" - represents a size (in bytes) of message "FolderName" - represents a folder name "ContentsCount" - represents a total number of items in the folder "UnreadContentsCount" - represents the number of unread items in the folder. "Subfolders" - Indicates whether or not the folder has subfolders "Read" - the message is marked as having been read "HasAttachment" - the message has at least one attachment "Unsent" - the message is still being composed "Unmodified" - the message has not been modified since it was first saved (if unsent) or it was delivered (if sent) "FromMe" - the user receiving the message was also the user who sent the message "Resend" - the message includes a request for a resend operation with a non-delivery report "NotifyRead" - the user who sent the message has requested notification when a recipient first reads it "NotifyUnread" - the user who sent the message has requested notification when a recipient deletes it before reading or the Message object expires "EverRead" - the message has been read at least once

The field value (<Field value>) can take the following values: For text fields - any string, For date type fields - the string of "d-MMM-yyy" format, ex. "10-Feb-2009", For flags (fields of boolean type) - either "True", or "False"

MailQuery mailQuery = new MailQuery("(('From' Contains 'test@test.com' | 'Seen' = 'True') &amp; 'SentDate' >= '12-May-2010')");
Parameters
queryStringThe query string.

◆ MailQuery() [2/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  queryString,
System::String  orderByString 
)

Initializes a new instance of the MailQuery class.

The sort query string should have the following view.

The example of a simple expression:

'<Field name>' OrderBy ['ASC'|'DESC'],

where <Field Name> - the name of a message field through which sorting is made, ['ASC'|'DESC'] - sorting operators, allow to sort Ascending or Descending,

The number of simple expressions can make a compound one, ex.: (<Simple expression 1> & <Simple expression 2>),

MailQuery mailQuery = new MailQuery("", "(('From' OrderBy 'ASC') &amp; ('SentDate' OrderBy 'DESC'))");

◆ MailQuery() [3/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( )

Initializes a new instance of the MailQuery class.

◆ MailQuery() [4/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  queryString,
bool  validate 
)

Initializes a new instance of the MailQuery class.

Parameters
queryStringThe query string.
validateIf true, then query string must be validate.

◆ MailQuery() [5/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  queryString,
System::String  orderByString,
bool  validate 
)

Initializes a new instance of the MailQuery class.

Parameters
queryStringThe query string.
orderByStringThe sort query string.
validateIf true, then query string must be validate.

◆ MailQuery() [6/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  queryString,
System::String  orderByString,
System::SharedPtr< System::Collections::Generic::Dictionary< System::String, System::SharedPtr< System::Object >>>  options,
bool  validate 
)

◆ MailQuery() [7/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  fieldName,
System::String  value,
System::String  comparsionOperator 
)

Initializes a new instance of the MailQuery class.

Parameters
fieldNameName of the field.
valueThe value.
comparsionOperatorThe comparsion operator.

◆ MailQuery() [8/8]

Aspose::Email::Tools::Search::MailQuery::MailQuery ( System::String  fieldName,
System::String  value,
System::String  comparsionOperator,
System::String  parameters 
)

Initializes a new instance of the MailQuery class.

Parameters
fieldNameName of the field.
valueThe value.
comparsionOperatorThe comparsion operator.
parametersParameters.

◆ ~MailQuery()

virtual Aspose::Email::Tools::Search::MailQuery::~MailQuery ( )
protectedvirtual

Member Function Documentation

◆ Equals() [1/2]

bool Aspose::Email::Tools::Search::MailQuery::Equals ( System::SharedPtr< MailQuery other)
override

Indicates whether the current object is equal to another object of the same type.

Parameters
otherAn object to compare with this object.
Returns
true if the current object is equal to the other parameter; otherwise, false.

◆ Equals() [2/2]

bool Aspose::Email::Tools::Search::MailQuery::Equals ( System::SharedPtr< System::Object >  obj)
override

Determines whether the specified System::Object, is equal to this instance.

Parameters
objThe System::Object to compare with this instance.
Returns
true if the specified System::Object is equal to this instance; otherwise, false.

◆ get_Options()

virtual System::SharedPtr<System::Collections::Generic::Dictionary<System::String, System::SharedPtr<System::Object> > > Aspose::Email::Tools::Search::MailQuery::get_Options ( )
virtual

The query options.

◆ get_OrderByString()

System::String Aspose::Email::Tools::Search::MailQuery::get_OrderByString ( ) const

The sort query string.

◆ get_QueryString()

virtual System::String Aspose::Email::Tools::Search::MailQuery::get_QueryString ( )
virtual

◆ GetHashCode()

int32_t Aspose::Email::Tools::Search::MailQuery::GetHashCode ( ) const
override

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ GetSchema()

System::SharedPtr<System::Xml::Schema::XmlSchema> Aspose::Email::Tools::Search::MailQuery::GetSchema ( )

This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the T:System::Xml::Serialization::XmlSchemaProviderAttribute to the class.

Returns
An T:System::Xml::Schema::XmlSchema that describes the XML representation of the object that is produced by the M:System::Xml::Serialization::IXmlSerializable::WriteXml(System::Xml::XmlWriter) method and consumed by the M:System::Xml::Serialization::IXmlSerializable::ReadXml(System::Xml::XmlReader) method.

◆ NormalizeExpression()

static System::String Aspose::Email::Tools::Search::MailQuery::NormalizeExpression ( System::String  expression)
static

Normalizes the expression.

Parameters
expressionThe expression.
Returns
Normalized expression.

◆ ReadXml()

virtual void Aspose::Email::Tools::Search::MailQuery::ReadXml ( System::SharedPtr< System::Xml::XmlReader >  reader)
virtual

Generates an object from its XML representation.

Parameters
readerThe T:System::Xml::XmlReader stream from which the object is deserialized.

Reimplemented in Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxMailQuery.

◆ set_Options()

virtual void Aspose::Email::Tools::Search::MailQuery::set_Options ( System::SharedPtr< System::Collections::Generic::Dictionary< System::String, System::SharedPtr< System::Object >>>  value)
virtual

The query options.

◆ set_QueryString()

virtual void Aspose::Email::Tools::Search::MailQuery::set_QueryString ( System::String  value)
virtual

◆ ToString()

System::String Aspose::Email::Tools::Search::MailQuery::ToString ( ) const
override

Returns a System::String that represents this instance.

Returns
A query string that represents this instance.

◆ ValidateExpression()

static bool Aspose::Email::Tools::Search::MailQuery::ValidateExpression ( System::String  expression)
static

Validates the expression.

Parameters
expressionThe expression.
Returns
true, if expression is correct.

◆ WriteOrderByXml()

virtual void Aspose::Email::Tools::Search::MailQuery::WriteOrderByXml ( System::SharedPtr< System::Xml::XmlWriter >  writer)
virtual

Converts an object into its XML representation.

Parameters
writerThe T:System::Xml::XmlWriter stream to which the object is serialized.

◆ WriteXml()

virtual void Aspose::Email::Tools::Search::MailQuery::WriteXml ( System::SharedPtr< System::Xml::XmlWriter >  writer)
virtual

Converts an object into its XML representation.

Parameters
writerThe T:System::Xml::XmlWriter stream to which the object is serialized.

Reimplemented in Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxMailQuery.

Friends And Related Function Documentation

◆ Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxMailQuery

◆ Aspose::Email::Clients::Exchange::ExchangeAdvancedSyntaxQueryBuilder

◆ Aspose::Email::Clients::Exchange::ExchangeQueryBuilder

◆ Aspose::Email::Clients::Exchange::WebService::Extensions::MailQueryExtensions

friend class Aspose::Email::Clients::Exchange::WebService::Extensions::MailQueryExtensions
friend

◆ Aspose::Email::Clients::Exchange::WebService::Implementation::Items::List::Helpers::ListItemsProcessor

friend class Aspose::Email::Clients::Exchange::WebService::Implementation::Items::List::Helpers::ListItemsProcessor
friend

◆ Aspose::Email::Clients::Graph::V1::Commands::ListMessagesWithPagingCommand

friend class Aspose::Email::Clients::Graph::V1::Commands::ListMessagesWithPagingCommand
friend

◆ Aspose::Email::Clients::Imap::ESearchOptions

◆ Aspose::Email::Clients::Imap::ImapQueryBuilder

◆ Aspose::Email::Clients::Imap::ModificationSequenceField

◆ Aspose::Email::Clients::Imap::SequenceSetField

◆ Aspose::Email::Storage::Pst::PersonalStorageQueryBuilder

◆ Aspose::Email::Storage::Pst::PstDoer

friend class Aspose::Email::Storage::Pst::PstDoer
friend

◆ Aspose::Email::Tools::Search::ComparisonField

◆ Aspose::Email::Tools::Search::EnumComparisonField

◆ Aspose::Email::Tools::Search::MailQueryBuilder

◆ Aspose::Email::Tools::Search::StringComparisonField

MailQuery()
Initializes a new instance of the MailQuery class.