/*
 *     Generated by class-dump 3.1.2.
 *
 *     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard.
 */

struct _NSRange {
    unsigned int _field1;
    unsigned int _field2;
};

struct __CFArray;

struct __CFDictionary;

struct __CFString;

typedef struct {
    unsigned int _field1;
    unsigned int _field2;
} CDAnonymousStruct1;

/*
 * File: /Users/natetrue/shared/114/System/Library/Frameworks/VisualVoicemail.framework/IMAP.vvservice/IMAP
 */

@interface IMAPService : VVService
{
    IMAPServiceAccount *_account;
    IMAPServiceActivityController *_activityController;
    IMAPServiceBodyLoadMonitor *_bodyLoadMonitor;
    NSRecursiveLock *_greetingLock;
    unsigned int _greetingDuration;
    int _greetingType;
    NSString *_parametersFilePath;
    NSMutableDictionary *_imapParameters;
    double _nextBeaconTime;
    unsigned int _beaconCount;
    InvocationQueue *_messageChangeQueue;
    NSMutableSet *_pendingDeletes;
    NSRecursiveLock *_pendingDeletesLock;
    NSMutableArray *_addedRecords;
    struct {
        unsigned int syncInProgress:1;
        unsigned int syncRequired:1;
        unsigned int greetingTypeRead:1;
        unsigned int greetingCached:2;
        unsigned int accountState:3;
        unsigned int initializing:1;
        unsigned int parametersDirty:1;
        unsigned int coalesceSyncs:1;
        unsigned int registrationChanges:1;
        unsigned int previouslyNotActivated:1;
        unsigned int smscAvailable:1;
        unsigned int registeredForSMSCAvailability:1;
    } _imapServiceFlags;
}

