-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathConstants.swift
122 lines (80 loc) · 4.46 KB
/
Constants.swift
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
//
// Constants.swift
// ESEOmega
//
// Created by Tomn on 07/09/2017.
// Copyright © 2017 Thomas NAUDET
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/
//
import Foundation
// MARK: - Global notifications names within the app
extension Notification.Name {
/// User has just been logged in/out
static let connectionStateChanged = Notification.Name("connecte")
/// App theme has been changed
static let themeChanged = NSNotification.Name("themeUpdated")
/// Debug refresh control stuck when quitting and reopening the app
static let debugRefresh = NSNotification.Name("debugRefresh")
// MARK: MessagesExtension
/// Sticker list changed
static let stickersReloaded = Notification.Name("stickersReloaded")
}
/// Common keys used to get or set values in User Defaults
enum UserDefaultsKey {
/// Current app appearance (0 = common | 1 = BDEl'dorado | 2 = ESEOmega | 3 = ESEOasis | …)
static let appTheme = "appTheme"
/// Sort rooms list mode (0 = by name | 1 = by building | 2 = by floor)
static let roomsSortMode = "roomsSortMode"
/// Tip How To Print a Document (see values in PrintWarningStatus)
static let printWarning = "messageImpressionLu"
/// Whether the user has seen some new events so a tab badge should be hidden (true = hide badge | false = display badge)
static let seenEventBadge = "nouveauBoutonEventVu"
/// Whether GP is enabled or not
static let gp = "GPenabled"
/// Whether app data has already been erased to support ESEOasis API
static let usesAPIv4 = "alreadyLaunchedv4NewAPI"
/// Whether app data has already been erased to support ESEOdin API
static let usesAPIv5 = "alreadyLaunchedv5NewAPI"
// MARK: MessagesExtension
/// Server response cached for fast reload
static let stickers = "stickers"
// MARK: WatchExtension
/// Server response cached for fast reload
static let watchRooms = "watchRooms"
}
/// Types used for NSUserActivity/Handoff
enum ActivityType {
typealias ActivityInfo = (type: String, title: String, url: URL)
static let baseURL = "https://bdeeseo.fr/"
static let cafetDisplayURL = "https://portail.bdeeseo.fr/modules/lacommande/displayCafet/"
static let news = ActivityInfo(type: "com.eseomega.ESEOmega.news",
title: "Liste des news",
url: URL(string: baseURL + "news")!)
static let article = ActivityInfo(type: "com.eseomega.ESEOmega.article",
title: "Actualité",
url: URL(string: baseURL + "news")!)
static let clubs = ActivityInfo(type: "com.eseomega.ESEOmega.clubs",
title: "BDE & liste des clubs",
url: URL(string: baseURL + "clubs")!)
static let cafet = ActivityInfo(type: "com.eseomega.ESEOmega.cafet",
title: "Liste de mes commandes à la cafet",
url: URL(string: cafetDisplayURL)!)
static let order = ActivityInfo(type: "com.eseomega.ESEOmega.order",
title: "Commander à la cafet",
url: URL(string: cafetDisplayURL)!)
static let rooms = ActivityInfo(type: "com.eseomega.ESEOmega.rooms",
title: "Liste des salles",
url: URL(string: baseURL + "rooms")!)
static let families = ActivityInfo(type: "com.eseomega.ESEOmega.families",
title: "Familles & parrainages",
url: URL(string: baseURL + "families")!)
}