-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGMNGrowl_Prefix.pch
193 lines (159 loc) · 8.36 KB
/
GMNGrowl_Prefix.pch
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
//
// Prefix header for all source files of the 'GMNGrowl' target in the 'GMNGrowl' project.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
// Lets us optimize away.
#define GMNDebugMode 1
#if GMNDebugMode == 1
# define GMNLog(fmt, ...) NSLog(fmt, ## __VA_ARGS__)
#else
# define GMNLog(fmt, ...)
#endif
#ifndef __has_feature // Optional.
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef NS_RETURNS_RETAINED
#if __has_feature(attribute_ns_returns_retained)
#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
#else
#define NS_RETURNS_RETAINED
#endif
#endif
#ifndef CF_RETURNS_RETAINED
#if __has_feature(attribute_cf_returns_retained)
#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
#else
#define CF_RETURNS_RETAINED
#endif
#endif
/** The following enables a feature where Growler for Google Notifier will not show a notification
*** for a message that has been shown before. It was decided to leave this feature
*** out, since even if Growler for Google Notifier's part works, this obviously doesn't cancel
*** Google Notifier's own number+icon thing in the menu bar, or the sound it plays
*** on received mails, if any. As such this would be inconsistent and confusing.
*** It's there for the enabling, though, if you think you can stand it.
***
*** Added in 1.1. */
#define CompileJustNotifyOnceSupport 0
/** The following is Growler for Google Notifier's support for custom notification
*** formats. Any 'message dict key' placeholder will be substituted for its
*** respective value when the notifications are shown. Dates will also be
*** converted into the short system default format.
***
*** The brave and/or foolhardy may choose to change the placeholder's format
*** in this one place, as the rest of the defines just uses that define to
*** implement their static selves.
***
*** Added in 1.1. */
// Split into many parts because modern Xcode treats placeholders with this syntax as placeholder tokens.
#define GMNGrowlDictPlaceholderPrefix @"<" @"#"
#define GMNGrowlDictPlaceholderSuffix @"#" @">"
#define MAKEPLACEHOLDER(A) [NSString stringWithFormat:@"%@%@%@", GMNGrowlDictPlaceholderPrefix, A, GMNGrowlDictPlaceholderSuffix]
#define ISPLACEHOLDER(A) ([A hasPrefix:GMNGrowlDictPlaceholderPrefix] && [A hasSuffix:GMNGrowlDictPlaceholderSuffix])
#pragma mark Gmail Message defines
#define GmailMessageDictAuthorEmailKey @"authorEmail"
#define GmailMessageDictAuthorNameKey @"authorName"
#define GmailMessageDictMailUUIDKey @"identifier"
#define GmailMessageDictDateIssuedKey @"issued"
#define GmailMessageDictDateModifiedKey @"modified"
#define GmailMessageDictSummaryKey @"summary"
#define GmailMessageDictTitleKey @"title"
#define GmailMessageDictLinkKey @"link"
/** The above GmailMessageDict defines are keys in the message dictionary format
*** used in the -newMessagesReceived:fullCount: method. Each item in the messages
*** array is a dictionary that has items with those keys.
***
*** Here's what an NSLogged dictionary could look like:
*** (everything is an NSString unless otherwise noted) */
// authorEmail = [email address];
// authorName = [your nickname];
// identifier = "tag:gmail.google.com,2004:XXXXXXXXXXXXXX";
// issued = 2005-09-02 18:54:45 +0000; // NSDate
// modified = 2005-09-02 18:54:45 +0000; // NSDate
// summary = "bar /Jesper";
// title = foo;
// link = [URL string to Gmail message];
#pragma mark Google Calendar Event defines
// Actual keys used in the calendar event dictionary
#define GCalEventDictAuthorEmailKey @"authorEmail"
#define GCalEventDictAuthorNameKey @"authorName"
#define GCalEventDictEventUUIDKey @"identifier"
#define GCalEventDictDateIssuedKey @"issued"
#define GCalEventDictDateModifiedKey @"modified"
#define GCalEventDictTitleKey @"title"
#define GCalEventDictEventStatusKey @"eventStatus"
#define GCalEventDictLinkKey @"link"
#define GCalEventDictNotifyTimeKey @"notifyTime"
#define GCalEventDictStartTimeKey @"startTime"
#define GCalEventDictStopTimeKey @"stopTime"
#define GCalEventDictWhereKey @"where"
#define GCalEventDictSummaryKey @"summary"
// "Auto" keys; generated by Growler for Google Notifier
#define GCalEventAutoEventTimeKey @"-eventTime"
#define GCalEventAutoWhereSummaryKey @"-whereSummary"
#define GCalEventAutoSummaryWhereKey @"-summaryWhere"
/** Here's the equivalent calendar dictionary. */
// authorEmail = [email address string];
// authorName = [your nickname string];
// eventStatus = confirmed;
// identifier = [URL string to Calendar event containing /feeds/ and the email address];
// issued = 2007-09-10 17:45:57 +0000; // NSDate
// link = [URL string to Calendar event starting with "http://www.google.com/calendar/event?eid="];
// modified = 2007-09-10 17:46:19 +0000; // NSDate
// notifyTime = 2007-09-10 19:40:00 +0200; // CalendarDateRFC3339 [see *]
// startTime = 2007-09-10 19:50:00 +0200; // CalendarDateRFC3339 [see *]
// stopTime = 2007-09-10 20:50:00 +0200; // CalendarDateRFC3339 [see *]
// summary = [summary string];
// title = [title string];
// where = [place string];
//
// * (notify|start|stop)Time contains an CalendarDateRFC3339 object, containing - (BOOL)hasTime;
// if hasTime is NO, it's an all-day event.
@interface CalendarDateRFC3339 : NSDate
- (BOOL)hasTime;
@end
/** Any English "user-readable" text below is not localized because Google Notifier
*** is not yet localized itself. */
#define GMNGrowlMissingSummary @"(No summary)"
#define GMNGrowlMissingTitle @"(No title)"
#define GMNGrowlMissingAuthorName @"(No author)"
#define GMNGrowlNewMailNotification @"New Gmail (Google Notifier)"
#define GMNGrowlNewEventNotification @"New Event (Google Notifier)"
#define GMNGrowlNotificationFormatUDK @"GMNGrowlNotificationFormat"
#define GMNGrowlNotificationFormat [NSString stringWithFormat:@"New mail! \"%@\" from %@", MAKEPLACEHOLDER(GmailMessageDictTitleKey), MAKEPLACEHOLDER(GmailMessageDictAuthorNameKey)]
#define GMNGrowlNotificationTextFormatUDK @"GMNGrowlNotificationTextFormat"
#define GMNGrowlNotificationTextFormat [NSString stringWithFormat:@"%@", MAKEPLACEHOLDER(GmailMessageDictSummaryKey)]
#define GMNGrowlEventNotificationFormatUDK @"GMNGrowlEventNotificationFormat"
#define GMNGrowlEventNotificationFormat [NSString stringWithFormat:@"%@ %@", MAKEPLACEHOLDER(GCalEventDictTitleKey), MAKEPLACEHOLDER(GCalEventAutoEventTimeKey)]
#define GMNGrowlEventNotificationTextFormatUDK @"GMNGrowlEventNotificationTextFormat"
#define GMNGrowlEventNotificationTextFormat [NSString stringWithFormat:@"%@", MAKEPLACEHOLDER(GCalEventAutoWhereSummaryKey)]
#define GMNGrowlDontUseABIconsUDK @"GMNGrowlDontUseABIcons"
#define GMNGrowlDontUseABIcons NO
#define GMNGrowlDontShowOnClickUDK @"GMNGrowlDontShowOnClick"
#define GMNGrowlDontShowOnClick NO
#define GMNGrowlEventDontShowOnClickUDK @"GMNGrowlEventDontShowOnClick"
#define GMNGrowlEventDontShowOnClick NO
#define GMNGrowlShowInWhichBrowserUDK @"GMNGrowlShowInWhichBrowser"
#define GMNGrowlShowInWhichBrowser @""
#define GMNGrowlEventShowInWhichBrowserUDK @"GMNGrowlEventShowInWhichBrowser"
#define GMNGrowlEventShowInWhichBrowser @""
#define GMNGrowlMaxNotificationsCapUDK @"GMNGrowlMaxNotificationsCap"
#define GMNGrowlMaxNotificationsCap 6
#define GMNGrowlEventMaxNotificationsCapUDKUDK @"GMNGrowlEventMaxNotificationsCapUDK"
#define GMNGrowlEventMaxNotificationsCapUDK 6
#define GMNGrowlMailEnabledUDK @"GMNGrowlMailEnabled"
#define GMNGrowlMailEnabled YES
#define GMNGrowlEventEnabledUDK @"GMNGrowlEventEnabled"
#define GMNGrowlEventEnabled YES
#define GMNGrowlDisabledUDK @"GMNGrowlDisabled"
#define GMNGrowlDisabled NO
#if CompileJustNotifyOnceSupport
# define GMNGrowlJustNotifyOnceUDK @"GMNGrowlJustNotifyOnce"
# define GMNGrowlJustNotifyOnceListUDK @"GMNGrowlJustNotifyOnceList"
#endif
#define GrowlUpdateTitle @"Growl can be updated to a newer version"
#define GrowlUpdateInfo @"Growl can automatically be updated to a newer version than the one currently installed. No download is necessary."
#define GrowlInstallTitle @"Growl wasn't found, but can be installed"
#define GrowlInstallInfo @"Growler for Google Notifier depends on the tool Growl to display notifications when new mails are received. Growl isn't currently installed but can automatically be installed for you. No download is necessary."