- (id)init;
- (void)dealloc;
- (void)updateLoggingSettings;
- (void)setSubscribed:(BOOL)fp8;
- (void)_storeChangedExternally:(id)fp8;
- (void)_setAccountValue:(id)fp8 forKey:(struct __CFString *)fp12 inDictionary:(id *)fp16 ifDifferentInDictionary:(id)fp20;
- (id)mailboxName;
- (void)_setServerInfoFromInterpretedNotification:(id)fp8;
- (void)setOnline:(BOOL)fp8;
- (long)dataContextIdentifier;
- (void)handleDataContextDeactivated;
- (void)_offlineOperationQueued:(id)fp8;
- (void)_handleSMSCAvailable;
- (void)_setBeaconCount:(unsigned int)fp8;
- (unsigned int)_beaconCount;
- (void)_cancelBeacon;
- (void)_startBeacon;
- (void)setMailboxRequiresSetup:(BOOL)fp8;
- (BOOL)sharedSubscriptionRequiresSetup;
- (void)_setAccountState:(int)fp8;
- (void)_inferActiveState;
- (void)_setMessageWaitingFromNotification:(id)fp8;
- (BOOL)respectsMWINotifications;
- (void)handleNotification:(id)fp8 isMWI:(BOOL)fp12;
- (void)_checkForQueuedNotifications;
- (id)_messageChangeQueue;
- (int)maximumGreetingDuration;
- (int)minimumPasswordLength;
- (int)maximumPasswordLength;
- (BOOL)passwordChangeRequiresEnteringOldPassword;
- (BOOL)taskOfTypeExists:(int)fp8;
- (BOOL)dataForRecordPending:(void *)fp8 progressiveLoadInProgress:(char *)fp12;
- (BOOL)greetingFetchExistsProgressiveLoadInProgress:(char *)fp8;
- (void)progressiveDataLengthsForRecord:(void *)fp8 expected:(unsigned int *)fp12 current:(unsigned int *)fp16;
- (void)_updateMailboxUsage;
- (void)_mailboxUsageUpdateCompletedWithError:(id)fp8;
- (void)_recordsExpunged:(id)fp8;
- (void)_synchronizeMailboxWithRelativePath:(id)fp8;
- (void)_synchronize;
- (void)_messagesAddedCompleted;
- (void)_resetLegacyMessageWaiting;
- (void)_syncCompletedWithError:(id)fp8;
- (void)_recordsAddedDuringSync:(id)fp8;
- (void)synchronize:(BOOL)fp8;
- (id)_bodyLoadMonitor;
- (void)_synchronouslyRetrieveBody:(id)fp8;
- (void)_synchronouslyRetrieveBodyForRecord:(void *)fp8;
- (void)_bodyRetrievalCompleted:(void *)fp8;
- (void)_cacheBodies:(id)fp8;
- (void)_retrieveSingleRecordBody:(void *)fp8;
- (void)_retrieveSingleTransferredRecordBody:(void *)fp8;
- (void)retrieveDataForRecord:(void *)fp8;
- (void)_removeRecordsNotPendingDelete:(struct __CFArray *)fp8;
- (void)_addPendingDeleteForRecord:(void *)fp8;
- (void)_removePendingDeleteForRecord:(void *)fp8;
- (void)_transferRecord:(void *)fp8 toMailbox:(id)fp12 setTrashFlag:(BOOL)fp16;
- (void)moveRecordToTrash:(void *)fp8;
- (void)moveRecordFromTrash:(void *)fp8;
- (void)_synchronouslyPushFlags:(id)fp8;
- (void)_flagsWillChange:(id)fp8;
- (void)_flagsDidChange:(id)fp8;
- (void)_flagsChanged:(id)fp8;
- (void)_synchronouslySetDefaultGreeting;
- (void)_synchronouslySetCustomGreetingWithData:(id)fp8 duration:(id)fp12;
- (void)messageWriter:(id)fp8 willEncodeHeaders:(id)fp12 forMimePart:(id)fp16;
- (void)setGreetingType:(int)fp8 withData:(id)fp12 duration:(unsigned int)fp16;
- (id)_candidateGreetingMessage;
- (BOOL)greetingAvailable;
- (void)_setGreetingCached:(BOOL)fp8;
- (void)retrieveGreeting;
- (id)_parametersFilePath;
- (id)_parameters;
- (void)_reallySaveParameters;
- (void)_saveParameters;
- (int)mailboxGreetingType;
- (void)_setActiveGreetingType:(int)fp8;
- (void)changePassword:(id)fp8 fromPassword:(id)fp12;

@end

@interface IMAPServiceAccount : IMAPAccount
{
    IMAPService *_service;
    NSString *_mailboxCachePath;
    NSString *_offlineCachePath;
    double _idleTimeout;
    NSTimer *_idleTimer;
    NSRecursiveLock *_idleLock;
    double _nextIdleFire;
    unsigned int _checkInForcefully:1;
}

