PageRenderTime 27ms CodeModel.GetById 12ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/externals/GData/Source/Elements/GDataCategory.h

http://google-email-uploader-mac.googlecode.com/
C++ Header | 78 lines | 41 code | 14 blank | 23 comment | 0 complexity | 7d1ea50d66458213a16afd1e507fabca MD5 | raw file
 1/* Copyright (c) 2007 Google Inc.
 2 *
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 *
 7 *     http://www.apache.org/licenses/LICENSE-2.0
 8 *
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16//
17//  GDataCategory.h
18//
19
20#import "GDataObject.h"
21
22#undef _EXTERN
23#undef _INITIALIZE_AS
24#ifdef GDATACATEGORY_DEFINE_GLOBALS
25#define _EXTERN
26#define _INITIALIZE_AS(x) =x
27#else
28#define _EXTERN GDATA_EXTERN
29#define _INITIALIZE_AS(x)
30#endif
31
32_EXTERN NSString* const kGDataCategoryLabelScheme _INITIALIZE_AS(@"http://schemas.google.com/g/2005/labels");
33
34_EXTERN NSString* const kGDataCategoryLabelStarred          _INITIALIZE_AS(@"starred");
35_EXTERN NSString* const kGDataCategoryLabelTrashed          _INITIALIZE_AS(@"trashed");
36_EXTERN NSString* const kGDataCategoryLabelPublished        _INITIALIZE_AS(@"published");
37_EXTERN NSString* const kGDataCategoryLabelPrivate          _INITIALIZE_AS(@"private");
38_EXTERN NSString* const kGDataCategoryLabelMine             _INITIALIZE_AS(@"mine");
39_EXTERN NSString* const kGDataCategoryLabelSharedWithDomain _INITIALIZE_AS(@"shared-with-domain");
40_EXTERN NSString* const kGDataCategoryLabelHidden           _INITIALIZE_AS(@"hidden");
41_EXTERN NSString* const kGDataCategoryLabelViewed           _INITIALIZE_AS(@"viewed");
42
43// for categories, like
44//  <category scheme="http://schemas.google.com/g/2005#kind"
45//        term="http://schemas.google.com/g/2005#event"/>
46@interface GDataCategory : GDataObject <GDataExtension>
47
48+ (GDataCategory *)categoryWithScheme:(NSString *)scheme
49                                 term:(NSString *)term;
50
51+ (GDataCategory *)categoryWithLabel:(NSString *)label;
52
53- (NSString *)scheme;
54- (void)setScheme:(NSString *)str;
55- (NSString *)term;
56- (void)setTerm:(NSString *)str;
57- (NSString *)label;
58- (void)setLabel:(NSString *)str;
59- (NSString *)labelLang;
60- (void)setLabelLang:(NSString *)str;
61
62#pragma mark -
63
64// utilities for extracting a subset of categories
65+ (NSArray *)categoriesWithScheme:(NSString *)scheme fromCategories:(NSArray *)array;
66+ (NSArray *)categoriesWithSchemePrefix:(NSString *)prefix fromCategories:(NSArray *)array;
67
68+ (NSArray *)categoryLabelsFromCategories:(NSArray *)array;
69+ (BOOL)categories:(NSArray *)array containsCategoryWithLabel:(NSString *)label;
70
71// this general search routine allows nil as "don't care" for scheme, term,
72// and label
73+ (BOOL)categories:(NSArray *)array
74containsCategoryWithScheme:(NSString *)scheme
75              term:(NSString *)term
76             label:(NSString *)label;
77
78@end