123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314 |
- //
- // KMPurchaseCompareDMGWindowController.m
- // PDF Reader Pro Edition
- //
- // Created by 王帅 on 2018/5/8.
- //
- #import "KMPurchaseCompareDMGWindowController.h"
- #import <PDF_Reader_Pro-Swift.h>
- //#import "HyperLinkButton.h"
- #import "KMVerificationWindowController.h"
- //#import "KMPurchaseCompareWindowController.h"
- #import "VerificationManager.h"
- //#import "GAIManager.h"
- //#import "NSImage_SKExtensions.h"
- //#import "KMButton.h"
- //#import "KMBox.h"
- //#import "SKInspectPublicTool.h"
- //#import "FMTrackEventManager.h"
- //#import "NSFont+Custom.h"
- //#import "KMToolbarItemPopViewController.h"
- //#import "KMRecommondManager.h"
- static NSString *const KMPurchaseCompareDMGHeaderCellIdentifier = @"KMPurchaseCompareDMGHeaderCell";
- static NSString *const KMPurchaseCompareDMGCellIdentifier = @"KMPurchaseCompareDMGCell";
- #pragma mark - KMPurchaseCompareDMGHeaderCell
- @interface KMPurchaseCompareDMGHeaderCell : NSTableCellView
- @property (nonatomic,assign) IBOutlet NSView *contentView;
- @end
- @implementation KMPurchaseCompareDMGHeaderCell
- - (void)dealloc {
- [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
-
- self.contentView.wantsLayer = YES;
- [self updateViewColor];
- [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
- }
- - (void)themeChanged:(NSNotification *)notification {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self updateViewColor];
- });
- }
- - (void)updateViewColor {
- NSColor *textColor = [NSColor colorWithDeviceRed:51.0/255.0 green:51.0/255.0 blue:51.0/255.0 alpha:1.0];
- NSColor *viewColor = [NSColor colorWithDeviceRed:55.0/255.0 green:57.0/255.0 blue:59.0/255.0 alpha:0.06];
-
- if (@available(macOS 10.14, *)) {
- NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
- if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
- textColor = [NSColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.87];
- viewColor = [NSColor colorWithRed:52.0/255.0 green:53.0/255.0 blue:56.0/255.0 alpha:1.0];
- }
- }
-
- self.contentView.layer.backgroundColor = viewColor.CGColor;
- self.textField.textColor = textColor;
- self.textField.font = [NSFont boldSystemFontOfSize:14.0];
- }
- @end
- #pragma mark - KMPurchaseCompareDMGCell
- @interface KMPurchaseCompareDMGCell : NSTableCellView
- @property (nonatomic,assign) IBOutlet NSTextField *value1Label;
- @property (nonatomic,assign) IBOutlet NSTextField *value2Label;
- @property (nonatomic,assign) IBOutlet NSImageView *value1ImageView;
- @property (nonatomic,assign) IBOutlet NSImageView *value2ImageView;
- @property (nonatomic,assign) IBOutlet NSBox *lineBox;
- @end
- @implementation KMPurchaseCompareDMGCell
- - (void)dealloc {
- [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- [self updateViewColor];
- [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
- }
- - (void)themeChanged:(NSNotification *)notification {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self updateViewColor];
- });
- }
- - (void)updateViewColor {
- NSColor *textColor = [NSColor colorWithRed:102.0/255.0 green:102.0/255.0 blue:102.0/255.0 alpha:0.85];
- NSColor *lineColor = [NSColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:0.4];
-
- if (@available(macOS 10.14, *)) {
- NSAppearanceName appearanceName = [[NSApp effectiveAppearance] bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
- if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua]) {
- textColor = [NSColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.6];
- lineColor = [NSColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.4];
- }
- }
- self.value1Label.textColor = self.value2Label.textColor = textColor;
- self.lineBox.fillColor = lineColor;
- self.textField.textColor = textColor;
- }
- @end
- #pragma mark - KMPurchaseCompareDMGWindowController
- @interface KMPurchaseCompareDMGWindowController ()
- @property (nonatomic, assign) IBOutlet NSTextField *titleLabel;
- @property (assign) IBOutlet HyperLinkButton *enterLicenseButton;
- @property (assign) IBOutlet NSView *freeContendView;
- @property (assign) IBOutlet NSView *freeVersionBGView;
- @property (assign) IBOutlet NSTextField *freeVersionLbl;
- @property (assign) IBOutlet NSView *freeVersionLineView;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl1;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl2;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl3;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl4;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl5;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl6;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl7;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl8;
- @property (assign) IBOutlet NSTextField *freeVersionInfoLbl9;
- @property (weak) IBOutlet NSTextField *freeVersionInfoLbl10;
- @property (assign) IBOutlet NSView *parmanentVerBGView;
- @property (assign) IBOutlet NSTextField *parmanentVerLbl;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl1;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl2;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl3;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl4;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl5;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl6;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl7;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl8;
- @property (assign) IBOutlet NSTextField *parmanentVerInfoLbl9;
- @property (weak) IBOutlet NSImageView *parmanentVerInfoImage1;
- @property (weak) IBOutlet NSTextField *parmanentVerInfoLbl10;
- @property (assign) IBOutlet KMButton *parmanentVerInfoBtn2;
- @property (assign) IBOutlet NSImageView *parmanentVerinfoimg2;
- @property (assign) IBOutlet NSView *parmanentInfoView;
- @property (assign) IBOutlet NSImageView *discountTipImage;
- @property (assign) IBOutlet NSTextField *oneTimeTipLbl;
- @property (assign) IBOutlet NSBox *freeTrialBox;
- @property (assign) IBOutlet KMButton *freeTrialButton;
- @property (assign) IBOutlet NSBox *buyNowBox;
- @property (assign) IBOutlet KMButton *buyNowButton;
- @property (assign) IBOutlet NSView *aiContendView;
- @property (assign) IBOutlet NSView *aiSepLineView;
- @property (assign) IBOutlet NSTextField *aiTitleLabel;
- @property (assign) IBOutlet NSTextField *aiInfoLbl1;
- @property (assign) IBOutlet NSTextField *aiInfoLbl2;
- @property (assign) IBOutlet NSTextField *aiInfoLbl3;
- @property (assign) IBOutlet NSTextField *aiInfoLbl4;
- @property (assign) IBOutlet NSTextField *aiPurchaseLabel;
- @property (assign) IBOutlet KMButton *aiPurchaseButton;
- @property (weak) IBOutlet NSTextField *premiumLabel;
- @property (weak) IBOutlet NSTextField *permanentLabel;
- @property (weak) IBOutlet NSSwitch *buySwitch;
- @property (weak) IBOutlet NSTextField *discountPriceLabel;
- @property (weak) IBOutlet NSTextField *originalPriceLabel;
- @property (weak) IBOutlet NSTextField *discountPriceLabel2;
- @property (nonatomic, assign) NSModalSession modalSession;
- @property (nonatomic, retain) NSArray *dataSource;
- @property (nonatomic, retain) NSPopover *popOver;
- - (NSString *)_buyNowEventToPaidEventName;
- - (NSDictionary *)_getPaidEventParamsWith:(NSString *)eventN;
- @end
- @implementation KMPurchaseCompareDMGWindowController
- #pragma mark Init Methods
- - (id)init {
- if (self = [super initWithWindowNibName:@"KMPurchaseCompareDMGWindowController"]) {
- }
- return self;
- }
- - (void)dealloc {
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [NSDistributedNotificationCenter.defaultCenter removeObserver:self];
-
- }
- - (void)windowDidLoad {
- [super windowDidLoad];
-
- self.window.movableByWindowBackground = YES;
- self.window.backgroundColor = [NSColor whiteColor];
-
- __block typeof(self) blockSelf = self;
-
- [self.freeVersionInfoLbl2 setEnabled:YES];
-
- self.freeVersionLineView.wantsLayer = YES;
-
- self.premiumLabel.stringValue = NSLocalizedString(@"Premium", nil);
- self.premiumLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:0.7];
- self.premiumLabel.font = [NSFont SFProTextRegularFont:14.0];
- self.permanentLabel.stringValue = NSLocalizedString(@"Permanent", nil);
- self.permanentLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:94.0/255.0 blue:44.0/255.0 alpha:1.0];
- self.permanentLabel.font = [NSFont SFProTextRegularFont:14.0];
- self.discountPriceLabel.textColor = [NSColor colorWithRed:255.0/255.0 green:231.0/255.0 blue:106.0/255.0 alpha:1.0];
- self.discountPriceLabel.font = [NSFont fontWithName:@"Ubuntu" size:36.0];
- self.originalPriceLabel.textColor = [NSColor whiteColor];
- self.originalPriceLabel.font = [NSFont fontWithName:@"Ubuntu" size:14.0];
- self.discountPriceLabel2.textColor = [NSColor colorWithRed:255.0/255.0 green:231.0/255.0 blue:106.0/255.0 alpha:1.0];
- self.discountPriceLabel2.font = [NSFont fontWithName:@"Ubuntu" size:36.0];
- [self.discountPriceLabel2 setHidden:YES];
- self.freeVersionLbl.stringValue = NSLocalizedString(@"Free Version", nil);
- self.parmanentVerLbl.stringValue = NSLocalizedString(@"Permanent License", nil);
-
- self.freeVersionInfoLbl1.stringValue = self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"View PDFs", nil);
- self.freeVersionInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (basic)", nil);
- self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
- self.freeVersionInfoLbl3.stringValue = self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
- self.freeVersionInfoLbl4.stringValue = self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
- self.freeVersionInfoLbl5.stringValue = self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
- self.freeVersionInfoLbl6.stringValue = self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
- self.freeVersionInfoLbl7.stringValue = self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
- self.freeVersionInfoLbl8.stringValue = self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
- self.freeVersionInfoLbl9.stringValue = self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
- self.freeVersionInfoLbl10.stringValue = self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
- [self refreshParmanentVerInfo];
- // self.parmanentVerinfoimg2.toolTip = NSLocalizedString(@"Support insert links and custom stamps", nil);
- self.parmanentVerInfoBtn2.mouseMoveCallback = ^(BOOL mouseEntered) {
- if (mouseEntered) {
- KMToolbarItemPopViewController *popViewController = [[KMToolbarItemPopViewController alloc] init];
- self.popOver = [[NSPopover alloc] init];
- self.popOver.contentViewController = popViewController;
- self.popOver.animates = NO;
- self.popOver.behavior = NSPopoverBehaviorSemitransient;
-
- self.popOver.contentSize = popViewController.view.frame.size;
- [popViewController updateWithHelpTipWithHelpTip:NSLocalizedString(@"Support insert links and custom stamps", nil)];
- [self.popOver showRelativeToRect:self.parmanentVerInfoBtn2.frame ofView:self.parmanentInfoView preferredEdge:NSRectEdgeMaxY];
- // self.parmanentVerinfoimg2.image = [NSImage imageNamed:@"ic_Tooltip_hover"];
- } else {
- [self.popOver close];
- // self.parmanentVerinfoimg2.image = [NSImage imageNamed:@"ic_Tooltip"];
- }
- };
-
-
-
- self.oneTimeTipLbl.stringValue = NSLocalizedString(@"one-time purchase", nil);
- self.enterLicenseButton.title = NSLocalizedString(@"Enter License", nil);
- [self.enterLicenseButton setTitleColor:[KMAppearance KMColor_Layout_W0]];
- self.enterLicenseButton.mouseMoveCallback = ^(BOOL mouseEntered) {
- if (mouseEntered) {
- [blockSelf.enterLicenseButton setTitleColor:[KMAppearance KMColor_Layout_W70]];
- } else {
- [blockSelf.enterLicenseButton setTitleColor:[KMAppearance KMColor_Layout_W0]];
- }
- };
-
- self.titleLabel.font = [NSFont SFMediumFontWithSize:20];
- self.freeVersionLbl.font = [NSFont UbuntuBoldFontWithSize:24];
- self.parmanentVerLbl.font = [NSFont UbuntuBoldFontWithSize:24];
- self.freeVersionInfoLbl1.font = self.parmanentVerInfoLbl1.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl2.font = [NSFont SFProTextRegularFont:14.];
- self.parmanentVerInfoLbl2.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl3.font = self.parmanentVerInfoLbl3.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl4.font = self.parmanentVerInfoLbl4.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl5.font = self.parmanentVerInfoLbl5.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl6.font = self.parmanentVerInfoLbl6.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl7.font = self.parmanentVerInfoLbl7.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl8.font = self.parmanentVerInfoLbl8.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl9.font = self.parmanentVerInfoLbl9.font = [NSFont SFProTextRegularFont:14.];
- self.freeVersionInfoLbl10.font = self.parmanentVerInfoLbl10.font = [NSFont SFProTextRegularFont:14.];
- self.buyNowButton.font = [NSFont UbuntuMediumFontWithSize:16];
- self.freeTrialButton.font = [NSFont UbuntuMediumFontWithSize:16];
-
-
- self.freeContendView.wantsLayer = YES;
- self.freeContendView.layer.cornerRadius = 12;
- self.freeContendView.layer.masksToBounds = YES;
-
- self.parmanentVerBGView.wantsLayer = YES;
- self.parmanentVerBGView.layer.cornerRadius = 12;
- self.parmanentVerBGView.layer.masksToBounds = YES;
-
- self.buyNowBox.wantsLayer = YES;
- self.buyNowBox.fillColor = [NSColor colorWithRed:255/255. green:94/255. blue:44/255. alpha:1.];
- self.buyNowBox.cornerRadius = CGRectGetHeight(self.buyNowBox.frame)/2.;
- self.buyNowBox.layer.masksToBounds = YES;
-
- self.buyNowButton.wantsLayer = YES;
- self.buyNowButton.layer.cornerRadius = 1.0;
- self.buyNowButton.title = NSLocalizedString(@"Buy Now", nil);
- self.buyNowButton.mouseMoveCallback = ^(BOOL mouseEntered) {
- if (mouseEntered) {
- blockSelf.buyNowButton.layer.backgroundColor = [[NSColor blackColor] colorWithAlphaComponent:0.15].CGColor;
- } else {
- blockSelf.buyNowButton.layer.backgroundColor = [NSColor clearColor].CGColor;
- }
- };
-
- self.freeTrialBox.cornerRadius = CGRectGetHeight(self.freeTrialBox.frame)/2.;
- self.freeTrialBox.borderWidth = 1.;
-
- self.freeTrialButton.target = self;
- self.freeTrialButton.action = @selector(buttonItemClicked_License:);
- self.freeTrialButton.mouseMoveCallback = ^(BOOL mouseEntered) {
- if ([KMAppearance isDarkMode]) {
- if (mouseEntered) {
- blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:179/255. green:159/255. blue:1 alpha:0.2];
- } else {
- blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:179/255. green:159/255. blue:1 alpha:0.07];
- }
- } else {
- if (mouseEntered) {
- blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:85/255. green:40/255. blue:1 alpha:0.15];
- } else {
- blockSelf.freeTrialBox.fillColor = [NSColor colorWithRed:85/255. green:40/255. blue:1 alpha:0.07];
- }
- }
- };
- self.discountTipImage.hidden = YES;
- [self updatePriceLabel];
-
- self.aiSepLineView.wantsLayer = YES;
- self.aiInfoLbl1.font = self.aiInfoLbl2.font = self.aiInfoLbl3.font = self.aiInfoLbl4.font = [NSFont SFProTextRegularFont:14];
- self.aiPurchaseLabel.font = [NSFont UbuntuMediumFontWithSize:16];
-
- self.aiTitleLabel.stringValue = NSLocalizedString(@"AI Tools Title", nil);
- self.aiInfoLbl1.stringValue = NSLocalizedString(@"AI Summarize", nil);
- self.aiInfoLbl2.stringValue = NSLocalizedString(@"AI Rewrite", nil);
- self.aiInfoLbl3.stringValue = NSLocalizedString(@"AI Proofread", nil);
- self.aiInfoLbl4.stringValue = NSLocalizedString(@"AI Translate", nil);
- self.aiPurchaseLabel.stringValue = NSLocalizedString(@"Buy Now", nil);
- self.aiPurchaseButton.wantsLayer = YES;
- self.aiPurchaseButton.layer.cornerRadius = CGRectGetHeight(self.aiPurchaseButton.frame)/2.;
- self.aiPurchaseButton.layer.masksToBounds = YES;
- self.aiPurchaseButton.mouseMoveCallback = ^(BOOL mouseEntered) {
- if (mouseEntered) {
- self.aiPurchaseButton.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.2].CGColor;
- } else {
- self.aiPurchaseButton.layer.backgroundColor = [NSColor clearColor].CGColor;
- }
- };
-
- [self updateViewColor];
-
- [self updatePurchaseInformation];
-
- [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(recommondInfoUpdateNoti:) name:@"KMRecommondInfoUpdateNoti" object:nil];
- }
- #pragma mark - Private Methods
- - (void)updateViewColor {
-
- if ([KMAppearance isDarkMode]) {
- self.freeContendView.layer.backgroundColor = [[NSColor blackColor] colorWithAlphaComponent:0.3].CGColor;
- self.freeVersionLineView.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.1].CGColor;
- self.aiSepLineView.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.1].CGColor;
- self.freeVersionLbl.textColor = [[NSColor whiteColor] colorWithAlphaComponent:0.5];
- self.freeTrialBox.fillColor = [NSColor colorWithRed:179/255. green:159/255. blue:1 alpha:0.07];
- self.freeTrialBox.borderColor = [NSColor colorWithRed:207/255. green:146/255. blue:1 alpha:1];
-
- self.freeVersionInfoLbl1.textColor =
- self.freeVersionInfoLbl2.textColor =
- self.freeVersionInfoLbl3.textColor =
- self.freeVersionInfoLbl4.textColor =
- self.freeVersionInfoLbl5.textColor =
- self.freeVersionInfoLbl6.textColor =
- self.freeVersionInfoLbl7.textColor =
- self.freeVersionInfoLbl8.textColor =
- self.freeVersionInfoLbl9.textColor =
- self.freeVersionInfoLbl10.textColor = [NSColor whiteColor];
-
- self.parmanentVerInfoLbl1.textColor =
- self.parmanentVerInfoLbl2.textColor =
- self.parmanentVerInfoLbl3.textColor =
- self.parmanentVerInfoLbl4.textColor =
- self.parmanentVerInfoLbl5.textColor =
- self.parmanentVerInfoLbl6.textColor =
- self.parmanentVerInfoLbl7.textColor =
- self.parmanentVerInfoLbl8.textColor =
- self.parmanentVerInfoLbl9.textColor =
- self.parmanentVerInfoLbl10.textColor = [NSColor whiteColor];
-
- self.aiInfoLbl1.textColor = self.aiInfoLbl2.textColor = self.aiInfoLbl3.textColor = self.aiInfoLbl4.textColor = [NSColor whiteColor];
- self.aiPurchaseLabel.textColor = [NSColor whiteColor];
-
- self.aiTitleLabel.textColor = [NSColor colorWithRed:239/255. green:235/255. blue:255/255. alpha:1];
- } else {
- self.freeContendView.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.7].CGColor;
- self.freeVersionLineView.layer.backgroundColor = [NSColor colorWithRed:0 green:33/255. blue:67/255. alpha:0.1].CGColor;
- self.aiSepLineView.layer.backgroundColor = [NSColor colorWithRed:0 green:33/255. blue:67/255. alpha:0.1].CGColor;
- self.freeVersionLbl.textColor = [NSColor colorWithRed:129/255. green:125/255. blue:178/255. alpha:1.];
- self.freeTrialBox.fillColor = [NSColor colorWithRed:85/255. green:40/255. blue:1 alpha:0.07];
- self.freeTrialBox.borderColor = [NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1];
-
- self.freeVersionInfoLbl1.textColor =
- self.freeVersionInfoLbl2.textColor =
- self.freeVersionInfoLbl3.textColor =
- self.freeVersionInfoLbl4.textColor =
- self.freeVersionInfoLbl5.textColor =
- self.freeVersionInfoLbl6.textColor =
- self.freeVersionInfoLbl7.textColor =
- self.freeVersionInfoLbl8.textColor =
- self.freeVersionInfoLbl9.textColor =
- self.freeVersionInfoLbl10.textColor = [NSColor colorWithRed:20/255.0 green:0/255.0 blue:102/255.0 alpha:1];
-
- self.parmanentVerInfoLbl1.textColor =
- self.parmanentVerInfoLbl2.textColor =
- self.parmanentVerInfoLbl3.textColor =
- self.parmanentVerInfoLbl4.textColor =
- self.parmanentVerInfoLbl5.textColor =
- self.parmanentVerInfoLbl6.textColor =
- self.parmanentVerInfoLbl7.textColor =
- self.parmanentVerInfoLbl8.textColor =
- self.parmanentVerInfoLbl9.textColor =
- self.parmanentVerInfoLbl10.textColor = [NSColor whiteColor];
-
- self.aiInfoLbl1.textColor = self.aiInfoLbl2.textColor = self.aiInfoLbl3.textColor = self.aiInfoLbl4.textColor = [NSColor colorWithRed:20/255. green:0 blue:102/255. alpha:1];
- self.aiPurchaseLabel.textColor = [NSColor whiteColor];
- self.aiTitleLabel.textColor = [NSColor colorWithRed:20/255. green:0 blue:102/255. alpha:1];
- }
-
- self.parmanentVerLbl.textColor = [NSColor colorWithRed:252/255. green:253/255. blue:255/255. alpha:1.];
- self.oneTimeTipLbl.textColor = [NSColor colorWithRed:255/255. green:231/255. blue:106/255. alpha:1.];
-
- if ([KMAppearance isDarkMode]) {
- [self.freeTrialButton setTitleColor:[NSColor colorWithRed:178/255. green:165/255. blue:1 alpha:1]];
- } else {
- [self.freeTrialButton setTitleColor:[NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1]];
- }
- }
- - (void)updatePurchaseInformation {
- self.freeTrialBox.hidden = NO;
- self.titleLabel.stringValue = NSLocalizedString(@"Upgrade to Pro Version", nil);
- self.titleLabel.textColor = [NSColor whiteColor];
-
- [self.freeTrialButton setTitle:NSLocalizedString(@"7-day Free Trial", nil)];
- if (ActivityStatusVerification == [VerificationManager manager].status) {
- self.freeTrialBox.hidden = YES;
- } else if (ActivityStatusNone == [VerificationManager manager].status) {
-
- } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
- self.freeTrialBox.hidden = YES;
- if ([VerificationManager manager].secondTrialEnabled) {
- self.freeTrialBox.hidden = NO;
- }
- } else {
- self.freeTrialBox.hidden = YES;
- }
- if ([KMAppearance isDarkMode]) {
- [self.freeTrialButton setTitleColor:[NSColor colorWithRed:178/255. green:165/255. blue:1 alpha:1]];
- } else {
- [self.freeTrialButton setTitleColor:[NSColor colorWithRed:160/255. green:40/255. blue:1 alpha:1]];
- }
- [self.buyNowButton setTitleColor:[NSColor whiteColor]];
-
- [self updatePriceLabel];
- }
- - (void)updatePriceLabel {
- NSString *originalText = @"";
- NSString *discountText = @"";
- #if VERSION_DMG
- NSString *abbreviation = @"$";
- if ([@"CNY" isEqualToString:NSLocalizedString(@"USD", nil)]) {
- abbreviation = @"¥";
- }
- if ([self.buySwitch state]) {
- originalText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
- discountText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
- } else {
- originalText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
- discountText = [NSString stringWithFormat:@"%@%@", abbreviation, [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
- }
- #endif
- NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:originalText];
- [attributedText addAttribute:NSStrikethroughStyleAttributeName
- value:@(NSUnderlineStyleSingle)
- range:NSMakeRange(0, originalText.length)];
- self.originalPriceLabel.attributedStringValue = attributedText;
- self.discountPriceLabel.stringValue = discountText;
- self.discountPriceLabel2.stringValue = discountText;
- if (KMAdvertisementManager.manager.info.discountContent.content.count > 0) {
- KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.discountContent.content.firstObject;
- if ([KMAdvertisementManager checkAdvertisementValid:info]) {
- self.discountTipImage.hidden = NO;
-
- NSURL *url = [NSURL URLWithString:[KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight:NO]];
- self.discountTipImage.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage * _Nonnull image) {
- self.discountTipImage.image = image;
- }];
- if ([originalText isEqualToString:discountText]) {
- [self.originalPriceLabel setHidden:YES];
- [self.discountPriceLabel setHidden:YES];
- [self.discountPriceLabel2 setHidden:NO];
- [self.discountTipImage setHidden:YES];
- } else {
- [self.originalPriceLabel setHidden:NO];
- [self.discountPriceLabel setHidden:NO];
- [self.discountPriceLabel2 setHidden:YES];
- [self.discountTipImage setHidden:NO];
- }
- } else {
- self.discountTipImage.hidden = YES;
- if ([originalText isEqualToString:discountText]) {
- [self.originalPriceLabel setHidden:YES];
- [self.discountPriceLabel setHidden:YES];
- [self.discountPriceLabel2 setHidden:NO];
- } else {
- [self.originalPriceLabel setHidden:NO];
- [self.discountPriceLabel setHidden:NO];
- [self.discountPriceLabel2 setHidden:YES];
- }
- }
- }
- }
- //- (void)updatePriceLabel {
- // NSString *originalText = @"";
- // NSString *discountText = @"";
- // if ([@"USD" isEqualToString:NSLocalizedString(@"USD", nil)]) {
- //#if VERSION_DMG
- // if ([self.buySwitch state]) {
- // originalText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
- // discountText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_3"]];
- // } else {
- // originalText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
- // discountText = [NSString stringWithFormat:@"$%@", [[KMDMGProductsManager shareInstance] getActivityPrice:@"com.brother.pdfreaderpro.mac.product_1"]];
- // }
- //#endif
- // } else {
- //#if VERSION_DMG
- // if ([self.buySwitch state]) {
- // originalText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getPriceCNY:@"com.brother.pdfreaderpro.mac.product_3"]];
- // discountText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getActivityPriceCNY:@"com.brother.pdfreaderpro.mac.product_3"]];
- // } else {
- // originalText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getPriceCNY:@"com.brother.pdfreaderpro.mac.product_1"]];
- // discountText = [NSString stringWithFormat:@"¥%@", [[KMDMGProductsManager shareInstance] getActivityPriceCNY:@"com.brother.pdfreaderpro.mac.product_1"]];
- // }
- //#endif
- // }
- // NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:originalText];
- // [attributedText addAttribute:NSStrikethroughStyleAttributeName
- // value:@(NSUnderlineStyleSingle)
- // range:NSMakeRange(0, originalText.length)];
- // self.originalPriceLabel.attributedStringValue = attributedText;
- // self.discountPriceLabel.stringValue = discountText;
- //
- // if ([originalText isEqualToString:discountText]) {
- // [self.originalPriceLabel setHidden:YES];
- // } else {
- // [self.originalPriceLabel setHidden:NO];
- // }
- //}
- - (void)refreshParmanentVerInfo {
- if ([self.buySwitch state] == NSControlStateValueOn) {
- self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"View PDFs", nil);
- self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
- self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
- self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
- self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
- self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
- self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
- self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
- self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
- self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
- self.parmanentVerInfoImage1.image = [NSImage imageNamed:@"function_vip"];
- } else {
- self.parmanentVerInfoLbl1.stringValue = NSLocalizedString(@"Unlimited file conversion", nil);
- self.parmanentVerInfoLbl2.stringValue = NSLocalizedString(@"Annotate PDFs (advanced)", nil);
- self.parmanentVerInfoLbl3.stringValue = NSLocalizedString(@"View PDFs", nil);
- self.parmanentVerInfoLbl4.stringValue = NSLocalizedString(@"Edit PDF text and images", nil);
- self.parmanentVerInfoLbl5.stringValue = NSLocalizedString(@"Digital signature", nil);
- self.parmanentVerInfoLbl6.stringValue = NSLocalizedString(@"Organize pages", nil);
- self.parmanentVerInfoLbl7.stringValue = NSLocalizedString(@"Batch process", nil);
- self.parmanentVerInfoLbl8.stringValue = NSLocalizedString(@"OCR PDFs", nil);
- self.parmanentVerInfoLbl9.stringValue = NSLocalizedString(@"Measuring Tools", nil);
- self.parmanentVerInfoLbl10.stringValue = NSLocalizedString(@"Ad-free", nil);
- self.parmanentVerInfoImage1.image = [NSImage imageNamed:@"compare_nosupport"];
- }
- }
- #pragma mark - Window Method
- - (void)showWindow:(id)sender {
- [super showWindow:nil];
-
- [self.window center];
- [self.window orderFront:nil];
-
- [self.buySwitch setState:NSControlStateValueOn];
- [self updatePriceLabel];
- [self updatePurchaseInformation];
- }
- - (BOOL)windowShouldClose:(id)sender {
- [self endModal:sender];
- return YES;
- }
- - (void)close {
- [super close];
-
- // 清空埋点的数据
- self.kEventName = nil;
- self.kEventTag = 0;
-
- [self endModal:nil];
- }
- - (void)updateTitle:(NSString *)title andColor:(NSColor *)titleColor {
- self.titleLabel.stringValue = title ?:@"";
- self.titleLabel.textColor = titleColor ?:[NSColor labelColor];
-
- }
- #pragma mark - IBAction
- - (IBAction)startModal:(id)sender {
-
- [NSApp stopModal];
-
- NSInteger modalCode;
- self.modalSession = [NSApp beginModalSessionForWindow:self.window];
- do {
- modalCode = [NSApp runModalSession:self.modalSession];
- } while (modalCode == NSRunContinuesResponse);
- }
- - (IBAction)endModal:(id)sender {
- if (self.modalSession) {
- [NSApp stopModal];
- [NSApp endModalSession:self.modalSession];
- [self.window orderOut:self];
-
- self.modalSession = nil;
- }
- }
- - (void)showWindowRestore:(id)sender {
- [self showWindow:sender];
- }
- - (IBAction)enterLicenseAction:(id)sender {
- // if (ActivityStatusNone == [VerificationManager manager].status) {
- // [self close];
- // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
- // vc.callback = ^{
- // [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
- // };
- // [vc showWindow:nil];
- // } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
- // if ([VerificationManager manager].secondTrialEnabled) {
- // [[FMTrackEventManager manager] trackEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
- // [[VerificationManager manager] trialForDays:7
- // email:[VerificationManager manager].email
- // name:[VerificationManager manager].accountName
- // complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
- // if (error ||
- // status != ActivityStatusTrial) {
- // NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
- // defaultButton:NSLocalizedString(@"Try Again", nil)
- // alternateButton:nil
- // otherButton:nil
- // informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
- // [alert runModal];
- // } else {
- // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
- // [vc showWindow:nil];
- // }
- // }];
- // [self close];
- // } else {
- // [self close];
- // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
- // vc.callback = ^{
- // [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
- // };
- // [vc showWindow:nil];
- // }
- // } else {
- [self close];
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
- vc.callback = ^{
- [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
- };
- [vc showWindow:nil];
- // }
- }
- - (IBAction)buttonItemClicked_Buy:(id)sender {
- //#if VERSION_DMG
- // NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_comparison", Swift_oc_Tool.Store_Link_OC]];
- // [[NSWorkspace sharedWorkspace] openURL:url];
- // [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_UpgradeBuyNow"}];
- //#endif
-
- #if VERSION_DMG
- [self trackEvent_buyNow];
- NSString *paidEventName = [self _buyNowEventToPaidEventName];
- NSDictionary *paidEventParams = [self _getPaidEventParamsWith:paidEventName];
-
- NSString *thePaidEventName = paidEventParams.allKeys.firstObject;
- NSDictionary *thePaidEventParams = nil;
- if (paidEventName != nil && paidEventParams.allValues.firstObject != nil) {
- thePaidEventParams = @{paidEventParams.allValues.firstObject : paidEventName};
- }
-
- [self close];
-
- NSString *productID = @"";
- if ([self.buySwitch state]) {
- productID = @"com.brother.pdfreaderpro.mac.product_3";
- } else {
- productID = @"com.brother.pdfreaderpro.mac.product_1";
- }
- // KMPurchaseEmbeddedWindowController *embeddedWC = [[KMPurchaseEmbeddedWindowController alloc] initWithWindowNibName:@"KMPurchaseEmbeddedWindowController"];
- KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:productID];
- // [embeddedWC beginSheetModalFor:NSApp.mainWindow completionHandler:^(NSInteger result) {
- //
- // }];
- embeddedWC.kEventName = thePaidEventName;
- embeddedWC.kEventParams = thePaidEventParams;
- [embeddedWC showWindow:nil];
- [[embeddedWC window] center];
- #endif
- }
- - (IBAction)buttonItemClicked_CloseWindow:(id)sender {
- [self close];
- }
- - (void)buttonItemClicked_License:(id)sender {
- // if (ActivityStatusNone == [VerificationManager manager].status) {
- // [self close];
- //
- // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
- // [vc showWindow:nil];
- // } else if (ActivityStatusTrialExpire == [VerificationManager manager].status) {
- if ([VerificationManager manager].secondTrialEnabled) {
- [[FMTrackEventManager defaultManager] trackEventWithEvent:@"Tbr" withProperties:@{@"Tbr_Btn":@"Btn_Tbr_SecondTrial"}];
- [[VerificationManager manager] trialForDays:7
- email:[VerificationManager manager].email
- name:[VerificationManager manager].accountName
- complention:^(ActivityStatus status, NSDictionary *info, NSError *error) {
- if (error ||
- status != ActivityStatusTrial) {
- NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Activation Error", nil)
- defaultButton:NSLocalizedString(@"Try Again", nil)
- alternateButton:nil
- otherButton:nil
- informativeTextWithFormat:NSLocalizedString(@"Failed to sign up for the free trial. Please make sure your internet connection is available and try again later.", nil), nil];
- [alert runModal];
- } else {
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialSuccess];
- [vc showWindow:nil];
- }
- }];
- [self close];
- } else {
- [self close];
- KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeTrial];
- vc.callback = ^{
- [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
- };
- [vc showWindow:nil];
- }
- // } else {
- // [self close];
- // KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];
- // vc.callback = ^{
- // [[KMPurchaseCompareWindowController sharedInstance] showWindow:nil];
- // };
- // [vc showWindow:nil];
- // }
- }
- - (IBAction)aiPurchaseButtonClick:(NSButton *)sender {
- // NSURL *url = [NSURL URLWithString:Swift_oc_Tool.AIProduct_Link_OC];
- // [[NSWorkspace sharedWorkspace] openURL:url];
- //
- // [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_BuyAITools"}];
- [self trackEvent_buyNow];
- NSString *paidEventName = [self _buyNowEventToPaidEventName];
- NSDictionary *paidEventParams = [self _getPaidEventParamsWith:paidEventName];
- NSString *thePaidEventName = paidEventParams.allKeys.firstObject;
- NSDictionary *thePaidEventParams = nil;
- if (paidEventName != nil && paidEventParams.allValues.firstObject != nil) {
- thePaidEventParams = @{paidEventParams.allValues.firstObject : paidEventName};
- }
-
- [self close];
- #if VERSION_DMG
- KMPurchaseEmbeddedWindowController *embeddedWC = [KMPurchaseEmbeddedWindowController currentFirstTrialWC:@"com.brother.pdfreaderpro.ai.product_1"];
- embeddedWC.kEventName = thePaidEventName;
- embeddedWC.kEventParams = thePaidEventParams;
- [embeddedWC showWindow:nil];
- [[embeddedWC window] center];
- #endif
- }
- - (IBAction)buySwitchAction:(NSSwitch *)sender {
- [self refreshParmanentVerInfo];
- [self updatePriceLabel];
- }
- #pragma mark - Noti
- - (void)themeChanged:(NSNotification *)notification {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self updateViewColor];
- });
- }
- - (void)recommondInfoUpdateNoti:(NSNotification *)noti {
- dispatch_async(dispatch_get_main_queue(), ^{
- [self updatePriceLabel];
- });
- }
- @end
- @implementation KMPurchaseCompareDMGWindowController (KMAnalytic)
- - (void)trackEvent_buyNow {
- NSDictionary *params = [self _getBuyNowEventParams];
- NSString *theEventName = params.allKeys.firstObject;
- NSDictionary *theParams = nil;
- if (self.kEventName != nil && params.allValues.firstObject != nil) {
- theParams = @{params.allValues.firstObject : self.kEventName};
- }
-
- [self trackEvent_dmgWithEventName:theEventName params:theParams platform:KMAnalyticsPlatformAppCenter];
- }
- - (NSDictionary *)_getBuyNowEventParams {
- NSString *eveN = self.kEventName;
- if (eveN == nil || eveN.length == 0) {
- return nil;
- }
-
- if ([eveN isEqual:@"Reading_WebsiteLink_BuyNow"] ||
- [eveN isEqual:@"Reading_EmailLink_BuyNow"] ||
- [eveN isEqual:@"Reading_DynamicStamp_BuyNow"] ||
- [eveN isEqual:@"Reading_CustomStamp_BuyNow"] ||
- [eveN isEqual:@"Reading_Signature_BuyNow"] ||
- [eveN isEqual:@"Reading_Table_BuyNow"]) {
- return @{@"Purchase_Tools" : @"SubTbr_Tools"};
- } else if ([eveN isEqual:@"Reading_InsertBlankPage_BuyNow"] ||
- [eveN isEqual:@"Reading_InsertPDF_BuyNow"] ||
- [eveN isEqual:@"Reading_InsertSacnner_BuyNow"] ||
- [eveN isEqual:@"Reading_InsertImage_BuyNow"] ||
- [eveN isEqual:@"Reading_InsertClipboard_BuyNow"] ||
- [eveN isEqual:@"Reading_Replace_BuyNow"] ||
- [eveN isEqual:@"Reading_Extract_BuyNow"] ||
- [eveN isEqual:@"Reading_Split_BuyNow"] ||
- ([eveN isEqual:@"Reading_Rotate_BuyNow"] && self.kEventTag == 0) ||
- [eveN isEqual:@"Reading_Reverse_BuyNow"] ||
- [eveN isEqual:@"Reading_Copy_BuyNow"] ||
- [eveN isEqual:@"Reading_Delete_BuyNow"] ||
- [eveN isEqual:@"Reading_Merge_BuyNow"]) {
- return @{@"Purchase_PageEdit" : @"SubTbr_PageEdit"};
- } else if ([eveN isEqual:@"Onbrd_EditPage_BuyNow"] ||
- [eveN isEqual:@"Onbrd_Merge_BuyNow"]) {
- return @{@"Purchase_PageEdit" : @"Home_PageEdit"};
- } else if ([eveN isEqual:@"Reading_RemoveSecurity_BuyNow"] ||
- [eveN isEqual:@"Reading_Compare_BuyNow"] ||
- [eveN isEqual:@"Reading_AddWatermark_BuyNow"] ||
- [eveN isEqual:@"Reading_RemoveWatermark_BuyNow"] ||
- [eveN isEqual:@"Reading_AddBackground_BuyNow"] ||
- [eveN isEqual:@"Reading_RemoveBackground_BuyNow"] ||
- [eveN isEqual:@"Reading_AddHeaderFooter_BuyNow"] ||
- [eveN isEqual:@"Reading_RemoveHeaderFooter_BuyNow"] ||
- [eveN isEqual:@"Reading_AddBates_BuyNow"] ||
- [eveN isEqual:@"Reading_RemoveBates_BuyNow"] ||
- [eveN isEqual:@"Reading_Measure_BuyNow"]) {
- return @{@"Purchase_Editor" : @"SubTbr_Editor"};
- } else if ([eveN isEqual:@"Onbrd_Compare_BuyNow"] ||
- [eveN isEqual:@"Onbrd_Background_BuyNow"] ||
- [eveN isEqual:@"Onbrd_Watermard_BuyNow"] ||
- [eveN isEqual:@"Onbrd_HeaderFooter_BuyNow"] ||
- [eveN isEqual:@"Onbrd_Bates_BuyNow"] ||
- [eveN isEqual:@"Onbrd_Security_BuyNow"]) {
- return @{@"Purchase_Editor" : @"Home_Editor"};
- } else if ([eveN isEqual:@"Reading_PDFtoWord_BuyNow"] ||
- [eveN isEqual:@"Reading_PDFtoExcel_BuyNow"] ||
- [eveN isEqual:@"Reading_PDFtoPPT_BuyNow"] ||
- [eveN isEqual:@"Reading_PDFtoRTF_BuyNow"] ||
- [eveN isEqual:@"Reading_PDFtoCSV_BuyNow"] ||
- [eveN isEqual:@"Reading_PDFtoText_BuyNow"] ||
- [eveN isEqual:@"Reading_PDFtoImage_BuyNow"] ||
- [eveN isEqual:@"Reading_ExtractImage_BuyNow"]) {
- return @{@"Purchase_Converter" : @"SubTbr_Converter"};
- } else if ([eveN isEqual:@"Onbrd_ConvertPDF_BuyNow"] ||
- [eveN isEqual:@"Onbrd_PDFtoWord_BuyNow"] ||
- [eveN isEqual:@"Onbrd_PDFtoExcel_BuyNow"] ||
- [eveN isEqual:@"Onbrd_PDFtoPPT_BuyNow"] ||
- [eveN isEqual:@"Onbrd_ImagetoPDF_BuyNow"]) {
- return @{@"Purchase_Converter" : @"Home_Converter"};
- } else if ([eveN isEqual:@"Reading_TextField_BuyNow"] ||
- [eveN isEqual:@"Reading_CheckBox_BuyNow"] ||
- [eveN isEqual:@"Reading_RadioButton_BuyNow"] ||
- [eveN isEqual:@"Reading_ListBox_BuyNow"] ||
- [eveN isEqual:@"Reading_ComboBox_BuyNow"] ||
- [eveN isEqual:@"Reading_Button_BuyNow"]) {
- return @{@"Purchase_Form" : @"SubTbr_Forms"};
- } else if ([eveN isEqual:@"Reading_FillSign_Signature_BuyNow"] ||
- [eveN isEqual:@"Reading_DigitalSign_BuyNow"] ||
- [eveN isEqual:@"Reading_ElectronicSign_BuyNow"]) {
- return @{@"Purchase_Sign" : @"SunTbr_Signature"};
- } else if ([eveN isEqual:@"Reading_EditPDF_BuyNow"] ||
- [eveN isEqual:@"Reading_ReplaceText_BuyNow"]) {
- return @{@"Purchase_EditPDF" : @"Tbr_Edit PDF"};
- } else if ([eveN isEqual:@"Reading_Redact_BuyNow"]) {
- return @{@"Purchase_Redact" : @"Tbr_Redact"};
- } else if ([eveN isEqual:@"Reading_OCR_BuyNow"] ||
- [eveN isEqual:@"Reading_Convert_OCR_BuyNow"] ||
- [eveN isEqual:@"Onbrd_OCR_BuyNow"]) {
- return @{@"Purchase_OCR" : @"SubTbr_OCR"};
- } else if ([eveN isEqual:@"Reading_SplitView_BuyNow"] ||
- [eveN isEqual:@"Reading_Rotate_BuyNow"] ||
- [eveN isEqual:@"Reading_Theme_BuyNow"] ||
- [eveN isEqual:@"Reading_MultiTab_BuyNow"]) {
- return @{@"Purchase_PageDisplay" : @"SubTbr_PageDisplay"};
- } else if ([eveN isEqual:@"Onbrd_PrintPoster_BuyNow"] ||
- [eveN isEqual:@"Onbrd_PrintMultiple_BuyNow"] ||
- [eveN isEqual:@"Onbrd_PrintBooklet_BuyNow"]) {
- return @{@"Purchase_Others" : @"Home_Others"};
- } else if ([eveN isEqual:@"Reading_Flatten_BuyNow"]) {
- return @{@"Purchase_Others" : @"SubTbr_Others"};
- } else if ([eveN isEqual:@"MenuBar_PrintPoster_BuyNow"] ||
- [eveN isEqual:@"MenuBar_PrintMultiple_BuyNow"] ||
- [eveN isEqual:@"MenuBar_PrintBooklet_BuyNow"]) {
- return @{@"Purchase_Others" : @"MenuBar_Others"};
- }
- return nil;
- }
- - (NSString *)_buyNowEventToPaidEventName {
- NSString *eveN = self.kEventName;
- if (eveN == nil || eveN.length == 0) {
- return nil;
- }
- // Paid_Tools
- if ([eveN isEqual:@"Reading_WebsiteLink_BuyNow"]) {
- return @"Reading_WebsiteLink_Paid";
- } else if ([eveN isEqual:@"Reading_EmailLink_BuyNow"]) {
- return @"Reading_EmailLink_Paid";
- } else if ([eveN isEqual:@"Reading_DynamicStamp_BuyNow"]) {
- return @"Reading_DynamicStamp_Paid";
- } else if ([eveN isEqual:@"Reading_CustomStamp_BuyNow"]) {
- return @"Reading_CustomStamp_Paid";
- } else if ([eveN isEqual:@"Reading_Signature_BuyNow"]) {
- return @"Reading_Signature_Paid";
- } else if ([eveN isEqual:@"Reading_Table_BuyNow"]) {
- return @"Reading_Table_Paid";
- }
- // Paid_PageEdit SubTbr_PageEdit
- else if ([eveN isEqual:@"Reading_InsertBlankPage_BuyNow"]) {
- return @"Reading_InsertBlankPage_Paid";
- } else if ([eveN isEqual:@"Reading_InsertPDF_BuyNow"]) {
- return @"Reading_InsertPDF_Paid";
- } else if ([eveN isEqual:@"Reading_InsertSacnner_BuyNow"]) {
- return @"Reading_InsertSacnner_Paid";
- } else if ([eveN isEqual:@"Reading_InsertImage_BuyNow"]) {
- return @"Reading_InsertImage_Paid";
- } else if ([eveN isEqual:@"Reading_InsertClipboard_BuyNow"]) {
- return @"Reading_InsertClipboard_Paid";
- } else if ([eveN isEqual:@"Reading_Replace_BuyNow"]) {
- return @"Reading_Replace_Paid";
- } else if ([eveN isEqual:@"Reading_Extract_BuyNow"]) {
- return @"Reading_Extract_Paid";
- } else if ([eveN isEqual:@"Reading_Split_BuyNow"]) {
- return @"Reading_Split_Paid";
- } else if ([eveN isEqual:@"Reading_Rotate_BuyNow"]) {
- return @"Reading_Rotate_Paid";
- } else if ([eveN isEqual:@"Reading_Reverse_BuyNow"]) {
- return @"Reading_Reverse_Paid";
- } else if ([eveN isEqual:@"Reading_Copy_BuyNow"]) {
- return @"Reading_Copy_Paid";
- } else if ([eveN isEqual:@"Reading_Delete_BuyNow"]) {
- return @"Reading_Delete_Paid";
- } else if ([eveN isEqual:@"Reading_Merge_BuyNow"]) {
- return @"Reading_Merge_Paid";
- }
- // Paid_PageEdit Home_PageEdit
- else if ([eveN isEqual:@"Onbrd_EditPage_BuyNow"]) {
- return @"Onbrd_EditPage_Paid";
- } else if ([eveN isEqual:@"Onbrd_Merge_BuyNow"]) {
- return @"Onbrd_Merge_Paid";
- }
- // Paid_Editor SubTbr_Editor
- else if ([eveN isEqual:@"Reading_RemoveSecurity_BuyNow"]) {
- return @"Reading_RemoveSecurity_Paid";
- } else if ([eveN isEqual:@"Reading_Compare_BuyNow"]) {
- return @"Reading_Compare_Paid";
- } else if ([eveN isEqual:@"Reading_AddWatermark_BuyNow"]) {
- return @"Reading_AddWatermark_Paid";
- } else if ([eveN isEqual:@"Reading_RemoveWatermark_BuyNow"]) {
- return @"Reading_RemoveWatermark_Paid";
- } else if ([eveN isEqual:@"Reading_AddBackground_BuyNow"]) {
- return @"Reading_AddBackground_Paid";
- } else if ([eveN isEqual:@"Reading_RemoveBackground_BuyNow"]) {
- return @"Reading_RemoveBackground_Paid";
- } else if ([eveN isEqual:@"Reading_AddHeaderFooter_BuyNow"]) {
- return @"Reading_AddHeaderFooter_Paid";
- } else if ([eveN isEqual:@"Reading_RemoveHeaderFooter_BuyNow"]) {
- return @"Reading_RemoveHeaderFooter_Paid";
- } else if ([eveN isEqual:@"Reading_AddBates_BuyNow"]) {
- return @"Reading_AddBates_Paid";
- } else if ([eveN isEqual:@"Reading_RemoveBates_BuyNow"]) {
- return @"Reading_RemoveBates_Paid";
- } else if ([eveN isEqual:@"Reading_Measure_BuyNow"]) {
- return @"Reading_Measure_Paid";
- }
- // Paid_Editor Home_Editor
- else if ([eveN isEqual:@"Onbrd_Compare_BuyNow"]) {
- return @"Onbrd_Compare_Paid";
- } else if ([eveN isEqual:@"Onbrd_Background_BuyNow"]) {
- return @"Onbrd_Background_Paid";
- } else if ([eveN isEqual:@"Onbrd_Watermard_BuyNow"]) {
- return @"Onbrd_Watermard_Paid";
- } else if ([eveN isEqual:@"Onbrd_HeaderFooter_BuyNow"]) {
- return @"Onbrd_HeaderFooter_Paid";
- } else if ([eveN isEqual:@"Onbrd_Bates_BuyNow"]) {
- return @"Onbrd_Bates_Paid";
- } else if ([eveN isEqual:@"Onbrd_Security_BuyNow"]) {
- return @"Onbrd_Security_Paid";
- }
- // Paid_Converter SubTbr_Converte
- else if ([eveN isEqual:@"Reading_PDFtoWord_BuyNow"]) {
- return @"Reading_PDFtoWord_Paid";
- } else if ([eveN isEqual:@"Reading_PDFtoExcel_BuyNow"]) {
- return @"Reading_PDFtoExcel_Paid";
- } else if ([eveN isEqual:@"Reading_PDFtoPPT_BuyNow"]) {
- return @"Reading_PDFtoPPT_Paid";
- } else if ([eveN isEqual:@"Reading_PDFtoRTF_BuyNow"]) {
- return @"Reading_PDFtoRTF_Paid";
- } else if ([eveN isEqual:@"Reading_PDFtoCSV_BuyNow"]) {
- return @"Reading_PDFtoCSV_Paid";
- } else if ([eveN isEqual:@"Reading_PDFtoText_BuyNow"]) {
- return @"Reading_PDFtoText_Paid";
- } else if ([eveN isEqual:@"Reading_PDFtoImage_BuyNow"]) {
- return @"Reading_PDFtoImage_Paid";
- } else if ([eveN isEqual:@"Reading_ExtractImage_BuyNow"]) {
- return @"Reading_ExtractImage_Paid";
- }
- // Paid_Converter Home_Converter
- else if ([eveN isEqual:@"Onbrd_ConvertPDF_BuyNow"]) {
- return @"Onbrd_ConvertPDF_Paid";
- } else if ([eveN isEqual:@"Onbrd_PDFtoWord_BuyNow"]) {
- return @"Onbrd_PDFtoWord_Paid";
- } else if ([eveN isEqual:@"Onbrd_PDFtoExcel_BuyNow"]) {
- return @"Onbrd_PDFtoExcel_Paid";
- } else if ([eveN isEqual:@"Onbrd_PDFtoPPT_BuyNow"]) {
- return @"Onbrd_PDFtoPPT_Paid";
- } else if ([eveN isEqual:@"Onbrd_ImagetoPDF_BuyNow"]) {
- return @"Onbrd_ImagetoPDF_Paid";
- }
- // Paid_Form SubTbr_Forms
- else if ([eveN isEqual:@"Reading_TextField_BuyNow"]) {
- return @"Reading_TextField_Paid";
- } else if ([eveN isEqual:@"Reading_CheckBox_BuyNow"]) {
- return @"Reading_CheckBox_Paid";
- } else if ([eveN isEqual:@"Reading_RadioButton_BuyNow"]) {
- return @"Reading_RadioButton_Paid";
- } else if ([eveN isEqual:@"Reading_ListBox_BuyNow"]) {
- return @"Reading_ListBox_Paid";
- } else if ([eveN isEqual:@"Reading_ComboBox_BuyNow"]) {
- return @"Reading_ComboBox_Paid";
- } else if ([eveN isEqual:@"Reading_Button_BuyNow"]) {
- return @"Reading_Button_Paid";
- }
- // Paid_Sign SunTbr_Signature
- else if ([eveN isEqual:@"Reading_FillSign_Signature_BuyNow"]) {
- return @"Reading_FillSign_Signature_Paid";
- } else if ([eveN isEqual:@"Reading_DigitalSign_BuyNow"]) {
- return @"Reading_DigitalSign_Paid";
- } else if ([eveN isEqual:@"Reading_ElectronicSign_BuyNow"]) {
- return @"Reading_ElectronicSign_Paid";
- }
- // Paid_EditPDF Tbr_Edit PDF
- else if ([eveN isEqual:@"Reading_EditPDF_BuyNow"]) {
- return @"Reading_EditPDF_Paid";
- } else if ([eveN isEqual:@"Reading_ReplaceText_BuyNow"]) {
- return @"Reading_ReplaceText_Paid";
- }
- // Paid_Redact Tbr_Redact
- else if ([eveN isEqual:@"Reading_Redact_BuyNow"]) {
- return @"Reading_Redact_Paid";
- }
- // Paid_OCR SubTbr_OCR
- else if ([eveN isEqual:@"Reading_OCR_BuyNow"]) {
- return @"Reading_OCR_Paid";
- } else if ([eveN isEqual:@"Reading_Convert_OCR_BuyNow"]) {
- return @"Reading_Convert_OCR_Paid";
- } else if ([eveN isEqual:@"Onbrd_OCR_BuyNow"]) {
- return @"Onbrd_OCR_Paid";
- }
- // Paid_PageDisplay SubTbr_Page Display
- else if ([eveN isEqual:@"Reading_SplitView_BuyNow"]) {
- return @"Reading_SplitView_Paid";
- } else if ([eveN isEqual:@"Reading_Rotate_BuyNow"]) {
- return @"Reading_Rotate_Paid";
- } else if ([eveN isEqual:@"Reading_Theme_BuyNow"]) {
- return @"Reading_Theme_Paid";
- } else if ([eveN isEqual:@"Reading_MultiTab_BuyNow"]) {
- return @"Reading_MultiTab_Paid";
- }
- // Home_Others
- else if ([eveN isEqual:@"Onbrd_PrintPoster_BuyNow"]) {
- return @"Onbrd_PrintPoster_Paid";
- } else if ([eveN isEqual:@"Onbrd_PrintMultiple_BuyNow"]) {
- return @"Onbrd_PrintMultiple_Paid";
- } else if ([eveN isEqual:@"Onbrd_PrintBooklet_BuyNow"]) {
- return @"Onbrd_PrintBooklet_Paid";
- }
- // Paid_Others SubTbr_Others
- else if ([eveN isEqual:@"Reading_Flatten_BuyNow"]) {
- return @"Reading_Flatten_Paid";
- }
- // Paid_Others MenuBar_Others
- else if ([eveN isEqual:@"MenuBar_PrintPoster_BuyNow"]) {
- return @"MenuBar_PrintPoster_Paid";
- } else if ([eveN isEqual:@"MenuBar_PrintMultiple_BuyNow"]) {
- return @"MenuBar_PrintMultiple_Paid";
- } else if ([eveN isEqual:@"MenuBar_PrintBooklet_BuyNow"]) {
- return @"MenuBar_PrintBooklet_Paid";
- }
- return nil;
- }
- - (NSDictionary *)_getPaidEventParamsWith:(NSString *)eventN {
- NSString *eveN = eventN;
- if (eveN == nil || eveN.length == 0) {
- return nil;
- }
-
- // Paid_Tools SubTbr_Tools
- if ([eveN isEqual:@"Reading_WebsiteLink_Paid"] ||
- [eveN isEqual:@"Reading_EmailLink_Paid"] ||
- [eveN isEqual:@"Reading_DynamicStamp_Paid"] ||
- [eveN isEqual:@"Reading_CustomStamp_Paid"] ||
- [eveN isEqual:@"Reading_Signature_Paid"] ||
- [eveN isEqual:@"Reading_Table_Paid"]) {
- return @{@"Paid_Tools" : @"SubTbr_Tools"};
- }
- // Paid_PageEdit SubTbr_PageEdit
- else if ([eveN isEqual:@"Reading_InsertBlankPage_Paid"] ||
- [eveN isEqual:@"Reading_InsertPDF_Paid"] ||
- [eveN isEqual:@"Reading_InsertSacnner_Paid"] ||
- [eveN isEqual:@"Reading_InsertImage_Paid"] ||
- [eveN isEqual:@"Reading_InsertClipboard_Paid"] ||
- [eveN isEqual:@"Reading_Replace_Paid"] ||
- [eveN isEqual:@"Reading_Extract_Paid"] ||
- [eveN isEqual:@"Reading_Split_Paid"] ||
- [eveN isEqual:@"Reading_Rotate_Paid"] ||
- [eveN isEqual:@"Reading_Reverse_Paid"] ||
- [eveN isEqual:@"Reading_Copy_Paid"] ||
- [eveN isEqual:@"Reading_Delete_Paid"] ||
- [eveN isEqual:@"Reading_Merge_Paid"]) {
- return @{@"Paid_PageEdit" : @"SubTbr_PageEdit"};
- }
- // Paid_PageEdit Home_PageEdit
- else if ([eveN isEqual:@"Onbrd_EditPage_Paid"] ||
- [eveN isEqual:@"Onbrd_Merge_Paid"]) {
- return @{@"Paid_PageEdit" : @"Home_PageEdit"};
- }
- // Paid_Editor SubTbr_Editor
- else if ([eveN isEqual:@"Reading_RemoveSecurity_Paid"] ||
- [eveN isEqual:@"Reading_Compare_Paid"] ||
- [eveN isEqual:@"Reading_AddWatermark_Paid"] ||
- [eveN isEqual:@"Reading_RemoveWatermark_Paid"] ||
- [eveN isEqual:@"Reading_AddBackground_Paid"] ||
- [eveN isEqual:@"Reading_RemoveBackground_Paid"] ||
- [eveN isEqual:@"Reading_AddHeaderFooter_Paid"] ||
- [eveN isEqual:@"Reading_RemoveHeaderFooter_Paid"] ||
- [eveN isEqual:@"Reading_AddBates_Paid"] ||
- [eveN isEqual:@"Reading_RemoveBates_Paid"] ||
- [eveN isEqual:@"Reading_Measure_Paid"]) {
- return @{@"" : @""};
- }
- // Paid_Editor Home_Editor
- else if ([eveN isEqual:@"Onbrd_Compare_Paid"] ||
- [eveN isEqual:@"Onbrd_Background_Paid"] ||
- [eveN isEqual:@"Onbrd_Watermard_Paid"] ||
- [eveN isEqual:@"Onbrd_HeaderFooter_Paid"] ||
- [eveN isEqual:@"Onbrd_Bates_Paid"] ||
- [eveN isEqual:@"Onbrd_Security_Paid"]) {
- return @{@"Paid_Editor" : @"Home_Editor"};
- }
- // Paid_Converter SubTbr_Converter
- else if ([eveN isEqual:@"Reading_PDFtoWord_Paid"] ||
- [eveN isEqual:@"Reading_PDFtoExcel_Paid"] ||
- [eveN isEqual:@"Reading_PDFtoPPT_Paid"] ||
- [eveN isEqual:@"Reading_PDFtoRTF_Paid"] ||
- [eveN isEqual:@"Reading_PDFtoCSV_Paid"] ||
- [eveN isEqual:@"Reading_PDFtoText_Paid"] ||
- [eveN isEqual:@"Reading_PDFtoImage_Paid"] ||
- [eveN isEqual:@"Reading_ExtractImage_Paid"]) {
- return @{@"Paid_Converter" : @"SubTbr_Converter"};
- }
- // Paid_Converter Home_Converter
- else if ([eveN isEqual:@"Onbrd_ConvertPDF_Paid"] ||
- [eveN isEqual:@"Onbrd_PDFtoWord_Paid"] ||
- [eveN isEqual:@"Onbrd_PDFtoExcel_Paid"] ||
- [eveN isEqual:@"Onbrd_PDFtoPPT_Paid"] ||
- [eveN isEqual:@"Onbrd_ImagetoPDF_Paid"]) {
- return @{@"Paid_Converter" : @"Home_Converter"};
- }
- // Paid_Form SubTbr_Forms
- else if ([eveN isEqual:@"Reading_TextField_Paid"] ||
- [eveN isEqual:@"Reading_CheckBox_Paid"] ||
- [eveN isEqual:@"Reading_RadioButton_Paid"] ||
- [eveN isEqual:@"Reading_ListBox_Paid"] ||
- [eveN isEqual:@"Reading_ComboBox_Paid"] ||
- [eveN isEqual:@"Reading_Button_Paid"]) {
- return @{@"Paid_Form" : @"SubTbr_Forms"};
- }
- // Paid_Sign SunTbr_Signature
- else if ([eveN isEqual:@"Reading_FillSign_Signature_Paid"] ||
- [eveN isEqual:@"Reading_DigitalSign_Paid"] ||
- [eveN isEqual:@"Reading_ElectronicSign_Paid"]) {
- return @{@"Paid_Sign" : @"SunTbr_Signature"};
- }
- // Paid_EditPDF Tbr_Edit PDF
- else if ([eveN isEqual:@"Reading_EditPDF_Paid"] ||
- [eveN isEqual:@"Reading_ReplaceText_Paid"]) {
- return @{@"Paid_EditPDF" : @"Tbr_Edit PDF"};
- }
- // Paid_Redact Tbr_Redact
- else if ([eveN isEqual:@"Reading_Redact_Paid"]) {
- return @{@"Paid_Redact" : @"Tbr_Redact"};
- }
- // Paid_OCR SubTbr_OCR
- else if ([eveN isEqual:@"Reading_OCR_Paid"] ||
- [eveN isEqual:@"Reading_Convert_OCR_Paid"] ||
- [eveN isEqual:@"Onbrd_OCR_Paid"]) {
- return @{@"Paid_OCR" : @"SubTbr_OCR"};
- }
- // Paid_PageDisplay SubTbr_Page Display
- else if ([eveN isEqual:@"Reading_SplitView_Paid"] ||
- [eveN isEqual:@"Reading_Rotate_Paid"] ||
- [eveN isEqual:@"Reading_Theme_Paid"] ||
- [eveN isEqual:@"Reading_MultiTab_Paid"]) {
- return @{@"Paid_PageDisplay" : @"SubTbr_Page Display"};
- }
- // Home_Others
- else if ([eveN isEqual:@"Onbrd_PrintPoster_Paid"] ||
- [eveN isEqual:@"Onbrd_PrintMultiple_Paid"] ||
- [eveN isEqual:@"Onbrd_PrintBooklet_Paid"]) {
- return @{@"Paid_Others" : @"Home_Others"};
- }
- // Paid_Others SubTbr_Others
- else if ([eveN isEqual:@"Reading_Flatten_Paid"]) {
- return @{@"Paid_Others" : @"SubTbr_Others"};
- }
- // Paid_Others MenuBar_Others
- else if ([eveN isEqual:@"MenuBar_PrintPoster_Paid"] ||
- [eveN isEqual:@"MenuBar_PrintMultiple_Paid"] ||
- [eveN isEqual:@"MenuBar_PrintBooklet_Paid"]) {
- return @{@"Paid_Others" : @"MenuBar_Others"};
- }
- return nil;
- }
- @end
|