forked from jfro/BCAchievementNotification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BCAchievementNotificationCenter.h
81 lines (68 loc) · 2.82 KB
/
BCAchievementNotificationCenter.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
//
// BCAchievementNotificationCenter.h
//
// Created by Benjamin Borowski on 9/30/10.
// Copyright 2010 Typeoneerror Studios. All rights reserved.
// $Id$
//
#import <Foundation/Foundation.h>
#import "BCAchievementViewProtocol.h"
/**
* Game Center has a notification window that slides down and informs the GKLocalPlayer
* that they've been authenticated. The BCAchievementNotificationView classes are a way to
* display achievements awarded to the player in the same manner; more similar to Xbox Live
* style achievement popups. The achievement dialogs are added to the UIWindow view of your application.
*
* The BCAchievementHandler is a singleton pattern that you can use to
* notify the user anywhere in your application that they earned an achievement.
*/
@interface BCAchievementNotificationCenter : NSObject
{
UIView *_topView; /**< Reference to top view of UIApplication. */
UIView *_containerView;
NSMutableArray *_queue; /**< Queue of achievement notifiers to display. */
UIImage *image; /**< Logo to display in notifications. */
UIViewContentMode viewDisplayMode; /**< Where on screen views will show up, top, top left, top right, etc. Default UIViewContentModeTop */
CGSize defaultViewSize;
UIImage *defaultBackgroundImage;
Class viewClass;
}
/** Logo to display in notifications. */
@property (nonatomic) UIImage *image;
@property (nonatomic) UIImage *defaultBackgroundImage;
/**
* View content mode value to control where the views will show on the screen, defaults to top
*/
@property (nonatomic, assign) UIViewContentMode viewDisplayMode;
/**
* Default size for handler created views
*/
@property (nonatomic, assign) CGSize defaultViewSize;
@property (nonatomic, assign) Class viewClass;
@property (nonatomic, assign) BOOL playSounds;
/**
* Returns a reference to the singleton BCAchievementHandler.
* @return a single BCAchievementHandler.
*/
+ (BCAchievementNotificationCenter *)defaultCenter;
/**
* Returns a rect that's been properly adjusted for device orientation
*/
+ (CGRect)containerRect;
/**
* Queues a manually created notificatoin view for display. Immediately displays if queue is empty
* @param notification A BCAchievementNotificationView configured and ready for display
*/
- (void)queueNotification:(UIView<BCAchievementViewProtocol> *)notification;
/**
* Show an achievement notification with an actual achievement.
* @param achievement Achievement description object to notify user of.
*/
- (void)notifyWithAchievementDescription:(GKAchievementDescription *)achievement;
/**
* Show an achievement notification with a message manually added.
* @param title The title of the achievement.
* @param message Description of the achievement.
*/
- (void)notifyWithTitle:(NSString *)title message:(NSString *)message image:(UIImage *)anImage;
@end