OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
Mark Mentovai
2014/10/02 16:07:23
No (c) in new files.
Mark Mentovai
2014/10/02 16:07:23
I think this should just go in-line in keystone_re
Mike Lerman
2014/10/06 16:49:08
I was mirroring the file structure of the Keystone
Mark Mentovai
2014/10/06 18:35:13
Mike Lerman wrote:
Mike Lerman
2014/10/09 20:41:01
Ok. Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_MAC_KEYSTONE_REPORTING_ATTRIBUTE_H_ | |
6 #define CHROME_BROWSER_MAC_KEYSTONE_REPORTING_ATTRIBUTE_H_ | |
7 | |
8 // Declarations of the Keystone attribute reporting bits needed here. From | |
9 // KSReportingAttribute.h. | |
10 | |
11 typedef enum { | |
12 kKSReportingAggregationSum = 0, // Adds attribute value across user accounts | |
13 | |
14 kKSReportingAggregationDefault = kKSReportingAggregationSum, | |
15 } KSReportingAggregationType; | |
16 | |
17 @interface KSReportingAttribute : NSObject | |
18 | |
19 // How long the attribute will live after being set. The clock starts ticking | |
20 // after the call to setActiveWithReportingAttributes. | |
21 - (NSTimeInterval)lifetime; | |
22 - (BOOL)setLifetime:(NSTimeInterval)lifetime error:(NSError **)error; | |
23 | |
24 // The method returns the value stored, as a generic NSObject. Derived classes | |
25 // accessors provide a more specific data type. | |
26 - (id<NSObject>)value; | |
27 | |
28 // The name of the attribute. setName checks that the name starts with a letter | |
29 // and contains only Latin letters, digits and '_', '-'. | |
30 - (NSString *)name; | |
31 - (BOOL)setName:(NSString *)name error:(NSError **)error; | |
32 | |
33 // Confirms if a name is correct. Typically called by setName and helper | |
34 // methods. See "setName" for definition of "correctness". | |
35 + (BOOL)verifyAttributeName:(NSString *)name error:(NSError **)error; | |
36 | |
37 // Prints information about the attribute. Used for debugging purposes. | |
38 - (NSString *)description; | |
39 | |
40 @end | |
41 | |
42 @interface KSUnsignedReportingAttribute : KSReportingAttribute | |
43 | |
44 + (KSUnsignedReportingAttribute *)reportingAttributeWithValue:(uint32_t)value | |
45 name:(NSString *)name | |
46 aggregationType:(KSReportingAggregationType)aggregationType | |
47 error:(NSError **)error; | |
48 | |
49 // Get/set the value of the attribute as "unsigned int" | |
50 - (uint32_t)unsignedIntValue; | |
51 - (void)setUnsignedIntValue:(uint32_t)value; | |
52 | |
53 - (KSReportingAggregationType)aggregationType; | |
54 - (void)setAggregationType:(KSReportingAggregationType)aggregationType; | |
55 | |
56 @end | |
57 | |
58 #endif // CHROME_BROWSER_MAC_KEYSTONE_REPORTING_ATTRIBUTE_H_ | |
OLD | NEW |