2009-09-25 16:42:33 +02:00
|
|
|
/* SOGoSource.h - this file is part of SOGo
|
|
|
|
*
|
2012-01-12 21:01:34 +01:00
|
|
|
* Copyright (C) 2009-2012 Inverse inc.
|
2009-09-25 16:42:33 +02:00
|
|
|
*
|
|
|
|
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
|
|
|
|
*
|
|
|
|
* This file is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SOGOSOURCE_H
|
|
|
|
#define SOGOSOURCE_H
|
|
|
|
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
2010-03-08 16:18:05 +01:00
|
|
|
#import "SOGoConstants.h"
|
|
|
|
|
2009-09-25 16:42:33 +02:00
|
|
|
@class NSDictionary;
|
2011-12-30 21:39:07 +01:00
|
|
|
@class NSException;
|
2009-09-25 16:42:33 +02:00
|
|
|
@class NSString;
|
|
|
|
|
2011-12-30 21:39:07 +01:00
|
|
|
@protocol SOGoSource <NSObject>
|
2009-09-25 16:42:33 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
+ (id) sourceFromUDSource: (NSDictionary *) udSource
|
|
|
|
inDomain: (NSString *) domain;
|
2009-09-25 16:42:33 +02:00
|
|
|
|
2009-11-29 05:19:32 +01:00
|
|
|
- (id) initFromUDSource: (NSDictionary *) udSource
|
|
|
|
inDomain: (NSString *) domain;
|
|
|
|
|
|
|
|
- (NSString *) domain;
|
2009-09-25 16:42:33 +02:00
|
|
|
|
2012-01-04 16:26:30 +01:00
|
|
|
/* requires a "." to obtain the full list of contacts */
|
|
|
|
- (void) setListRequiresDot: (BOOL) aBool;
|
|
|
|
- (BOOL) listRequiresDot;
|
|
|
|
|
2010-03-08 16:18:05 +01:00
|
|
|
- (BOOL) checkLogin: (NSString *) _login
|
|
|
|
password: (NSString *) _pwd
|
|
|
|
perr: (SOGoPasswordPolicyError *) _perr
|
|
|
|
expire: (int *) _expire
|
|
|
|
grace: (int *) _grace;
|
|
|
|
|
|
|
|
- (BOOL) changePasswordForLogin: (NSString *) login
|
|
|
|
oldPassword: (NSString *) oldPassword
|
|
|
|
newPassword: (NSString *) newPassword
|
|
|
|
perr: (SOGoPasswordPolicyError *) perr;
|
2009-09-25 16:42:33 +02:00
|
|
|
|
|
|
|
- (NSDictionary *) lookupContactEntry: (NSString *) theID;
|
2012-02-11 08:08:02 +01:00
|
|
|
- (NSDictionary *) lookupContactEntryWithUIDorEmail: (NSString *) entryID
|
|
|
|
inDomain: (NSString *) domain;
|
2009-09-25 16:42:33 +02:00
|
|
|
|
|
|
|
- (NSArray *) allEntryIDs;
|
2012-02-11 08:08:02 +01:00
|
|
|
- (NSArray *) fetchContactsMatching: (NSString *) filter
|
|
|
|
inDomain: (NSString *) domain;
|
2012-01-04 16:26:30 +01:00
|
|
|
|
|
|
|
- (void) setSourceID: (NSString *) newSourceID;
|
2009-09-25 16:42:33 +02:00
|
|
|
- (NSString *) sourceID;
|
|
|
|
|
2012-01-04 16:26:30 +01:00
|
|
|
- (void) setDisplayName: (NSString *) newDisplayName;
|
|
|
|
- (NSString *) displayName;
|
|
|
|
|
|
|
|
- (void) setModifiers: (NSArray *) newModifiers;
|
2011-12-30 21:39:07 +01:00
|
|
|
- (NSArray *) modifiers;
|
|
|
|
|
2012-01-04 16:26:30 +01:00
|
|
|
- (BOOL) hasUserAddressBooks;
|
|
|
|
- (NSArray *) addressBookSourcesForUser: (NSString *) user;
|
|
|
|
|
2011-12-30 21:39:07 +01:00
|
|
|
- (NSException *) addContactEntry: (NSDictionary *) roLdifRecord
|
|
|
|
withID: (NSString *) aId;
|
|
|
|
- (NSException *) updateContactEntry: (NSDictionary *) ldifRecord;
|
|
|
|
- (NSException *) removeContactEntryWithID: (NSString *) aId;
|
2009-09-25 16:42:33 +02:00
|
|
|
|
2012-01-04 16:26:30 +01:00
|
|
|
/* user address books */
|
|
|
|
- (NSArray *) addressBookSourcesForUser: (NSString *) user;
|
|
|
|
|
|
|
|
- (NSException *) addAddressBookSource: (NSString *) newId
|
|
|
|
withDisplayName: (NSString *) newDisplayName
|
|
|
|
forUser: (NSString *) user;
|
|
|
|
- (NSException *) renameAddressBookSource: (NSString *) newId
|
|
|
|
withDisplayName: (NSString *) newDisplayName
|
|
|
|
forUser: (NSString *) user;
|
|
|
|
- (NSException *) removeAddressBookSource: (NSString *) newId
|
|
|
|
forUser: (NSString *) user;
|
|
|
|
|
2009-09-25 16:42:33 +02:00
|
|
|
@end
|
|
|
|
|
2009-12-02 21:55:13 +01:00
|
|
|
@protocol SOGoDNSource <SOGoSource>
|
|
|
|
|
2010-12-14 19:08:36 +01:00
|
|
|
- (void) setBindDN: (NSString *) theDN;
|
2012-01-12 21:01:34 +01:00
|
|
|
- (NSString *) bindDN;
|
2010-12-14 19:08:36 +01:00
|
|
|
- (void) setBindPassword: (NSString *) thePassword;
|
2012-01-12 21:01:34 +01:00
|
|
|
- (NSString *) bindPassword;
|
2010-12-14 19:08:36 +01:00
|
|
|
- (BOOL) bindAsCurrentUser;
|
|
|
|
|
2009-12-02 21:55:13 +01:00
|
|
|
- (NSString *) lookupLoginByDN: (NSString *) theDN;
|
2010-12-14 19:08:36 +01:00
|
|
|
- (NSString *) lookupDNByLogin: (NSString *) theLogin;
|
|
|
|
|
2009-12-02 21:55:13 +01:00
|
|
|
- (NSString *) baseDN;
|
2012-01-12 21:01:34 +01:00
|
|
|
- (NSString *) MSExchangeHostname;
|
2009-12-02 21:55:13 +01:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2009-09-25 16:42:33 +02:00
|
|
|
#endif /* SOGOSOURCE_H */
|