Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 183 lines (113 sloc) 7.543 kb
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
1 /*
2 iMedia Browser Framework <http://karelia.com/imedia/>
3
5721575 @danwood Noticed formatting on license prelude was wonky in some files. so I fixe...
danwood authored
4 Copyright (c) 2005-2012 by Karelia Software et al.
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
5
6 iMedia Browser is based on code originally developed by Jason Terhorst,
7 further developed for Sandvox by Greg Hulands, Dan Wood, and Terrence Talbot.
5135f23 Updated file header to include new contributor name
Peter Baumgartner authored
8 The new architecture for version 2.0 was developed by Peter Baumgartner.
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
9 Contributions have also been made by Matt Gough, Martin Wennerberg and others
10 as indicated in source files.
11
12 The iMedia Browser Framework is licensed under the following terms:
13
14 Permission is hereby granted, free of charge, to any person obtaining a copy
15 of this software and associated documentation files (the "Software"), to deal
16 in all or substantial portions of the Software without restriction, including
17 without limitation the rights to use, copy, modify, merge, publish,
18 distribute, sublicense, and/or sell copies of the Software, and to permit
19 persons to whom the Software is furnished to do so, subject to the following
20 conditions:
21
22 Redistributions of source code must retain the original terms stated here,
23 including this list of conditions, the disclaimer noted below, and the
5721575 @danwood Noticed formatting on license prelude was wonky in some files. so I fixe...
danwood authored
24 following copyright notice: Copyright (c) 2005-2012 by Karelia Software et al.
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
25
26 Redistributions in binary form must include, in an end-user-visible manner,
27 e.g., About window, Acknowledgments window, or similar, either a) the original
28 terms stated here, including this list of conditions, the disclaimer noted
29 below, and the aforementioned copyright notice, or b) the aforementioned
30 copyright notice and a link to karelia.com/imedia.
31
32 Neither the name of Karelia Software, nor Sandvox, nor the names of
33 contributors to iMedia Browser may be used to endorse or promote products
34 derived from the Software without prior and express written permission from
35 Karelia Software or individual contributors, as appropriate.
36
37 Disclaimer: THE SOFTWARE IS PROVIDED BY THE COPYRIGHT OWNER AND CONTRIBUTORS
38 "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
39 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
40 AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
41 LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF
42 CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH, THE
43 SOFTWARE OR THE USE OF, OR OTHER DEALINGS IN, THE SOFTWARE.
44 */
45
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
46
135075f Added an author line in the header of each source file. This is done to ...
Peter Baumgartner authored
47 // Author: Peter Baumgartner
48
49
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
50 //----------------------------------------------------------------------------------------------------------------------
51
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
52
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
53 #pragma mark HEADERS
54
55 #import "IMBCommon.h"
56
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
57
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
58 //----------------------------------------------------------------------------------------------------------------------
59
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
60
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
61 @class IMBNode;
a9e5177 • Bugfixes in node creation of various parsers
Peter Baumgartner authored
62 @class IMBObject;
8d427c5 @mikeabdullah Pluralize to be IMBObjectsPromise etc.
mikeabdullah authored
63 @class IMBObjectsPromise;
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
64
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
65
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
66 //----------------------------------------------------------------------------------------------------------------------
67
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
68
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
69 #pragma mark
70
71 @protocol IMBParserProtocol
72
aab4165 • The library delegate can now intercept and deny selection or expansion...
Peter Baumgartner authored
73 @required
74
6672cc9 • Renamed IMBMTPParser to IMBImageCaptureParser
Peter Baumgartner authored
75 // This factory method creates parser instances. Usually just return a single instance, but subclasses may
76 // opt to return more than one instance (e.g. Aperture may create one parser instance per library)...
77
78 + (NSArray*) parserInstancesForMediaType:(NSString*)inMediaType;
79
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
80 // The media source is usually a path pointing to the folder or database, but it could be an NSURL as well.
81 // However, it is always stored as a string, so that putting it into property lists (prefs) is easier...
82
62314d0 @mikeabdullah .mediaSource is also a string, and so should be copied.
mikeabdullah authored
83 @property (copy) NSString* mediaSource;
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
84
c48c6b0 Renamed method -didDeselectParser to -didStopUsingParser to make intent ...
Peter Baumgartner authored
85 // The mediaType can be @"image",@"audio",@"movie",etc. IMBCommon.h contains constants for the type...
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
86
221283d @mikeabdullah Make IMBParser.mediaType readonly.
mikeabdullah authored
87 @property (copy, readonly) NSString* mediaType;
6672cc9 • Renamed IMBMTPParser to IMBImageCaptureParser
Peter Baumgartner authored
88 @property (getter=isCustom) BOOL custom;
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
89
90 // ATTENTION: inOldNode is readonly and is only passed in for reference, but must not be modified by the parser in
91 // a background operation. It is passed as an argument to the parser so that existing old nodes can be recreated
42d71de Fixed a memory leak that Christoph discovered with Clang. New nodes were...
Peter Baumgartner authored
92 // as faithfully as possible. Must return an autoreleased object...
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
93
42d71de Fixed a memory leak that Christoph discovered with Clang. New nodes were...
Peter Baumgartner authored
94 - (IMBNode*) nodeWithOldNode:(const IMBNode*)inOldNode options:(IMBOptions)inOptions error:(NSError**)outError;
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
95 - (BOOL) populateNode:(IMBNode*)inNode options:(IMBOptions)inOptions error:(NSError**)outError;
96
7c904f9 Added IMBObjectPromise abstraction so that framework and client app can ...
Peter Baumgartner authored
97 // Returns a promise object that is appropriate for a given parser type. The default implemenation simply returns
8d427c5 @mikeabdullah Pluralize to be IMBObjectsPromise etc.
mikeabdullah authored
98 // an IMBLocalObjectsPromise. Parsers that require something else must override this method...
7c904f9 Added IMBObjectPromise abstraction so that framework and client app can ...
Peter Baumgartner authored
99
8d427c5 @mikeabdullah Pluralize to be IMBObjectsPromise etc.
mikeabdullah authored
100 - (IMBObjectsPromise*) objectPromiseWithObjects:(NSArray*)inObjects;
7c904f9 Added IMBObjectPromise abstraction so that framework and client app can ...
Peter Baumgartner authored
101
aab4165 • The library delegate can now intercept and deny selection or expansion...
Peter Baumgartner authored
102 @optional
103
885c470 @danwood Bringing over the "i" info and window flipper
danwood authored
104 // Called just after notifying the app delegate; gives parser a chance to decide not to be used.
105
106 - (BOOL)canBeUsed;
107
aab4165 • The library delegate can now intercept and deny selection or expansion...
Peter Baumgartner authored
108 // Called in various situations just before a parser is going to be used. Can be used to prepare the instance
109 // or update cached data...
110
111 - (void) willUseParser;
112
113 // Called after a node was deselected. The parser can release its cached data (if present)...
114
c48c6b0 Renamed method -didDeselectParser to -didStopUsingParser to make intent ...
Peter Baumgartner authored
115 - (void) didStopUsingParser;
aab4165 • The library delegate can now intercept and deny selection or expansion...
Peter Baumgartner authored
116
d7e7c2f Improved persistence algorithms. Expanded and selected nodes are now res...
Peter Baumgartner authored
117 // Called when a file watcher fires and it concerns a parser. Also gives a parser a chance to update any cached data...
aab4165 • The library delegate can now intercept and deny selection or expansion...
Peter Baumgartner authored
118
119 - (void) watchedPathDidChange:(NSString*)inWatchedPath;
120
a9e5177 • Bugfixes in node creation of various parsers
Peter Baumgartner authored
121 // Called when the icon size in the object view has changed. Parsers may use this callback to change the thumbnails
122 // of the IMBObjects they create. At first they may want to supply small thumbnails so it's faster, but as a user
123 // zooms the icons, the parser may want to supply larger thumbnails...
124
e4cb0b7 Added new method to parser protocol to enable custom clicking behavior. ...
Peter Baumgartner authored
125 - (void) didChangeIconSize:(NSSize)inSize objectView:(NSView*)inView;
126
1ff1fa5 @danwood initial firefox node created now
danwood authored
127 // Called when the thumbnail for an object needs to be loaded lazily. This method will be called on a background thread...
9a8da26 • Renamed some classes
Peter Baumgartner authored
128
cb36f87 @zykloman Made loadThumbnailForObject return the generated thumbnail image. This w...
zykloman authored
129 - (id) loadThumbnailForObject:(IMBObject*)inObject;
9a8da26 • Renamed some classes
Peter Baumgartner authored
130
15e8981 Improved metadata loading mechanism. Metadata that is available immediat...
Peter Baumgartner authored
131 // Called when metadata for an object needs to be loaded lazily. This method may be called on a background thread...
c07b9a5 • Added lazy loading capability of object metadata. This mechanism is cu...
Peter Baumgartner authored
132
133 - (void) loadMetadataForObject:(IMBObject*)inObject;
134
1448a9f Refactored IMBObjectThumbnailLoadOperation. The meat of the main method ...
Peter Baumgartner authored
135 // Called when the user right-clicks on a node in the IMBOutlineView. Here the parser has a chance to add custom
136 // menu items of its own, that go beyond the functionality of the standard items added by the controllers...
137
138 - (void) willShowContextMenu:(NSMenu*)inMenu forNode:(IMBNode*)inNode;
139 - (void) willShowContextMenu:(NSMenu*)inMenu forObject:(IMBObject*)inObject;
140
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
141 @end
142
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
143
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
144 //----------------------------------------------------------------------------------------------------------------------
145
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
146
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
147 #pragma mark
148
149 @interface IMBParser : NSObject <IMBParserProtocol>
150 {
2b015aa @mikeabdullah make ivars @private
mikeabdullah authored
151 @private
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
152 NSString* _mediaSource;
153 NSString* _mediaType;
154 BOOL _custom;
155 }
156
b53cfef Changed dedicated initializer of IMBParser to initWithMediaType:
Peter Baumgartner authored
157 - (id) initWithMediaType:(NSString*)inMediaType;
aab4165 • The library delegate can now intercept and deny selection or expansion...
Peter Baumgartner authored
158 - (NSString*) identifierForPath:(NSString*)inPath;
3405d55 @danwood Add a display priority to IMBNode so that special folders like ~/Picture...
danwood authored
159 + (NSString*) identifierForPath:(NSString*)inPath;
8317d09 Added populateNewNode:likeOldNode:options: convienience method to IMBPar...
Peter Baumgartner authored
160
3779eba Added mechnism and methods to dynamically reload thumbnails as icons are...
Peter Baumgartner authored
161 - (void) invalidateThumbnails;
3e40835 @danwood Checked in Jörg's beta 3 of skimming. It's pretty close. We may need to...
danwood authored
162 - (IMBNode*) nodeWithIdentifier:(NSString*)inIdentifier;
8317d09 Added populateNewNode:likeOldNode:options: convienience method to IMBPar...
Peter Baumgartner authored
163 - (void) populateNewNode:(IMBNode*)inNewNode likeOldNode:(const IMBNode*)inOldNode options:(IMBOptions)inOptions;
1448a9f Refactored IMBObjectThumbnailLoadOperation. The meat of the main method ...
Peter Baumgartner authored
164
735efc1 Implemented new mechanism for custom header/object/footer views. Custom ...
Peter Baumgartner authored
165 // Controls whether object views should be installed for a given node...
166
167 - (BOOL) shouldDisplayObjectViewForNode:(IMBNode*)inNode;
168
169 // Nodes that do not want the standard object views can use custom user intefaces. The following methods provide
170 // the mechanics of creating custom view controllers Subclasses should override them to return an appropriate
171 // view controller...
172
173 - (NSViewController*) customHeaderViewControllerForNode:(IMBNode*)inNode;
174 - (NSViewController*) customObjectViewControllerForNode:(IMBNode*)inNode;
175 - (NSViewController*) customFooterViewControllerForNode:(IMBNode*)inNode;
176
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
177 @end
178
735efc1 Implemented new mechanism for custom header/object/footer views. Custom ...
Peter Baumgartner authored
179
614486a Initial draft for iMedia2. This is very much in an experimental stage an...
Peter Baumgartner authored
180 //----------------------------------------------------------------------------------------------------------------------
181
519de1b • All images in the NSSegmentControl of an IMBObjectController are now s...
Peter Baumgartner authored
182
Something went wrong with that request. Please try again.