-
-
Notifications
You must be signed in to change notification settings - Fork 206
/
FlycutOperator.h
113 lines (92 loc) · 3.6 KB
/
FlycutOperator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
//
// FlycutOperator.h
// Flycut
//
// Flycut by Gennadiy Potapov and contributors. Based on Jumpcut by Steve Cook.
// Copyright 2011 General Arcade. All rights reserved.
//
// This code is open-source software subject to the MIT License; see the homepage
// at <https://github.com/TermiT/Flycut> for details.
//
// FlycutOperator owns and interacts with the FlycutStores, providing
// manipulation of the stores.
#ifndef FlycutOperator_h
#define FlycutOperator_h
#import "FlycutStore.h"
@protocol FlycutOperatorDelegate <NSObject>
@optional
- (NSString*)alertWithMessageText:(NSString*)message informationText:(NSString*)information buttonsTexts:(NSArray*)buttons;
@end
@interface FlycutOperator : NSObject <FlycutStoreDeleteDelegate> {
int stackPosition;
int favoritesStackPosition;
int stashedStackPosition;
FlycutStore *clippingStore;
FlycutStore *favoritesStore;
FlycutStore *stashedStore;
SEL saveSelector;
NSObject* saveTarget;
int displayNum;
int displayLength;
NSArray *settingsSyncList;
BOOL disableStore;
BOOL inhibitSaveEngineAfterListModification;
BOOL firstClippingsSyncAfterEnabling;
BOOL inhibitAutosaveClippings;
//Preferences
BOOL issuedRememberResizeWarning;
}
// Basic functionality
-(int)indexOfClipping:(NSString*)contents ofType:(NSString*)type fromApp:(NSString *)appName withAppBundleURL:(NSString *)bundleURL;
-(bool)addClipping:(NSString*)contents ofType:(NSString*)type fromApp:(NSString *)appName withAppBundleURL:(NSString *)bundleURL target:(id)selectorTarget clippingAddedSelector:(SEL)clippingAddedSelectorclippingAddedSelector;
-(int)stackPosition;
-(NSString*)getPasteFromStackPosition;
-(NSString*)getPasteFromIndex:(int) position;
-(bool) saveFromStack;
-(bool)clearItemAtStackPosition;
-(void)clearList;
-(void)mergeList;
// Stack position manipulation functionality
-(bool)setStackPositionToOneMoreRecent;
-(bool)setStackPositionToOneLessRecent;
-(bool)setStackPositionToFirstItem;
-(bool)setStackPositionToLastItem;
-(bool)setStackPositionToTenMoreRecent;
-(bool)setStackPositionToTenLessRecent;
-(bool)setStackPositionTo:(int) newStackPosition;
-(void)adjustStackPositionIfOutOfBounds;
-(bool)stackPositionIsInBounds;
// Stack related
-(BOOL) isValidClippingNumber:(NSNumber *)number;
-(NSString *) clippingStringWithCount:(int)count;
// Save and load
-(void) saveEngine;
-(bool) loadEngineFromPList;
-(void) registerOrDeregisterICloudSync;
-(void) checkCloudKitUpdates;
// Preference related
-(void) willShowPreferences;
-(int) setRememberNum:(int)newRemember forPrimaryStore:(BOOL) isPrimaryStore;
// Initialization / cleanup related
-(void)applicationWillTerminate;;
-(void)awakeFromNibDisplaying:(int) displayNum withDisplayLength:(int) displayLength withSaveSelector:(SEL) selector forTarget:(NSObject*) target;
// Favorites Store related
-(bool)favoritesStoreIsSelected;
-(void)switchToFavoritesStore;
-(bool)restoreStashedStore;
-(void)toggleToFromFavoritesStore;
-(bool)saveFromStackToFavorites;
// Clippings Store related
-(int)jcListCount;
-(int)rememberNum;
-(FlycutClipping*)clippingAtStackPosition;
-(NSArray *) previousDisplayStrings:(int)howMany containing:(NSString*)search;
-(NSArray *) previousIndexes:(int)howMany containing:(NSString*)search; // This method is in newest-first order.
-(void)setDisableStoreTo:(bool) value;
-(bool)storeDisabled;
-(void)setClippingsStoreDelegate:(id<FlycutStoreDelegate>) delegate;
-(void)setFavoritesStoreDelegate:(id<FlycutStoreDelegate>) delegate;
/** optional delegate (not retained) */
@property (nonatomic, nullable, assign) id<FlycutOperatorDelegate> delegate;
@end
#endif /* FlycutOperator_h */