linphone::MagicSearch Class Reference

A MagicSearch is used to do specifics searchs. More...

`#include <magic_search.hh>`

Inheritance diagram for linphone::MagicSearch:

## Public Types

enum class | Aggregation { None = 0 , Friend = 1 }
| Enum describing how to merge SearchResult from MagicSearch. More...
enum class | Source { None = 0 , Friends = 1<<0 , CallLogs = 1<<1 , LdapServers = 1<<2 , ChatRooms = 1<<3 , Request = 1<<4 , FavoriteFriends = 1<<5 , ConferencesInfo = 1<<6 , All = -1 }
| Enum describing the search categories for Magic Search. More...

## Public Member Functions

LINPHONECXX_PUBLIC | MagicSearch (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneMagicSearch * | cPtr ()
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< MagicSearchListener > &listener)
| Add an application listener to the MagicSearch instance.
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< MagicSearchListener > &listener)
| Remove a previously added listener from the MagicSearch instance.
LINPHONECXX_PUBLIC std::string | getDelimiter () const
| Get the delimiter used for the search.
LINPHONECXX_PUBLIC void | setDelimiter (const std::string &delimiter)
| Set the delimiter used to find matched filter word.
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::SearchResult > > | getLastSearch () const
LINPHONECXX_PUBLIC bool | getLimitedSearch () const
| Return whether or not the search is limited.
LINPHONECXX_PUBLIC void | setLimitedSearch (bool limited)
| Enable or disable the limited search.
LINPHONECXX_PUBLIC unsigned int | getMaxWeight () const
| Get the maximum value used to calculate the weight in search.
LINPHONECXX_PUBLIC void | setMaxWeight (unsigned int weight)
| Set the maximum value used to calculate the weight in search.
LINPHONECXX_PUBLIC unsigned int | getMinWeight () const
| Get the minimum value used to calculate the weight in search.
LINPHONECXX_PUBLIC void | setMinWeight (unsigned int weight)
| Set the minimum value used to calculate the weight in search.
LINPHONECXX_PUBLIC unsigned int | getSearchLimit () const
| Get the number of maximum search result the search will return.
LINPHONECXX_PUBLIC void | setSearchLimit (unsigned int limit)
| Set the number of the maximum SearchResult which will be returned.
LINPHONECXX_PUBLIC bool | getUseDelimiter ()
| Returns whether the delimiter is being used for the search.
LINPHONECXX_PUBLIC void | setUseDelimiter (bool enable)
| Enable or disable the delimiter in search.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list< std::shared_ptr< linphone::SearchResult > > | getContactListFromFilter (const std::string &filter, const std::string &domain)
| Create a sorted list of SearchResult from SipUri, Contact name, Contact displayname, Contact phone number, which match with a filter word The last item list will be an address formed with "filter" if a proxy config exist During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void | getContactListFromFilterAsync (const std::string &filter, const std::string &domain)
| Create a sorted list of SearchResult asynchronous from SipUri, Contact name, Contact displayname, Contact phone number, which match with a filter word The last item list will be an address formed with "filter" if a proxy config exist During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list< std::shared_ptr< linphone::SearchResult > > | getContacts (const std::string &filter, const std::string &domain, int sourceFlags)
| Create a sorted list of SearchResult which match with a filter word, from SipUri in this order : Contact's display name, address username, address domain and phone number.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void | getContactsAsync (const std::string &filter, const std::string &domain, int sourceFlags)
| This is the asynchronous version of getContacts().
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::SearchResult > > | getContactsList (const std::string &filter, const std::string &domain, int sourceFlags, Aggregation aggregation)
| Create a sorted list of SearchResult which match with a filter word, from SipUri in this order : Contact's display name, address username, address domain and phone number.
LINPHONECXX_PUBLIC void | getContactsListAsync (const std::string &filter, const std::string &domain, int sourceFlags, Aggregation aggregation)
| This is the asynchronous version of getContacts().
LINPHONECXX_PUBLIC void | resetSearchCache ()
| Reset the cache to begin a new search.

## Detailed Description

A MagicSearch is used to do specifics searchs.

## Member Enumeration Documentation

## Aggregation

