/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
*/
#import "FRABlockActionSheet.h"
#import "FRABlockAlertView.h"
#import "FRAIdentityModel.h"
#import "FRAHotpOathMechanism.h"
#import "FRAOathCode.h"
#import "FRAOathMechanismTableViewCell.h"
#import "FRAOathMechanismTableViewCellController.h"
#import "FRATotpOathMechanism.h"
/*!
* Private interface.
*/
@interface FRAOathMechanismTableViewCellController ()
/*!
* Timer for updating TOTP progress indicator and generating next code in sequence.
*/
@end
+ (instancetype)controllerWithView:(FRAOathMechanismTableViewCell*)view mechanism:(FRAMechanism *)mechanism {
}
- (instancetype)initWithView:(FRAOathMechanismTableViewCell*)view mechanism:(FRAMechanism *)mechanism {
}
return self;
}
[super viewWillAppear:animated];
}
}
[super viewWillDisappear:animated];
}
- (void)showHideElements {
}];
} else {
}];
}];
}
}
}
}
}
}
}
}
[self reloadData];
}
[super setEditing:editing];
[self reloadData];
}
- (void)didTouchUpInside {
if (![self mechanismCode]) {
// if no code has been generated, allow the first to be created by touching anywhere within the cell;
// once the first code has been generated, the refresh button must be used
} else {
// otherwise, if a code has already been displayed, then offer to copy it to the clipboard
cancelButtonTitle:@"Cancel"
if (offset == 1) {
if (codeValue) {
}
}
};
}
}
}
- (NSString *)mechanismCode {
return (FRAHotpOathMechanism *)self.mechanism ? ((FRAHotpOathMechanism *)self.mechanism).code : ((FRATotpOathMechanism *)self.mechanism).code;
}
return (FRAHotpOathMechanism *)self.mechanism ? ((FRAHotpOathMechanism *)self.mechanism).codeLength : ((FRATotpOathMechanism *)self.mechanism).codeLength;
}
- (void)generateNextCode {
}
}
}
}
}
- (void)reloadData {
UIColor *dashboardRed = [UIColor colorWithRed:169.0/255.0 green:68.0/255.0 blue:66.0/255.0 alpha:1.0];
// Set font color for code and (if totp-based) the progress indicator
if (progress > 0.9f) {
}
} else {
}
// Set the code text
NSString* codeValue = [@"" stringByPaddingToLength:[self mechanismCodeLength] withString:@"●" startingAtIndex:0];
}
}
- (void)startProgressAnimationTimer {
if (!self.progressAnimationTimer) {
self.progressAnimationTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(timerCallback:) userInfo:nil repeats:YES];
}
}
- (void)stopProgressAnimationTimer {
}
- (void)showAlert {
FRABlockAlertView *alertView = [[FRABlockAlertView alloc] initWithTitle:NSLocalizedString(@"mechanism_generate_code_error_title", nil)
}
@end