2011-03-07 20:15:16 +01:00
|
|
|
/* MAPIStoreFAIMessageTable.m - this file is part of SOGo
|
|
|
|
*
|
2012-08-17 21:04:57 +02:00
|
|
|
* Copyright (C) 2011-2012 Inverse inc
|
2011-03-07 20:15:16 +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)
|
2011-03-07 20:15:16 +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
|
|
|
#import <Foundation/NSArray.h>
|
|
|
|
|
2011-07-12 23:34:07 +02:00
|
|
|
#import "MAPIStoreFAIMessage.h"
|
2011-06-07 02:17:46 +02:00
|
|
|
#import "MAPIStoreFolder.h"
|
|
|
|
|
2011-03-07 20:15:16 +01:00
|
|
|
#import "MAPIStoreFAIMessageTable.h"
|
|
|
|
|
|
|
|
#undef DEBUG
|
2011-11-09 16:02:29 +01:00
|
|
|
#include <talloc.h>
|
|
|
|
#include <util/time.h>
|
2011-03-07 20:15:16 +01:00
|
|
|
#include <mapistore/mapistore.h>
|
|
|
|
|
2011-07-12 23:34:07 +02:00
|
|
|
static Class MAPIStoreFAIMessageK = Nil;
|
|
|
|
|
2011-03-07 20:15:16 +01:00
|
|
|
@implementation MAPIStoreFAIMessageTable
|
|
|
|
|
2011-07-12 23:34:07 +02:00
|
|
|
+ (void) initialize
|
|
|
|
{
|
|
|
|
MAPIStoreFAIMessageK = [MAPIStoreFAIMessage class];
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (Class) childObjectClass
|
|
|
|
{
|
|
|
|
return MAPIStoreFAIMessageK;
|
|
|
|
}
|
|
|
|
|
2011-03-07 20:15:16 +01:00
|
|
|
- (id) init
|
|
|
|
{
|
|
|
|
if ((self = [super init]))
|
|
|
|
{
|
|
|
|
tableType = MAPISTORE_FAI_TABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2011-06-07 02:17:46 +02:00
|
|
|
- (NSArray *) childKeys
|
|
|
|
{
|
2011-07-26 22:13:10 +02:00
|
|
|
if (!childKeys)
|
|
|
|
{
|
|
|
|
childKeys = [(MAPIStoreFolder *)
|
|
|
|
container faiMessageKeysMatchingQualifier: nil
|
|
|
|
andSortOrderings: sortOrderings];
|
|
|
|
[childKeys retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
return childKeys;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray *) restrictedChildKeys
|
|
|
|
{
|
|
|
|
NSArray *keys;
|
|
|
|
|
|
|
|
if (!restrictedChildKeys)
|
|
|
|
{
|
|
|
|
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
|
|
|
|
{
|
|
|
|
if (restrictionState == MAPIRestrictionStateNeedsEval)
|
|
|
|
keys = [(MAPIStoreFolder *)
|
|
|
|
container faiMessageKeysMatchingQualifier: restriction
|
|
|
|
andSortOrderings: sortOrderings];
|
|
|
|
else
|
|
|
|
keys = [NSArray array];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
keys = [self childKeys];
|
|
|
|
|
|
|
|
ASSIGN (restrictedChildKeys, keys);
|
|
|
|
}
|
|
|
|
|
|
|
|
return restrictedChildKeys;
|
2011-06-07 02:17:46 +02:00
|
|
|
}
|
|
|
|
|
2011-07-26 21:06:55 +02:00
|
|
|
- (id) lookupChild: (NSString *) childKey
|
|
|
|
{
|
|
|
|
return [(MAPIStoreFolder *) container lookupFAIMessage: childKey];
|
|
|
|
}
|
|
|
|
|
2011-03-07 20:15:16 +01:00
|
|
|
@end
|