2011-03-20 15:16:13 +08:00
|
|
|
//
|
|
|
|
// AppController.h
|
|
|
|
// Snapback
|
|
|
|
//
|
|
|
|
// Created by Steve Cook on 4/3/06.
|
|
|
|
// Copyright 2006 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import <ApplicationServices/ApplicationServices.h>
|
|
|
|
#import "BezelWindow.h"
|
|
|
|
#import "SRRecorderControl.h"
|
|
|
|
#import "SRKeyCodeTransformer.h"
|
|
|
|
#import "JumpcutStore.h"
|
2011-08-01 21:43:33 +08:00
|
|
|
#import "SGHotKey.h"
|
2011-09-30 17:11:24 +08:00
|
|
|
#import "DBSyncPromptDelegate.h"
|
2011-03-20 15:16:13 +08:00
|
|
|
|
2011-08-02 01:02:41 +08:00
|
|
|
@class SGHotKey;
|
2011-03-20 15:16:13 +08:00
|
|
|
|
2015-05-16 22:30:26 +08:00
|
|
|
@interface AppController : NSObject <NSMenuDelegate> {
|
2011-03-20 15:16:13 +08:00
|
|
|
BezelWindow *bezel;
|
2011-08-01 21:43:33 +08:00
|
|
|
SGHotKey *mainHotKey;
|
2011-03-20 15:16:13 +08:00
|
|
|
IBOutlet SRRecorderControl *mainRecorder;
|
|
|
|
IBOutlet NSPanel *prefsPanel;
|
|
|
|
int mainHotkeyModifiers;
|
|
|
|
SRKeyCodeTransformer *srTransformer;
|
|
|
|
BOOL isBezelDisplayed;
|
|
|
|
BOOL isBezelPinned; // Currently not used
|
|
|
|
NSString *currentKeycodeCharacter;
|
|
|
|
int stackPosition;
|
|
|
|
|
|
|
|
// The below were pulled in from JumpcutController
|
|
|
|
JumpcutStore *clippingStore;
|
|
|
|
|
|
|
|
|
|
|
|
// Status item -- the little icon in the menu bar
|
|
|
|
NSStatusItem *statusItem;
|
2015-05-16 22:30:26 +08:00
|
|
|
NSString *statusItemText;
|
|
|
|
NSImage *statusItemImage;
|
|
|
|
|
2011-03-20 15:16:13 +08:00
|
|
|
// The menu attatched to same
|
|
|
|
IBOutlet NSMenu *jcMenu;
|
2011-08-11 00:09:01 +08:00
|
|
|
IBOutlet NSSlider * heightSlider;
|
|
|
|
IBOutlet NSSlider * widthSlider;
|
2011-03-20 15:16:13 +08:00
|
|
|
// A timer which will let us check the pasteboard;
|
|
|
|
// this should default to every .5 seconds but be user-configurable
|
|
|
|
NSTimer *pollPBTimer;
|
|
|
|
// We want an interface to the pasteboard
|
|
|
|
NSPasteboard *jcPasteboard;
|
|
|
|
// Track the clipboard count so we only act when its contents change
|
|
|
|
NSNumber *pbCount;
|
2015-05-16 22:30:26 +08:00
|
|
|
BOOL disableStore;
|
2011-03-20 15:16:13 +08:00
|
|
|
//stores PasteboardCount for internal Jumpcut pasteboard actions so they don't trigger any events
|
|
|
|
NSNumber *pbBlockCount;
|
|
|
|
//Preferences
|
|
|
|
NSDictionary *standardPreferences;
|
|
|
|
int jcDisplayNum;
|
|
|
|
BOOL issuedRememberResizeWarning;
|
2011-09-30 17:11:24 +08:00
|
|
|
BOOL dropboxSync;
|
|
|
|
|
|
|
|
IBOutlet NSButtonCell * dropboxCheckbox;
|
2011-03-20 15:16:13 +08:00
|
|
|
}
|
|
|
|
|
2011-09-30 17:11:24 +08:00
|
|
|
//@property(retain, nonatomic) IBOutlet NSButtonCell * dropboxCheckbox;
|
|
|
|
|
2011-03-20 15:16:13 +08:00
|
|
|
// Basic functionality
|
|
|
|
-(void) pollPB:(NSTimer *)timer;
|
|
|
|
-(BOOL) addClipToPasteboardFromCount:(int)indexInt;
|
|
|
|
-(void) setPBBlockCount:(NSNumber *)newPBBlockCount;
|
|
|
|
-(void) hideApp;
|
|
|
|
-(void) pasteFromStack;
|
|
|
|
-(void) fakeCommandV;
|
|
|
|
-(void) stackUp;
|
|
|
|
-(void) stackDown;
|
|
|
|
-(IBAction)clearClippingList:(id)sender;
|
2013-10-26 02:31:37 +08:00
|
|
|
-(IBAction)mergeClippingList:(id)sender;
|
2011-03-20 15:16:13 +08:00
|
|
|
|
|
|
|
// Stack related
|
|
|
|
-(BOOL) isValidClippingNumber:(NSNumber *)number;
|
|
|
|
-(NSString *) clippingStringWithCount:(int)count;
|
|
|
|
// Save and load
|
|
|
|
-(void) saveEngine;
|
|
|
|
-(void) loadEngineFromPList;
|
|
|
|
|
|
|
|
// Hotkey related
|
2011-08-02 01:02:41 +08:00
|
|
|
-(void)hitMainHotKey:(SGHotKey *)hotKey;
|
2011-03-20 15:16:13 +08:00
|
|
|
|
|
|
|
// Bezel related
|
2011-11-21 15:44:58 +08:00
|
|
|
-(void) updateBezel;
|
2011-03-20 15:16:13 +08:00
|
|
|
-(void) showBezel;
|
|
|
|
-(void) hideBezel;
|
|
|
|
-(void) processBezelKeyDown:(NSEvent *)theEvent;
|
|
|
|
-(void) metaKeysReleased;
|
|
|
|
|
|
|
|
// Menu related
|
|
|
|
-(void) updateMenu;
|
|
|
|
-(IBAction) processMenuClippingSelection:(id)sender;
|
|
|
|
-(IBAction) activateAndOrderFrontStandardAboutPanel:(id)sender;
|
|
|
|
|
2011-09-30 17:11:24 +08:00
|
|
|
-(BOOL) dropboxSync;
|
|
|
|
-(void)setDropboxSync:(BOOL)enable;
|
|
|
|
|
2011-03-20 15:16:13 +08:00
|
|
|
// Preference related
|
|
|
|
-(IBAction) showPreferencePanel:(id)sender;
|
|
|
|
-(IBAction) setRememberNumPref:(id)sender;
|
|
|
|
-(IBAction) setDisplayNumPref:(id)sender;
|
|
|
|
-(IBAction) setBezelAlpha:(id)sender;
|
2011-08-11 00:09:01 +08:00
|
|
|
-(IBAction) setBezelHeight:(id)sender;
|
|
|
|
-(IBAction) setBezelWidth:(id)sender;
|
2011-03-20 15:16:13 +08:00
|
|
|
-(IBAction) switchMenuIcon:(id)sender;
|
|
|
|
-(IBAction) toggleLoadOnStartup:(id)sender;
|
|
|
|
-(IBAction) toggleMainHotKey:(id)sender;
|
|
|
|
-(void) setHotKeyPreferenceForRecorder:(SRRecorderControl *)aRecorder;
|
|
|
|
|
|
|
|
@end
|