Frameworks/AIUtilities Framework/Source/AIImageCollectionView.h
author Evan Schoenberg
Thu, 14 Nov 2019 21:09:06 -0500
branchadium-1.5.11
changeset 6016 325e2ab3406f
parent 3884 3113b7777263
permissions -rw-r--r--
Fixed a bunch of warnings
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     1
/* 
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     2
 * Adium is the legal property of its developers, whose names are listed in the copyright file included
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     3
 * with this source distribution.
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     4
 * 
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     6
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     7
 * or (at your option) any later version.
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     8
 * 
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    10
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    11
 * Public License for more details.
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    12
 * 
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    13
 * You should have received a copy of the GNU General Public License along with this program; if not,
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    14
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    15
 */
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    16
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    17
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    18
@protocol AIImageCollectionViewDelegate;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    19
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    20
#pragma mark - AIImageCollectionView
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    21
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    22
/*!
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    23
 * @class AIImageCollectionView
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    24
 * @brief NSCollectionView subclass
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    25
 *
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    26
 * Displays images in a grid
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    27
 * supports item highlighting and selection
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    28
 */
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    29
@interface AIImageCollectionView : NSCollectionView {
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    30
@protected
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    31
	IBOutlet NSArrayController *itemsController;
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    32
	
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    33
	NSInteger highlightStyle;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    34
	CGFloat highlightSize;
3714
a1a587581ccb typo fix, shadowing fix, 64->32bit fixes.
Frank Dowsett <wixardy@adium.im>
parents: 3713
diff changeset
    35
	CGFloat highlightCornerRadius;
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    36
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    37
	NSUInteger highlightedIndex;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    38
}
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    39
6016
325e2ab3406f Fixed a bunch of warnings
Evan Schoenberg
parents: 3884
diff changeset
    40
@property (readwrite, assign) id <AIImageCollectionViewDelegate, NSCollectionViewDelegate> delegate;
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    41
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    42
@property (assign) IBOutlet NSArrayController *itemsController;
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    43
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    44
@property (assign) NSInteger highlightStyle;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    45
@property (assign) CGFloat highlightSize;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    46
@property (assign) CGFloat highlightCornerRadius;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    47
@property (assign) NSUInteger highlightedIndex;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    48
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    49
#pragma mark -
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    50
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    51
/*!
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    52
 * @brief Set the image for item at index
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    53
 *
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    54
 * @param <tt>NSImage</tt>
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    55
 * @param <tt>NSUInteger</tt>
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    56
 */
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    57
- (void)setImage:(NSImage *)anImage forItemAtIndex:(NSUInteger)anIndex;
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    58
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    59
@end
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    60
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    61
#pragma mark -
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    62
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    63
/*!
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    64
 * @brief AIImageCollectionViewCornerStyle
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    65
 *
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    66
 * Item & Highlight corners style, squared|rounded
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    67
 */
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    68
enum {
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    69
	AIImageCollectionViewCornerSquaredStyle = 0,
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    70
	AIImageCollectionViewCornerRoundedStyle = 1
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    71
};
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    72
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    73
typedef NSInteger AIImageCollectionViewCornerStyle;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    74
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    75
/*!
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    76
 * @brief AIImageCollectionViewHighlightStyle
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    77
 *
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    78
 * Highlight style, border|background
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    79
 */
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    80
enum {
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    81
	AIImageCollectionViewHighlightBorderStyle = 0,
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    82
	AIImageCollectionViewHighlightBackgroundStyle = 1
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    83
};
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    84
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    85
typedef NSInteger AIImageCollectionViewHighlightStyle;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    86
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    87
#pragma mark - AIImageCollectionViewDelegate
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    88
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    89
/*!
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    90
 * @protocol AIImageCollectionViewDelegate
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    91
 * @brief Sends highlighting/selection related messages to a delegate
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    92
 */
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    93
@protocol AIImageCollectionViewDelegate <NSObject>
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    94
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    95
@optional
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    96
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    97
- (BOOL)imageCollectionView:(AIImageCollectionView *)imageCollectionView shouldSelectItemAtIndex:(NSUInteger)index;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
    98
- (BOOL)imageCollectionView:(AIImageCollectionView *)imageCollectionView shouldHighlightItemAtIndex:(NSUInteger)index;
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
    99
- (BOOL)imageCollectionView:(AIImageCollectionView *)imageCollectionView shouldDeleteItemsAtIndexes:(NSIndexSet *)indexes;
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
   100
- (void)imageCollectionView:(AIImageCollectionView *)imageCollectionView didSelectItemAtIndex:(NSUInteger)index;
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
   101
- (void)imageCollectionView:(AIImageCollectionView *)imageCollectionView didHighlightItemAtIndex:(NSUInteger)index;
3884
3113b7777263 Moved AIDockIconSelectionSheet to use AIImageCollectionView (Removed AIImageGridView).
Adrian Godoroja <robotive@me.com>
parents: 3714
diff changeset
   102
- (void)imageCollectionView:(AIImageCollectionView *)imageCollectionView didDeleteItemsAtIndexes:(NSIndexSet *)indexes;
3713
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
   103
692222bbfb41 "User Picture Change" menu now uses an NSMenu making it prettier Fixes #11964 Refs #9908
Adrian Godoroja <robotive@me.com>
parents:
diff changeset
   104
@end