This repository has been archived by the owner on Jan 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ApplicationConstants.h
337 lines (278 loc) · 14.9 KB
/
ApplicationConstants.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
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
//
// Copyright (c) 2008-2011, Mark Lussier
// http://github.com/intabulas/ipivotal
// All rights reserved.
//
// This software is released under the terms of the BSD License.
// http://www.opensource.org/licenses/bsd-license.php
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the distribution.
// * Neither the name of iPivotal nor the names of its contributors may be used
// to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
// OF THE POSSIBILITY OF SUCH DAMAGE.
//
/* Logging */
#define PTLog(__FORMAT__, ...) NSLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
/* Memory Managment */
#if DEBUG
#define RELEASE_SAFELY(__INSTANCE) [__INSTANCE release]
#else
#define RELEASE_SAFELY(__INSTANCE) [__INSTANCE release], __INSTANCE = nil
#endif
/* Database */
#define DATABASE_FILE_NAME @"ptcruiser.sqlite"
//#define CACHED_CONTENT
#define LOG_NETWORK 0
#define LOG_CONTENT 0
#define NO_COMPRESS_RESPONSE 0
#define SHOW_CURL_VERSION 0
#define kTagStory @"story"
#define kTagId @"id"
#define kTagGuid @"guid"
#define kTagStoryType @"story_type"
#define kTagUrl @"url"
#define kTagEstimate @"estimate"
#define kTagCurrentState @"current_state"
#define kTagDescription @"description"
#define kTagName @"name"
#define kTagRequestedBy @"requested_by"
#define kTagOwnedBy @"owned_by"
#define kTagCreatedAt @"created_at"
#define kTagUpdatedAt @"updated_at"
#define kTagAcceptedAt @"accepted_at"
#define kTagDeadline @"deadline"
#define kTagProject @"project"
#define kTagIterationLength @"iteration_length"
#define kTagWeekStartDay @"week_start_day"
#define kTagpPointScale @"point_scale"
#define kTagIteration @"iteration"
#define kTagNumber @"number"
#define kTagStart @"start"
#define kTagFinish @"finish"
#define kTagAuthor @"author"
#define kTagWhen @"when"
#define kTagLabels @"labels"
#define kTagActivity @"activity"
#define kTagNote @"note"
#define kTagText @"text"
#define kTagNotedAt @"noted_at"
#define kTagTask @"task"
#define kTagPosition @"position"
#define kTagComplete @"complete"
#define kTagMembership @"membership"
#define kTagVelocityScheme @"velocity_scheme"
#define kTagCurrentVelocity @"current_velocity"
#define kTagInitialVelocity @"initial_velocity"
#define kTagNumberOfDoneInterations @"number_of_done_iterations_to_show"
#define kTagAllowsAttachments @"allow_attachments"
#define kTagPublic @"public"
#define kTagUseHttps @"use_https"
#define kTagBugAndChoresAreEstimatable @"bugs_and_chores_are_estimatable"
#define kTagCommitMode @"commit_mode"
#define kTagRole @"role"
#define kTagIntegration @"integration" // integrations
#define kTagActive @"active" // integrations
#define kTagTitle @"title" // integrations
#define kTagInitials @"initials" // membership
#define kTagEmail @"email" // membership
#define kTagLastActivityAt @"last_activity_at" // project
#define kTagOccuredAt @"occurred_at"
#define kTagVersion @"version" //activity
#define kTagEventType @"event_type" //activity
#define kTagProjectId @"project_id"
#define kTagLighthouseId @"lighthouse_id"
#define kTagLighthouseUrl @"lighthouse_url"
#define kTagAttachment @"attachment"
#define kTagFilename @"filename"
#define kTagUploadedBy @"uploaded_by"
#define kTagUploadedAt @"uploaded_at"
#define kBooleanTrue @"true"
#define kBooleanFalse @"false"
#define kDefaultsApiToken @"apiToken"
#define kDefaultsMyId @"MyId"
#define kTrackerTokenHeader @"X-TrackerToken"
#define kTypeDone @"done"
#define kTypeCurrent @"current"
#define kTypeBacklog @"backlog"
#define kTypeIcebox @"icebox"
#define kTypeFeature @"Feature"
#define kTypeBug @"Bug"
#define kTypeChore @"Chore"
#define kTypeRelease @"Release"
#define kMatchFeature @"feature"
#define kMatchBug @"bug"
#define kMatchChore @"chore"
#define kMatchRelease @"release"
#define kStateAccepted @"accepted"
#define kStateStarted @"started"
#define kStateDelivered @"delivered"
#define kStateUnStarted @"unstarted"
#define kStateUnScheduled @"unscheduled"
#define kStateRelease @"release"
#define kStateFinished @"finished"
#define kStateRejected @"rejected"
#define kPivotalTrackerHost @"www.apple.com"
#define kUrlRetrieveToken @"https://www.pivotaltracker.com/services/v3/tokens/active"
#define kUrlProjectList @"https://www.pivotaltracker.com/services/v3/projects"
#define kUrlIterationList @"https://www.pivotaltracker.com/services/v3/projects/%d/iterations"
#define kUrlIterationTypeList @"https://www.pivotaltracker.com/services/v3/projects/%d/iterations/%@"
#define kUrlActivityStream @"https://www.pivotaltracker.com/services/v3/activities"
#define kUrlProjectActivityStream @"https://www.pivotaltracker.com/services/v3/projects/%d/activities"
#define kUrlIceboxStories @"https://www.pivotaltracker.com/services/v3/projects/%d/stories?filter=current_state:unscheduled"
#define kUrlAddStory @"https://www.pivotaltracker.com/services/v3/projects/%d/stories"
#define kUrlUpdateStory @"https://www.pivotaltracker.com/services/v3/projects/%d/stories/%d"
#define kUrlDeleteStory @"https://www.pivotaltracker.com/services/v3/projects/%d/stories/%d"
#define kUrlAddComment @"https://www.pivotaltracker.com/services/v3/projects/%d/stories/%d/notes"
#define kUrlUpdateTask @"https://www.pivotaltracker.com/services/v3/projects/%d/stories/%d/tasks/%d"
#define kUrlAddTask @"https://www.pivotaltracker.com/services/v3/projects/%d/stories/%d/tasks"
#define kUrlAddProject @"https://www.pivotaltracker.com/services/v3/projects"
#define kResourceStatusKeyPath @"status"
#define kResourceErrorKeyPath @"error"
#define kResourceSavingStatusKeyPath @"savingStatus"
#define kXmlStoryStateTransitiion @"<story><current_state>%@</current_state><estimate type=\"Integer\">%d</estimate></story>"
#define kXmlStoryStateTransitiionNoEstimate @"<story><current_state>%@</current_state></story>"
#define kXmlAddStoryFeature @"<story><story_type>%@</story_type><name>%@</name><estimate type=\"Integer\">%d</estimate><owned_by>%@</owned_by></story>"
#define kXmlAddStory @"<story><story_type>%@</story_type><name>%@</name><owned_by>%@</owned_by></story>"
#define kXmlAddBugStory @"<story><story_type>%@</story_type><name>%@</name><owned_by>%@</owned_by><estimate/></story>"
#define kXmlAddComment @"<note><text>%@</text></note>"
#define kXmlAddTask @"<task><description>%@</description></task>"
#define kXmlToggleTask @"<task><description>%@</description><complete>%@</complete></task>"
#define kXmlAddProject @"<project><name>%@</name><iteration_length type=\"integer\">%d</iteration_length></project>"
#define kEmptyString @""
#define kComma @","
#define kFormatNumber @"%d"
#define kFormatObject @"%@"
#define kLabelYes @"YES"
#define kLabelNo @"NO"
#define kHttpContentType @"Content-type"
#define kHttpMimeTypeXml @"application/xml"
#define kKeyType @"Type"
#define kKeyStoryName @"StoryName"
#define kKeyEstimate @"Estimate"
#define kKeyOwned @"Owned"
#define kDateFormatUTC @"yyyy/MM/dd HH:mm:ss 'UTC'"
//#define kDateFormatUTC @"yyyy/MM/dd HH:mm:ss 'Z'"
#define kDateFormatItertion @"MMMM dd"
#define kDateFormatActivity @"MM/dd/yyyy hh:mm a"
// Cache File Formats
#define kCacheFileProjects @"projects.xml"
#define kCacheFileIterations @"%d_iterations.xml"
#define kCacheFileIterationsGrouped @"%d_%@_iterations.xml"
#define kCacheFileStories @"%@_stories_%@.xml"
#define kCacheActivityStream @"activities.xml"
#define kCacheProjectActivityStream @"%d_activities.xml"
// String Formats
#define kDefaultStoryTitle @"please enter the story name"
// Images and Artwork
#define kIconActivity @"77-ekg.png"
#define kIconTypeFeature @"feature.png"
#define kIconTypeBug @"bug.png"
#define kIconTypeRelease @"release.png"
#define kIconTypeChore @"chore.png"
#define kIconTypeProject @"lightbulb.png"
#define kIconComments @"comment.png"
#define kIconEstimateOnePoint @"estimate_1pt.gif"
#define kIconEstimateTwoPoints @"estimate_2pt.gif"
#define kIconEstimateThreePoints @"estimate_3pt.gif"
#define kIconEstimateNone @"estimate_unestimated.gif"
#define kIconCommentSmall @"chat_small_inverted.png"
#define kIconCommentAlternate @"story_comment_icon.png"
#define kIconComment @"story_flyover_icon.png"
#define RGB(r, g, b) [UIColor colorWithRed:r/256.0 green:g/256.0 blue:b/256.0 alpha:1]
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/256.0 green:g/256.0 blue:b/256.0 alpha:a]
#define kTextStoryNeedsName @"please enter a story name"
#define kTextStoryDescription @"please give this story a description"
#define kLabelNoDatesForIteration @"no dates for this iteration yet"
#define kLabelLoadingProgress @"Loading, please wait..."
#define kLabelNoIterations @"there are no iterations"
#define kLabelNoStories @"there are no stories"
#define kLabelAddStory @"Add Story"
#define kLabelCommentHeader @"%@ said %@"
#define kLabelComments @"comments"
#define kLabelDateRange @"%@ - %@"
#define kLabelStoryEstimation @"a %@, estimated as %d point(s)"
#define kLabelStoryEstimationNonFeature @"a %@"
#define kLabelStoryComments @"%d Comments"
#define kLabelStoryAttachments @"%d Attachments"
#define kLabelStoryTasks @"%d Tasks"
#define kLableProjectActivity @"last activity %@"
#define kLableNoProjectActivity @"no recent activity"
#define kLabelLastUpdated @"last updated: "
#define kLabelName @"Name"
#define kLabelId @"Id"
#define kLabelIterationLength @"Iteration Length"
#define kLabelWeekStart @"Week Start"
#define kLabelPointScale @"Point Scale"
#define kLabelVelocityScheme @"Velocity Scheme"
#define kLabelCurrentVelocity @"Current Velocity"
#define kLabelInitialVelocity @"Initial Velocity"
#define kLabelDoneIterations @"Done Iterations"
#define kLabelAllowsAttachments @"Allows Attachments"
#define kLabelPublic @"Public"
#define kLabelUseHttps @"User HTTPS"
#define kLabelEstimateBugsChores @"Estimate Bugs/Chores"
#define kLabelCommitMode @"Commit Mode"
#define kLabelLastActivity @"Last Activity"
#define kLabelLoading @"Loading"
#define kLabelAddComment @"Add Comment"
#define kLabelActivity @"Activity"
#define kLabelEditStory @"Edit Story"
#define kLabelSaving @"Saving"
#define kLabelEditingStory @"Editing Story"
#define kLabelSetOwner @"please select owner"
#define kLabelEditExisting @"Edit Existing Story"
#define kLabelAddNewStory @"Add a New Story"
#define kLabelInformation @"Information"
#define kLabelProjectDetailInfo @"Project Detail Information"
#define kLabelProjectMembers @"Project Members"
#define kLabelDeletingStory @"Deleting Story"
#define kLabelDeletingTask @"Deleting Task"
#define kLabelProjects @"Projects"
#define kLabelDashboard @"Dashboard"
#define kLabelIterations @"Iterations"
#define kLabelComment @"Comments"
#define kLabelTasks @"Tasks"
// Formats
#define kFormatPoints @"%d Point(s)"
#define kFormatIterationNumber @"Iteration %d"
#define kFormatMemberCellRole @"Role: %@"
#define kFormatMemberCellNameIntitials @"%@ (%@)"
// Cells
#define kIdentifierLabelCell @"LabelCell"
#define kIdentifierLabelInputCell @"LabelInputCell"
#define kIdentifierImageLabelCell @"ImageLabelCell"
#define kIdentifierCenteredCell @"CenteredLabelCell"
#define kIdentifierActivityLabelCell @"ActivityLabelCell"
#define kIdentifierIterationStoryCell @"IterationStoryCell"
#define kIdentifierPlaceholderCell @"PlaceholderCell"
#define kIdentifierTitleLabelCell @"TitleLabelCell"
#define kIdentifierCommentCell @"CommentCell"
#define kIdentifierCell @"Cell"
//UIActions
#define kButtonLabelEditStory @"Edit Story"
#define kButtonLabelStart @"Start Story"
#define kButtonLabelFinish @"Finish Story"
#define kButtonLabelDeliver @"Deliver Story"
#define kButtonLabelAccept @"Accept Story"
#define kButtonLabelReject @"Reject Reject"
#define kButtonLabelRestart @"Restart Story"
#define kButtonLabelCancel @"Cancel"
#define kLabelStoryDetails @"Story Details"