2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include "NGImap4FolderFlags.h"
25 @implementation NGImap4FolderFlags
27 - (id)initWithFlagArray:(NSArray *)_array {
28 if ((self = [super init])) {
29 self->flags = [_array copy];
31 // TODO: this is pretty weird
32 self->listFlags.noselect = [self->flags containsObject:@"noselect"];
33 self->listFlags.noinferiors = [self->flags containsObject:@"noinferiors"];
34 self->listFlags.nonexistent = [self->flags containsObject:@"nonexistent"];
35 self->listFlags.haschildren = [self->flags containsObject:@"haschildren"];
36 self->listFlags.marked = [self->flags containsObject:@"marked"];
37 self->listFlags.unmarked = [self->flags containsObject:@"unmarked"];
39 self->listFlags.hasnochildren =
40 [self->flags containsObject:@"hasnochildren"];
45 return [self initWithFlagArray:nil];
49 [self->flags release];
55 - (NSArray *)flagArray {
59 - (BOOL)doNotSelectFolder {
60 return self->listFlags.noselect ? YES : NO;
62 - (BOOL)doesNotSupportSubfolders {
63 return self->listFlags.noinferiors ? YES : NO;
65 - (BOOL)doesNotExist {
66 return self->listFlags.nonexistent ? YES : NO;
68 - (BOOL)hasSubfolders {
69 return self->listFlags.haschildren ? YES : NO;
71 - (BOOL)hasNoSubfolders {
72 return self->listFlags.hasnochildren ? YES : NO;
75 return self->listFlags.marked ? YES : NO;
78 return self->listFlags.unmarked ? YES : NO;
83 - (void)allowFolderSelect {
87 self->listFlags.noselect = NO;
90 ma = [tmp mutableCopy];
91 [ma removeObject:@"noselect"];
92 self->flags = [ma copy];
96 @end /* NGImap4FolderFlags */