- (id)init;
- (void)dealloc;
- (Class)storeClass;
- (Class)storeClassForMailbox:(id)fp8;
- (id)storeForMailboxUid:(id)fp8;
- (id)mailboxUidForRelativePath:(id)fp8 create:(BOOL)fp12;
- (Class)connectionClass;
- (void)setService:(id)fp8;
- (id)service;
- (id)path;
- (long)dataContextIdentifier;
- (id)offlineCacheDirectoryPath;
- (BOOL)requiresDataForOfflineTransfersFromStore:(id)fp8;
- (id)_mailboxCachePath;
- (void)setupLibrary;
- (BOOL)allowsPartialDownloads;
- (id)mimeBodyForRecord:(void *)fp8;
- (void)prepareForFlagChange;
- (void)completeFlagChange;
- (void)willSetFlags:(int)fp8 state:(int)fp12 forRecord:(void *)fp16 needToBeStored:(BOOL)fp20;
- (void)storeFlags:(int)fp8 forRecord:(void *)fp12 usingMessage:(id)fp16;
- (void)storeFlags:(int)fp8 forRecord:(void *)fp12;
- (void)transferRecord:(void *)fp8 usingDestinationRecord:(void *)fp12;
- (void *)createNewRecordFromRecord:(void *)fp8 destinedForMailbox:(id)fp12;
- (void)changePIN:(id)fp8;
- (float)mailboxUsage;
- (unsigned int)uidValidityForMailbox:(id)fp8;
- (void)setUidValidity:(unsigned int)fp8 forMailbox:(id)fp12;
- (void)getMailboxListIfNecessaryWithConnection:(id)fp8;
- (void)refreshMailboxListingRootedAtUid:(id)fp8;
- (unsigned int)readBufferSize;
- (void)setConnectionIdleTimeout:(double)fp8;
- (void)_disconnectIdleConnections:(id)fp8;
- (void)_scheduleIdleTimer;
- (void)_startIdleTimer;
- (void)releaseAllConnections;
- (id)connectionForStore:(id)fp8 delegate:(id)fp12 options:(int)fp16;
- (void)checkInConnectionsPolitelyForStore:(id)fp8;
- (void)checkInConnectionsForStore:(id)fp8;
- (void)checkInConnection:(id)fp8;
- (void)_clearConnectionCheckOuts;
- (void)libraryIMAPStore:(id)fp8 bodyDownloadBeganForUid:(unsigned long)fp12 data:(id)fp16;
- (void)libraryIMAPStore:(id)fp8 bodyDownloadReceivedMoreDataForUid:(unsigned long)fp12 data:(id)fp16;
- (void)libraryIMAPStore:(id)fp8 bodyDownloadCompletedForUid:(unsigned long)fp12 data:(id)fp16;

@end

@interface IMAPServiceConnection (IMAPServiceAccountUtils)
- (void)checkInToAccount:(id)fp8;
@end

@interface IMAPServiceLibrary : MessageLibrary
{
    IMAPServiceAccount *_account;
    LibraryStore *_sharedGenericStore;
}

- (id)initWithServiceAccount:(id)fp8;
- (void)dealloc;
- (id)_mailboxUidForStoreRecord:(void *)fp8;
- (id)_messageWithStoreRecord:(void *)fp8 localStore:(BOOL)fp12;
- (id)messageWithStoreRecord:(void *)fp8;
- (void *)copyStoreRecordForMessage:(id)fp8;
- (id)messageWithLibraryID:(unsigned int)fp8;
- (id)messageWithLibraryID:(unsigned int)fp8 options:(unsigned int)fp12;
- (id)messageWithMessageID:(id)fp8;
- (id)messageWithMessageID:(id)fp8 inMailbox:(id)fp12;
- (id)messagesWithMessageIDHeader:(id)fp8;
- (void)sendMessagesMatchingCriterion:(id)fp8 to:(id)fp12 options:(unsigned int)fp16 range:(struct _NSRange)fp20;
- (id)messagesForMailbox:(id)fp8 olderThanNumberOfDays:(int)fp12;
- (id)messagesWithSummariesForMailbox:(id)fp8 range:(struct _NSRange)fp12;
- (unsigned int)unreadCountForMailbox:(id)fp8;
- (unsigned int)deletedCountForMailbox:(id)fp8;
- (unsigned int)nonDeletedCountForMailbox:(id)fp8;
- (unsigned int)totalCountForMailbox:(id)fp8;
- (id)oldestMessageInMailbox:(id)fp8;
- (id)messageWithRemoteID:(id)fp8 inRemoteMailbox:(id)fp12;
- (unsigned int)maximumRemoteIDForMailbox:(id)fp8;
- (unsigned int)minimumRemoteIDForMailbox:(id)fp8;
- (id)getDetailsForMessagesWithRemoteIDInRange:(struct _NSRange)fp8 fromMailbox:(id)fp16;
- (void)_resetCountsForCompaction;
- (void)compactMailbox:(id)fp8;
- (void)compactMessages:(id)fp8 permanently:(BOOL)fp12;
- (id)mailboxUidForMessage:(id)fp8;
- (id)addMessages:(id)fp8 withMailbox:(id)fp12 fetchBodies:(BOOL)fp16 newMessagesByOldMessage:(id)fp20 remoteIDs:(id)fp24 setFlags:(unsigned long long)fp28 clearFlags:(unsigned long long)fp36 messageFlagsForMessages:(id)fp44 copyFiles:(BOOL)fp48 progressDelegate:(id)fp52 addPOPUIDs:(BOOL)fp56 dataByMessage:(id)fp60;
- (void)_postMessagesAdded:(id)fp8;
- (BOOL)isMessageContentsLocallyAvailable:(id)fp8;
- (void)setFlagsForMessages:(id)fp8 mask:(unsigned long)fp12;
- (id)setFlagsFromDictionary:(id)fp8 forMessages:(id)fp12;
- (void)setFlags:(unsigned long)fp8 forMessage:(id)fp12;
- (void)_setFlags:(unsigned long)fp8 forMessage:(id)fp12 postAndCommit:(BOOL)fp16;

