2011-02-24 21:40:07 +01:00
|
|
|
/* MAPIStoreAttachmentTable.m - this file is part of SOGo
|
2010-12-30 15:29:40 +01:00
|
|
|
*
|
2012-08-17 21:04:57 +02:00
|
|
|
* Copyright (C) 2011-2012 Inverse inc
|
2010-12-30 15:29:40 +01:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@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
|
2011-08-12 17:02:01 +02:00
|
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
2010-12-30 15:29:40 +01:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2011-07-26 22:13:10 +02:00
|
|
|
|
2011-07-26 21:06:55 +02:00
|
|
|
|
2010-12-30 15:29:40 +01:00
|
|
|
|
2011-02-24 21:40:07 +01:00
|
|
|
@implementation MAPIStoreAttachmentTable
|
2010-12-30 15:29:40 +01:00
|
|
|
|
2011-07-26 22:13:10 +02:00
|
|
|
- (NSArray *) childKeys
|
|
|
|
{
|
|
|
|
if (!childKeys)
|
|
|
|
{
|
|
|
|
childKeys = [(MAPIStoreMessage *)
|
|
|
|
container attachmentKeysMatchingQualifier: nil
|
|
|
|
andSortOrderings: sortOrderings];
|
|
|
|
[childKeys retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return childKeys;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) restrictedChildKeys
|
|
|
|
{
|
|
|
|
NSArray *keys;
|
|
|
|
|
|
|
|
if (!restrictedChildKeys)
|
|
|
|
{
|
|
|
|
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
|
|
|
|
{
|
|
|
|
if (restrictionState == MAPIRestrictionStateNeedsEval)
|
|
|
|
keys = [(MAPIStoreMessage *)
|
|
|
|
container attachmentKeysMatchingQualifier: restriction
|
|
|
|
andSortOrderings: sortOrderings];
|
|
|
|
else
|
|
|
|
keys = [NSArray array];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
keys = [self childKeys];
|
|
|
|
|
|
|
|
ASSIGN (restrictedChildKeys, keys);
|
|
|
|
}
|
|
|
|
|
|
|
|
return restrictedChildKeys;
|
|
|
|
}
|
|
|
|
|
2011-07-26 21:06:55 +02:00
|
|
|
- (id) lookupChild: (NSString *) childKey
|
|
|
|
{
|
|
|
|
return [(MAPIStoreMessage *) container lookupAttachment: childKey];
|
|
|
|
}
|
|
|
|
|
2010-12-30 15:29:40 +01:00
|
|
|
@end
|