/*
 
 Owner: stefan@boinx.com
 Company: Boinx Software Ltd., Germany
 
 Abstract: Holds the data, that was collected from both panes of feedback assistant. Handles communication with the Boinx Server, included error handling.
 
 
 Related:	Protocols and abstract superclasses:
			BXAssistantController.h
			BXAssistantSession.h
			BXAssistantPaneProviderProtocol.h
			BXAssistantPaneProvider.h
			BXAssistantPaneProtocoll.h
 
			classes used in that Assistant:
			BXFeedbackAssistantPaneProvider.h
			BXFeedbackStep0AssistantPane.h
			BXFeedbackStep1AssistantPane.h
 
 Documentation : Documentation/feedback_assistant.html
 
 */

#import "BXAssistantSession.h"


extern NSString *const BXFeedbackSessionTypeIssueReport;
extern NSString *const BXFeedbackSessionTypeFeatureRequest;
extern NSString *const BXFeedbackSessionTypeGeneralComment;
extern NSString *const BXFeedbackSessionTypeSupportFollowUp;
extern NSString *const BXFeedbackSessionTypeCrashReport;


@interface BXFeedbackSession : BXAssistantSession {

	// personal information
	NSString *_email;
	NSString *_firstName;
	NSString *_lastName;
	NSString *_company;
	
	// user given feedback
	NSString *_feedbackType;  // answer 1
	NSString *_answer2;
	NSString *_answer3;
	NSString *_answer4;
	NSString *_answer5;
	NSString *_answer6;
	NSString *_answer7;
	NSString *_answer8;
	NSString *_answer9;
	NSString *_answer10;
	
	// automatic given feedback
	NSString *_licenseKey;			// answer 11
	NSString *_correspondenceNumber;	// answer 12
	NSString *_zipFileURLString;			// answer 13
	NSString *_application;			// answer 14
	NSString *_version;				// together with application in answer 14
	NSString *_systemProfiler;		// answer 16
	NSString *_quickTimeVersion;	// answer 16
	NSString *_bxLog;				// answer 17
	NSString *_consoleLog;			// answer 18
	NSString *_crashLog;			// answer 19
	NSString *_osVersion;			// answer 20
	
	// values set in UI
	BOOL _systemProfile;	// insert System Profiler info in answer 16
	BOOL _sendFiles;		// upload different log files to our FTP server
	BOOL _useLicenseKey;	// use licenseKey to identify person in support
	BOOL _useAddressBoook;	// use AddressBooks me-person to get contact information
	BOOL _addBoinx;			// addBoinx V-Card to AddressBook
	BOOL _identifyUser;		// validate entries in address fields (can be empty too)
	BOOL _sendLogs;			// only some feedback types will send bx log, console log and crash log
	
	NSString *_currentLicenseKey;	// keeps license key
	NSArray *_assistantConfiguration;   // keeps config info for view stacking in both panes
	
	BOOL _alreadyNaggedForComment;
}


#pragma mark -
#pragma mark form action

- (BOOL)sendFormWithError:(NSError **)ioError forced:(BOOL)inForced;
- (NSDictionary *)generateFormDataDictionary;


#pragma mark -
#pragma mark Validation of data

- (BOOL)validateFirstNameWithError:(NSError **)ioError;
- (BOOL)validateLastNameWithError:(NSError **)ioError;
- (BOOL)validateMailAddressWithError:(NSError **)ioError;
- (BOOL)validateOptionalMailAddressWithError:(NSError **)ioError;
- (BOOL)validateActionPerformedWithError:(NSError **)ioError;
- (BOOL)validateWhatHappendWithError:(NSError **)ioError;
- (BOOL)validateWhatExpectedWithError:(NSError **)ioError;
- (BOOL)validateCameraTypeWithError:(NSError **)ioError;
- (BOOL)validateCameraModelWithError:(NSError **)ioError;
- (BOOL)validateFeatureImportanceWithError:(NSError **)ioError;
- (BOOL)validateCommentFieldForFeedbackTypeWithError:(NSError **)ioError;
- (BOOL)validateCorrespondenceNumberWithError:(NSError **)ioError;


#pragma mark -
#pragma mark accessors

- (NSString *) email;
- (void) setEmail: (NSString *) inEmail;

- (NSString *) firstName;
- (void) setFirstName: (NSString *) inFirstName;

- (NSString *) lastName;
- (void) setLastName: (NSString *) inLastName;

- (NSString *) company;
- (void) setCompany: (NSString *) inCompany;

- (NSString *) feedbackType;
- (void) setFeedbackType: (NSString *) inFeedbackType;

- (NSString *) answer2;
- (void) setAnswer2: (NSString *) inAnswer2;

- (NSString *) answer3;
- (void) setAnswer3: (NSString *) inAnswer3;

- (NSString *) answer4;
- (void) setAnswer4: (NSString *) inAnswer4;

- (NSString *) answer5;
- (void) setAnswer5: (NSString *) inAnswer5;

- (NSString *) answer6;
- (void) setAnswer6: (NSString *) inAnswer6;

- (NSString *) answer7;
- (void) setAnswer7: (NSString *) inAnswer7;

- (NSString *) answer8;
- (void) setAnswer8: (NSString *) inAnswer8;

- (NSString *) answer9;
- (void) setAnswer9: (NSString *) inAnswer9;

- (NSString *) answer10;
- (void) setAnswer10: (NSString *) inAnswer10;

- (NSString *) licenseKey;
- (void) setLicenseKey: (NSString *) inLicenseKey;

- (NSString *) correspondenceNumber;
- (void) setCorrespondenceNumber: (NSString *) inCorrespondenceNumber;

- (NSString *) zipFileURLString;
- (void) setZipFileURLString: (NSString *) inZipFileURLString;

- (NSString *) application;
- (void) setApplication: (NSString *) inApplication;

- (NSString *) version;
- (void) setVersion: (NSString *) inVersion;

- (NSString *) systemProfiler;
- (void) setSystemProfiler: (NSString *) inSystemProfiler;

- (NSString *) quickTimeVersion;
- (void) setQuickTimeVersion: (NSString *) inQuickTimeVersion;

- (NSString *) bxLog;
- (void) setBxLog: (NSString *) inBxLog;

- (NSString *) consoleLog;
- (void)setConsoleLog: (NSString *) inConsoleLog;

- (NSString *) crashLog;
- (void)setCrashLog: (NSString *) inCrashLog;

- (NSString *) osVersion;
- (void) setOsVersion: (NSString *) inOsVersion;

- (BOOL) systemProfile;
- (void)setSystemProfile: (BOOL) inSystemProfile;

- (BOOL) sendFiles;
- (void)setSendFiles: (BOOL) inSendFiles;

- (BOOL) useLicenseKey;
- (void)setUseLicenseKey: (BOOL) inUseLicenseKey;

- (BOOL) useAddressBook;
- (void)setUseAddressBook: (BOOL) inUseAddressBook;

- (BOOL) addBoinx;
- (void)setAddBoinx: (BOOL) inAddBoinx;

- (BOOL) identifyUser;
- (void)setIdentfiyUser: (BOOL) inIdentifyUser;

- (BOOL) sendLogs;
- (void) setSendLogs: (BOOL) inSendLogs;

- (NSArray *)assistantConfiguration;
- (void)setAssistantConfiguration:(NSArray *)inAssistantConfiguration;

- (NSString *)currentLicenseKey;
- (void)setCurrentLicenseKey:(NSString *)inCurrentLicenseKey;


@end