@end

@interface NSString (RFC2303Utils)
- (id)pstnAddress;
@end

@interface IMAPServiceStore : LibraryIMAPStore
{
    struct {
        unsigned int settingLocalValidity:1;
    } _imapServiceStoreFlags;
}

+ (id)cachedStoreForMailboxUid:(id)fp8;
+ (void)removeCachedStore:(id)fp8;
+ (void)addCachedStore:(id)fp8;
- (id)initWithMailboxUid:(id)fp8 readOnly:(BOOL)fp12;
- (void)dealloc;
- (void)setMailboxUidValidity:(unsigned int)fp8;
- (void)updateDeletedCount;
- (void)messagesAdded:(id)fp8;
- (unsigned int)connectionBodyDataReadChunkSize:(id)fp8;
- (void)doCompact;
- (BOOL)shouldRetryEmptyBodyDownloadForMessage:(id)fp8;

@end

@interface IMAPServiceActivityController : NSObject
{
    struct __CFDictionary *_activeActivities;
    IMAPService *_service;
    NSMutableSet *_inProcessRecords;
}

+ (int)currentTaskType;
+ (void)setRemainingBodyRetries:(unsigned int)fp8;
+ (unsigned int)remainingBodyRetries;
- (id)initForService:(id)fp8;
- (void)dealloc;
- (BOOL)taskOfTypeExists:(int)fp8;
- (id)bodyFetchActivityForRecord:(void *)fp8;
- (BOOL)bodyFetchPendingForRecord:(void *)fp8;
- (void)_postNotificationName:(id)fp8 userInfo:(id)fp12;
- (void)_activityStarted:(id)fp8;
- (void)_activityEnded:(id)fp8;
- (void)_primaryTargetChanged:(id)fp8;
- (void)_targetsAdded:(id)fp8;

@end

@interface MFError (VoicemailErrorMappings)
- (id)vvError;
@end

@interface ActivityMonitor (VoicemailActivityMappings)
- (int)voicemailTaskType;
@end

@interface IMAPServiceBodyLoadContext : NSObject
{
    NSDictionary *_headersDict;
    ProgressiveMimeParser *_parser;
    int _recordLibraryId;
    int _fd;
    unsigned int _lastOffset;
    unsigned int _lengthWritten;
    unsigned int _expectedLength;
    NSMutableDictionary *_notificationDict;
    IMAPService *_service;
    unsigned int _base64:1;
}

- (void)dealloc;
- (void)cleanUpErroredFile;
- (void)writeDataIfNeeded;
- (void)_postNotification:(id)fp8 withLengthNumber:(id)fp12;
- (BOOL)loadHasStarted;
- (void)setExpectedLength:(unsigned int)fp8;
- (unsigned int)expectedLength;
- (unsigned int)currentOffset;

@end

@interface IMAPServiceBodyLoadMonitor : NSObject
{
    IMAPService *_service;
    struct __CFDictionary *_loadContextsByLibraryId;
}