enum class linphone::MagicSearch::Aggregation

strong

Enum describing how to merge SearchResult from MagicSearch.

Enumerator
None | No aggregation is done, you can have multiple SearchResult with the same Friend.
Friend | Aggregation is done by friend, you will have at most a SearchResult per Friend.

## Source

enum class linphone::MagicSearch::Source

strong

Enum describing the search categories for Magic Search.

Enumerator
None | no Source specified.
Friends | Search in friends only.
CallLogs | Search in Call Logs.
LdapServers | Search in LDAP servers.
ChatRooms | Search in Chat rooms participants.
Request | Search from request : it is usually an address built from the request.
FavoriteFriends | Search in "starred" friends only.
ConferencesInfo | Search in conferences info (organizer and participants).
All | Search in all sources.

## Member Function Documentation

## addListener()

LINPHONECXX_PUBLIC void linphone::MagicSearch::addListener | ( | const std::shared_ptr< MagicSearchListener > & | listener | ) |

Add an application listener to the MagicSearch instance.

Parameters

  listener | the application listener

## getContactListFromFilter()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list< std::shared_ptr< linphone::SearchResult > > linphone::MagicSearch::getContactListFromFilter | ( | const std::string & | filter,
|  | const std::string & | domain )

Create a sorted list of SearchResult from SipUri, Contact name, Contact displayname, Contact phone number, which match with a filter word The last item list will be an address formed with "filter" if a proxy config exist During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search.

Parameters

  filter | word we search
  domain | domain which we want to search only

Returns
  sorted list of

Deprecated
  22/03/2022 Use getContacts() instead.

## getContactListFromFilterAsync()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void linphone::MagicSearch::getContactListFromFilterAsync | ( | const std::string & | filter,
|  | const std::string & | domain )

Create a sorted list of SearchResult asynchronous from SipUri, Contact name, Contact displayname, Contact phone number, which match with a filter word The last item list will be an address formed with "filter" if a proxy config exist During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search.

Parameters

  filter | word we search
  domain | domain which we want to search only nullptr or "" for searching in all contact "*" for searching in contact with sip SipUri "yourdomain" for searching in contact from "yourdomain" domain

Deprecated
  22/03/2022 Use getContactsAsync() instead.

## getContacts()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list< std::shared_ptr< linphone::SearchResult > > linphone::MagicSearch::getContacts | ( | const std::string & | filter,
|  | const std::string & | domain,
|  | int | sourceFlags )

Create a sorted list of SearchResult which match with a filter word, from SipUri in this order : Contact's display name, address username, address domain and phone number.

The last item list will be an address formed with "filter" if a proxy config exist and requested in sourceFlags During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search

Parameters

  filter | word we search
  domain | domain which we want to search only
  sourceFlags | Flags that specify where to search : Source

Returns
  sorted list of

Deprecated
  08/04/2022 Use getContactsList() instead.

## getContactsAsync()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void linphone::MagicSearch::getContactsAsync | ( | const std::string & | filter,
|  | const std::string & | domain,
|  | int | sourceFlags )

This is the asynchronous version of getContacts().

Create a sorted list of SearchResult which match with a filter word, from SipUri in this order : Contact's display name, address username, address domain and phone number. The last item list will be an address formed with "filter" if a proxy config exist and requested in sourceFlags During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search

Parameters

  filter | word we search
  domain | domain which we want to search only
  sourceFlags | Flags that specify where to search : Source

Deprecated
  08/04/2022 Use getContactsListAsync() instead.

## getContactsList()

LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::SearchResult > > linphone::MagicSearch::getContactsList | ( | const std::string & | filter,
|  | const std::string & | domain,
|  | int | sourceFlags,
|  | Aggregation | aggregation )

Create a sorted list of SearchResult which match with a filter word, from SipUri in this order : Contact's display name, address username, address domain and phone number.

The last item list will be an address formed with "filter" if a proxy config exist and requested in sourceFlags During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search

Parameters

  filter | word we search
  domain | domain which we want to search only
  sourceFlags | Flags that specify where to search : Source
  aggregation | a Aggregation mode to indicate how to merge results

Returns
  sorted list of

