~pvigo/+junk/owncloud-14.04

« back to all changes in this revision

Viewing changes to share/owncloud/lib/public/iaddressbook.php

  • Committer: Pablo Vigo
  • Date: 2014-12-15 13:36:46 UTC
  • Revision ID: pvigo@xtec.cat-20141215133646-7d6it90e1dbsijc2
2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * ownCloud
 
4
 *
 
5
 * @author Thomas Müller
 
6
 * @copyright 2012 Thomas Müller thomas.mueller@tmit.eu
 
7
 *
 
8
 * This library is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 3 of the License, or any later version.
 
12
 *
 
13
 * This library is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Affero General Public
 
19
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
20
 *
 
21
 */
 
22
 
 
23
/**
 
24
 * Public interface of ownCloud for apps to use.
 
25
 * IAddressBook interface
 
26
 */
 
27
 
 
28
// use OCP namespace for all classes that are considered public.
 
29
// This means that they should be used by apps instead of the internal ownCloud classes
 
30
namespace OCP {
 
31
        interface IAddressBook {
 
32
 
 
33
                /**
 
34
                 * @return string defining the technical unique key
 
35
                 */
 
36
                public function getKey();
 
37
 
 
38
                /**
 
39
                 * In comparison to getKey() this function returns a human readable (maybe translated) name
 
40
                 * @return mixed
 
41
                 */
 
42
                public function getDisplayName();
 
43
 
 
44
                /**
 
45
                 * @param string $pattern which should match within the $searchProperties
 
46
                 * @param array $searchProperties defines the properties within the query pattern should match
 
47
                 * @param array $options - for future use. One should always have options!
 
48
                 * @return array of contacts which are arrays of key-value-pairs
 
49
                 */
 
50
                public function search($pattern, $searchProperties, $options);
 
51
                //      // dummy results
 
52
                //      return array(
 
53
                //              array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'),
 
54
                //              array('id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => array('d@e.f', 'g@h.i')),
 
55
                //      );
 
56
 
 
57
                /**
 
58
                 * @param array $properties this array if key-value-pairs defines a contact
 
59
                 * @return array representing the contact just created or updated
 
60
                 */
 
61
                public function createOrUpdate($properties);
 
62
                //      // dummy
 
63
                //      return array('id'    => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c',
 
64
                //                   'PHOTO' => 'VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif',
 
65
                //                   'ADR'   => ';;123 Main Street;Any Town;CA;91921-1234'
 
66
                //      );
 
67
 
 
68
                /**
 
69
                 * @return mixed
 
70
                 */
 
71
                public function getPermissions();
 
72
 
 
73
                /**
 
74
                 * @param object $id the unique identifier to a contact
 
75
                 * @return bool successful or not
 
76
                 */
 
77
                public function delete($id);
 
78
        }
 
79
}