1<?php
2/***********************************************
3* File      :   isearchprovider.php
4* Project   :   Z-Push
5* Descr     :   The ISearchProvider interface for searching
6*               functionalities on the mobile.
7*
8* Created   :   02.01.2012
9*
10* Copyright 2007 - 2016 Zarafa Deutschland GmbH
11*
12* This program is free software: you can redistribute it and/or modify
13* it under the terms of the GNU Affero General Public License, version 3,
14* as published by the Free Software Foundation.
15*
16* This program is distributed in the hope that it will be useful,
17* but WITHOUT ANY WARRANTY; without even the implied warranty of
18* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19* GNU Affero General Public License for more details.
20*
21* You should have received a copy of the GNU Affero General Public License
22* along with this program.  If not, see <http://www.gnu.org/licenses/>.
23*
24* Consult LICENSE file for details
25************************************************/
26
27interface ISearchProvider {
28    const SEARCH_GAL = "GAL";
29    const SEARCH_MAILBOX = "MAILBOX";
30    const SEARCH_DOCUMENTLIBRARY = "DOCUMENTLIBRARY";
31
32    /**
33     * Constructor
34     *
35     * @throws StatusException, FatalException
36     */
37
38    /**
39     * Indicates if a search type is supported by this SearchProvider
40     * Currently only the type SEARCH_GAL (Global Address List) is implemented
41     *
42     * @param string        $searchtype
43     *
44     * @access public
45     * @return boolean
46     */
47    public function SupportsType($searchtype);
48
49    /**
50     * Searches the GAL.
51     *
52     * @param string                        $searchquery        string to be searched for
53     * @param string                        $searchrange        specified searchrange
54     * @param SyncResolveRecipientsPicture  $searchpicture      limitations for picture
55     *
56     * @access public
57     * @return array        search results
58     * @throws StatusException
59     */
60    public function GetGALSearchResults($searchquery, $searchrange, $searchpicture);
61
62    /**
63    * Searches for the emails on the server
64    *
65    * @param ContentParameter $cpo
66    *
67    * @return array
68    */
69    public function GetMailboxSearchResults($cpo);
70
71    /**
72    * Terminates a search for a given PID
73    *
74    * @param int $pid
75    *
76    * @return boolean
77    */
78    public function TerminateSearch($pid);
79
80
81    /**
82     * Disconnects from the current search provider
83     *
84     * @access public
85     * @return boolean
86     */
87    public function Disconnect();
88}
89