//
//  MCTaskProtocol.h
//  MCFoundation
//
//  Created by aj on Sat Sep 08 2001.
//  Copyright (c) 2001 Marketcircle Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol MCTask <NSObject>

/*
- (NSCalendarDate *)completeDate; 
- (void)setCompleteDate:(NSCalendarDate *)aValue;
- (int)indexNumber; 
- (void)setIndexNumber:(int)aValue; 
- (NSCalendarDate *)createDate;
- (void)setCreateDate:(NSCalendarDate *)aValue;
- (NSCalendarDate *)modifyDate; 
- (void)setModifyDate:(NSCalendarDate *)aValue; 
- (int)statusCode;
- (void)setStatusCode:(int)aValue;

- (int)resultCode;
- (void)setResultCode:(int)aValue;
- (NSString *)displayHint;
- (void)setDisplayHint:(NSString *)aValue;
- (NSString *)title;    
- (void)setTitle:(NSString *)aValue;
- (NSString *)details;    
- (void)setDetails:(NSString *)aValue;


- (id)owner;
- (void)setOwner:(id)aValue;
- (id <MCTask>)parentTask;
- (void)setParentTask:(id <MCTask>)aValue;    
- (id)workitemDefinition; 
- (void)setWorkitemDefinition:(id)aValue; 
- (id <MCTask>)rootTask; 
- (void)setRootTask:(id <MCTask>)aValue;

- (NSArray *)subTasks; 
- (void)setSubTasks:(NSMutableArray *)aValue;
- (void)addToSubTasks:(id <MCTask>)object;
- (void)removeFromSubTasks:(id <MCTask>)object;


- (void)reIndexSubTasks;
- (void)reIndexSubTasksAccordingToWorkitemDefinition;
- (NSArray *)indexSortedSubTasks;
- (BOOL)isWorkitemDefinitionSet;


//        Return true if this task or any sub task is completed.
- (BOOL)isAnyTaskCompleted;


//        Checks to see if all Tasks (including subTasks) are completed, returns false on the first failure.
- (BOOL)areAllTasksCompleted;


//        Calls canChangeToState() to see whether the state can be changed, if yes then it proceed to set the state and if inform is true tells the parent about it. 
- (BOOL)changeStateAndInformParent:(int)aState :(BOOL)inform;

- (void)recursivelyAssignOwner:(id)newOwner;

*/
@end