## getContactsListAsync()

LINPHONECXX_PUBLIC void linphone::MagicSearch::getContactsListAsync | ( | const std::string & | filter,
|  | const std::string & | domain,
|  | int | sourceFlags,
|  | Aggregation | aggregation )

This is the asynchronous version of getContacts().

Create a sorted list of SearchResult which match with a filter word, from SipUri in this order : Contact's display name, address username, address domain and phone number. The last item list will be an address formed with "filter" if a proxy config exist and requested in sourceFlags During the first search, a cache is created and used for the next search Use resetSearchCache() to begin a new search

Parameters

  filter | word we search
  domain | domain which we want to search only
  sourceFlags | Flags that specify where to search : Source
  aggregation | a Aggregation mode to indicate how to merge results

## getDelimiter()

LINPHONECXX_PUBLIC std::string linphone::MagicSearch::getDelimiter | ( |  | ) | const

Get the delimiter used for the search.

Returns
  the delimiter used to find matched filter word

## getLastSearch()

LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::SearchResult > > linphone::MagicSearch::getLastSearch | ( |  | ) | const

Returns
  sorted list of

## getLimitedSearch()

LINPHONECXX_PUBLIC bool linphone::MagicSearch::getLimitedSearch | ( |  | ) | const

Return whether or not the search is limited.

Returns
  true if the search is limited, false otherwise

## getMaxWeight()

LINPHONECXX_PUBLIC unsigned int linphone::MagicSearch::getMaxWeight | ( |  | ) | const

Get the maximum value used to calculate the weight in search.

Returns
  the maximum value used to calculate the weight in search

## getMinWeight()

LINPHONECXX_PUBLIC unsigned int linphone::MagicSearch::getMinWeight | ( |  | ) | const

Get the minimum value used to calculate the weight in search.

Returns
  the minimum value used to calculate the weight in search

## getSearchLimit()

LINPHONECXX_PUBLIC unsigned int linphone::MagicSearch::getSearchLimit | ( |  | ) | const

Get the number of maximum search result the search will return.

Returns
  the number of the maximum SearchResult which will be returned

## getUseDelimiter()

LINPHONECXX_PUBLIC bool linphone::MagicSearch::getUseDelimiter | ( |  | ) |

Returns whether the delimiter is being used for the search.

Returns
  if the delimiter search is used

## removeListener()

LINPHONECXX_PUBLIC void linphone::MagicSearch::removeListener | ( | const std::shared_ptr< MagicSearchListener > & | listener | ) |

Remove a previously added listener from the MagicSearch instance.

Parameters

  listener | the application listener

## setDelimiter()

LINPHONECXX_PUBLIC void linphone::MagicSearch::setDelimiter | ( | const std::string & | delimiter | ) |

Set the delimiter used to find matched filter word.

Parameters

  delimiter | delimiter (example "-_.,")

## setLimitedSearch()

LINPHONECXX_PUBLIC void linphone::MagicSearch::setLimitedSearch | ( | bool | limited | ) |

Enable or disable the limited search.

Parameters

  limited | true to limit the search, false otherwise

## setMaxWeight()

LINPHONECXX_PUBLIC void linphone::MagicSearch::setMaxWeight | ( | unsigned int | weight | ) |

Set the maximum value used to calculate the weight in search.

Parameters

  weight | maximum weight

## setMinWeight()

LINPHONECXX_PUBLIC void linphone::MagicSearch::setMinWeight | ( | unsigned int | weight | ) |

Set the minimum value used to calculate the weight in search.

Parameters

  weight | minimum weight

## setSearchLimit()

LINPHONECXX_PUBLIC void linphone::MagicSearch::setSearchLimit | ( | unsigned int | limit | ) |

Set the number of the maximum SearchResult which will be returned.

Parameters

  limit | the maximum number of SearchResult the search will return

## setUseDelimiter()

LINPHONECXX_PUBLIC void linphone::MagicSearch::setUseDelimiter | ( | bool | enable | ) |

Enable or disable the delimiter in search.

Parameters

  enable | true to use the delimiter, false otherwise

The documentation for this class was generated from the following file:

- magic_search.hh