Fix compile errors
[pithos-ios] / Classes / Provider.h
1 //
2 //  Provider.h
3 //  OpenStack
4 //
5 //  Created by Mike Mayo on 9/30/10.
6 //  The OpenStack project is provided under the Apache 2.0 license.
7 //
8
9 #import <Foundation/Foundation.h>
10
11
12 @interface Provider : NSObject <NSCoding> {
13     
14 /*    
15     { 
16       "name": "Rackspace Cloud (US)", "auth_endpoint_url": "https://auth.api.rackspacecloud.com/v1.0",
17       "rss_feeds": [
18         { "name": "Cloud Servers Status", "url": "http://whatever" },
19         { "name": "Cloud Files Status", "url": "http://whatever" },
20         { "name": "Cloud Sites Status", "url": "http://whatever" },
21         { "name": "Rackspace Cloud Blog", "url": "http://whatever" }
22       ],
23       "contact_urls": [
24         { "name": "US Phone Support", "url": "tel://8001112222" }
25       ],
26       "bar_style": "black",
27       "logos": {
28         "landscape_logo": "url to 279x62 logo",
29         "landscape_logo_2x": "url to 558x124 logo",
30         "provider_icon": "url to 35x35 logo",
31         "provider_icon_2x": "url to 70x70 logo",
32         "provider_icon_72": "url to 72x72 logo",
33         "provider_large": "url to 1000x1000 logo",
34         "compute_icon": "35x35 compute logo",
35         "compute_icon_2x": "70x70 compute logo",
36         "compute_logo": "1000x1000 compute logo",
37         "storage_icon": "35x35 storage logo",
38         "storage_icon_2x": "70x70 storage logo",
39         "storage_logo": "1000x1000 storage logo",
40       }
41 */
42
43     // the name of the provider (example: Rackspace Cloud)
44     NSString *name;
45     
46     // endpoint for authentication (example: https://auth.api.rackspacecloud.com/v1.0)
47     NSURL *authEndpointURL;
48     
49     // URLs to RSS feeds, typically for system statuses, but it could be anything
50     NSArray *rssFeeds;
51     
52     // URLs to ways to contact the provider.  Can be any type of URL.  In the app,
53     // touching will open the URL if the device supports it.
54     // Examples:
55     //      http://support.rackspacecloud.com
56     //      tel://8005557777
57     //      sms://8005557777
58     //      mailto:support@rackspacecloud
59     //      maps://string-that-works-with-google-maps
60     NSArray *contactURLs;
61     
62     // Dictionary of logos.  All logos should be PNG with transparent backgrounds.
63     // Should follow this format ("key": "value"):
64     //      "provider_icon":    "url to 35x35 logo"         <-- sort of required
65     //      "provider_icon_2x": "url to 70x70 logo"         <-- sort of required
66     //      "provider_large":   "url to 1000x1000 logo"     <-- sort of required
67     //      "compute_icon":     "35x35 compute logo"
68     //      "compute_icon_2x":  "70x70 compute logo"
69     //      "compute_logo":     "1000x1000 compute logo"
70     //      "storage_icon":     "35x35 storage logo"
71     //      "storage_icon_2x":  "70x70 storage logo"
72     //      "storage_logo":     "1000x1000 storage logo"
73     // 
74     // If no provider* logos are provided, the OpenStack logo will be used where
75     // a provider's logo should appear.
76     // Compute and storage logos are used in their respective sections in the app.
77     // If they are not present, the provider logo will be used, and if the provider
78     // logo is not present, the OpenStack logo will be used.
79     // If the logo value is not a URL, it should be included in this application's
80     // resource bundle
81     NSDictionary *logoURLs;
82     
83     // UIImage objects serialized after the images are loaded from URLs
84     NSDictionary *logoObjects;
85     
86     NSString *authHelpMessage;
87 }
88
89 + (NSArray *)providers;
90 + (Provider *)fromJSON:(NSDictionary *)dict;
91 - (BOOL)isRackspace;
92 - (BOOL)isRackspaceUS;
93 - (BOOL)isRackspaceUK;
94 - (BOOL)isGRNet;
95
96 @property (nonatomic, retain) NSString *name;
97 @property (nonatomic, retain) NSURL *authEndpointURL;
98 @property (nonatomic, retain) NSString *authHelpMessage;
99 @property (nonatomic, retain) NSArray *rssFeeds;
100 @property (nonatomic, retain) NSArray *contactURLs;
101 @property (nonatomic, retain) NSDictionary *logoURLs;
102 @property (nonatomic, retain) NSDictionary *logoObjects;
103
104 @end