+ (id)_headersToPreserve;
- (id)initForService:(id)fp8;
- (void)dealloc;
- (int)_libraryIdForRemoteUid:(unsigned long)fp8 inStore:(id)fp12;
- (id)_createHeaderDictionaryForData:(id)fp8;
- (void)_activityCompleted:(id)fp8;
- (void)bodyLoadStartedForRemoteUid:(unsigned long)fp8 inStore:(id)fp12 data:(id)fp16;
- (void)bodyLoadContinuedForRemoteUid:(unsigned long)fp8 inStore:(id)fp12 data:(id)fp16;
- (void)bodyLoadEndedForRemoteUid:(unsigned long)fp8 inStore:(id)fp12 data:(id)fp16;
- (BOOL)progressiveBodyLoadHasStartedForRecord:(void *)fp8;
- (void)lengthsOfBodyLoadForRecord:(void *)fp8 expected:(unsigned int *)fp12 current:(unsigned int *)fp16;
- (void)progressiveMimeParser:(id)fp8 beganDataForMimePart:(id)fp12;
- (void)progressiveMimeParser:(id)fp8 finishedMimePart:(id)fp12;
- (void)_postDataAvailableWithUserInfo:(id)fp8;
- (void)progressiveMimeParser:(id)fp8 failedWithError:(id)fp12;

@end

@interface IMAPServiceConnection : IMAPConnection
{
    NSMutableSet *_checkedOutThreads;
    NSRecursiveLock *_delegateLock;
}

+ (id)heldConnectionsForCheckingIn;
- (id)init;
- (void)dealloc;
- (id)_headersToFetchIncludingThoseRequiredForRouting:(BOOL)fp8 withRecipients:(BOOL)fp12;
- (BOOL)changePassword:(id)fp8;
- (BOOL)checkIn;
- (void)checkInForcefully;
- (void)setDelegate:(id)fp8;

@end

@interface IMAPServiceLibraryMessage : LibraryMessage
{
    NSString *_messageIDHeader;
}

- (void)dealloc;
- (void)setMessageIDHeader:(id)fp8;
- (id)messageIDHeader;

@end

@interface IMAPServiceGreetingLibrary : MessageLibrary
{
    NSMutableArray *_messages;
}

- (void)dealloc;
- (id)addMessages:(id)fp8 withMailbox:(id)fp12 fetchBodies:(BOOL)fp16 newMessagesByOldMessage:(id)fp20 remoteIDs:(id)fp24 setFlags:(unsigned long long)fp28 clearFlags:(unsigned long long)fp36 messageFlagsForMessages:(id)fp44 copyFiles:(BOOL)fp48 progressDelegate:(id)fp52 addPOPUIDs:(BOOL)fp56 dataByMessage:(id)fp60;
- (void)resetMessages;
- (id)messages;

@end

@interface IMAPServiceGreetingStore : IMAPServiceStore
{
}

- (id)initWithMailboxUid:(id)fp8 readOnly:(BOOL)fp12;
- (void)setLibrary:(id)fp8;
- (void)_applyFlags:(id)fp8 state:(BOOL)fp12 toUidRange:(CDAnonymousStruct1)fp16 except:(unsigned int)fp24 closeWhenFinished:(BOOL)fp28 usingConnection:(id)fp32;
- (void)removeActiveGreetingFlagFromAllUids;
- (void)_removeActiveGreetingFlagFromAllUidsExcept:(unsigned int)fp8 isLast:(BOOL)fp12 usingConnection:(id)fp16;
- (void)removeActiveGreetingFlagFromAllUidsExceptLast:(unsigned int)fp8;
- (BOOL)canPerformOfflineAppend;
- (unsigned int)appendActiveGreeting:(id)fp8;
- (id)candidateGreetingMessage;
- (void)makeGreetingActive:(id)fp8;

@end

@interface IMAPNotificationInterpreter : VVNotificationInterpreter
{
}

+ (id)interpretedDictionaryForNotificationUserInfo:(struct __CFDictionary *)fp8;

@end

