-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGeniusDocument.h
More file actions
114 lines (86 loc) · 4.56 KB
/
GeniusDocument.h
File metadata and controls
114 lines (86 loc) · 4.56 KB
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
114
/*
Genius
Copyright (C) 2003-2006 John R Chang
Copyright (C) 2007-2008 Chris Miner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
http://www.gnu.org/licenses/gpl.txt
*/
#import <Cocoa/Cocoa.h>
@class GeniusArrayController;
@class GeniusPair;
@class GSTableView;
//! Standard NSDocument subclass for controlling interaction between UI and GeniusPair list.
@interface GeniusDocument : NSDocument
{
IBOutlet GSTableView *tableView; //!< The main table showing the GeniusPair items.
IBOutlet GeniusArrayController *arrayController; //!< The controller holding the displayed items.
IBOutlet NSTextField *statusField; //!< Shows selection count and total items.
IBOutlet NSTextField *levelField; //!< Displays percentage of items with any score.
IBOutlet NSLevelIndicator *levelIndicator; //!< Displays level information as bar.
IBOutlet NSDrawer *infoDrawer; //!< Drawer where you can set group and type info.
IBOutlet NSDrawer *notesDrawer; //!< Drawer at bottom of window with GeniusPair notes.
IBOutlet NSWindow *deckPreferences; //!< Sheet for enter card side titles.
IBOutlet NSSlider *learnReviewSlider; //!< Slider used to setup Quiz mode between Learn and Review.
IBOutlet NSView *helpTextOverlay; //!< Help text displayed when table contents empty.
NSSearchField *_searchField; //!< Text field top right used for searching through GeniusPair items.
// Data model
NSMutableArray *_visibleColumnIdentifiers; //!< Identifiers of the columns that should be displayed on loading a file.
NSMutableDictionary *_columnHeadersDict; //!< Labels used for column header names.
NSMutableArray *_pairs; //!< The GeniusPair items that make up a GeniusDocument.
NSDate *_cumulativeStudyTime; //!< Not sure this is used anymore.
NSNumber *probabilityCenter; //!< balance between learning and reviewing.
// some flags
BOOL _shouldShowImportWarningOnSave; //!< Flag indicating the GeniusDocument was loaded from an older version.
NSArray *_pairsDuringDrag; //!< Temporary array of items being dragged and dropped.
NSMutableSet *_customTypeStringCache; //!< Cache of all types used in deck.
// cached values
NSArray *_sortedCustomTypeStrings; //!< Sorted array of custom types cached from Genius Pairs.
// TableView appearance
float rowHeight; //!< table view row height
float fontSize; //!< table view font size
}
- (NSArray*) pairs;
- (void) setPairs: (NSMutableArray*) values;
- (void) removeObjectFromPairsAtIndex:(int) index;
- (void) insertObject:(GeniusPair*) pair inPairsAtIndex:(int)index;
- (NSSearchField *) searchField;
- (void) _reloadCustomTypeCacheSet;
- (void) setListTextSizeMode: (int) mode;
+ (NSArray *) columnBindings;
- (void) reloadInterfaceFromModel;
@end
@interface GeniusDocument(IBActions)
// View menu
- (IBAction) toggleGroupColumn: (id) sender;
- (IBAction) toggleTypeColumn: (id) sender;
- (IBAction) toggleABScoreColumn: (id) sender;
- (IBAction) toggleBAScoreColumn: (id) sender;
- (IBAction) showInfo: (id) sender;
- (IBAction) showDeckPreferences: (id) sender;
- (IBAction) endDeckPreferences: (id) sender;
- (IBAction) add: (id) sender;
- (IBAction) duplicate: (id) sender;
- (IBAction) resetScore: (id) sender;
- (IBAction) setItemImportance: (id) sender;
- (IBAction) search: (id) sender;
- (IBAction) quizAutoPick: (id) sender;
- (IBAction) quizReview: (id) sender;
- (IBAction) quizSelection: (id) sender;
@end
@interface GeniusArrayController : NSArrayController {
NSString * _filterString; //!< The string for which we are filtering.
}
- (NSString *) filterString;
- (void) setFilterString:(NSString *)string;
@end
@interface GeniusDocument(UndoRedoSupport)
- (void) addObserver: (id) observer;
- (void) removeObserver: (id) observer;
@end