PageRenderTime 41ms CodeModel.GetById 24ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/BaseClasses/GDataQuery.h

http://macfuse.googlecode.com/
C++ Header | 176 lines | 102 code | 46 blank | 28 comment | 0 complexity | cecb82b733c660281e4921595c5a9825 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//  GDataQuery.h
 18//
 19
 20#import "GDataCategory.h"
 21#import "GDataDateTime.h"
 22
 23#undef _EXTERN
 24#undef _INITIALIZE_AS
 25#ifdef GDATAQUERY_DEFINE_GLOBALS
 26#define _EXTERN
 27#define _INITIALIZE_AS(x) =x
 28#else
 29#define _EXTERN GDATA_EXTERN
 30#define _INITIALIZE_AS(x)
 31#endif
 32
 33// result formats
 34_EXTERN NSString* const kGDataQueryResultServiceDocument _INITIALIZE_AS(@"atom-service"); // service introspection
 35
 36// categories within a filter are ORed; multiple filters in
 37// a query are ANDed
 38
 39@interface GDataCategoryFilter : NSObject <NSCopying> {
 40  NSMutableArray *categories_;
 41  NSMutableArray *excludeCategories_;
 42}
 43
 44+ (GDataCategoryFilter *)categoryFilter;
 45
 46- (NSArray *)categories;
 47- (void)setCategories:(NSArray *)categories;
 48- (void)addCategory:(GDataCategory *)category;
 49- (void)addCategoryWithScheme:(NSString *)scheme term:(NSString *)term;
 50
 51- (NSArray *)excludeCategories;
 52- (void)setExcludeCategories:(NSArray *)excludeCategories;
 53- (void)addExcludeCategory:(GDataCategory *)excludeCategory;
 54- (void)addExcludeCategoryWithScheme:(NSString *)scheme term:(NSString *)term;
 55
 56- (NSString *)stringValue;
 57@end
 58
 59@interface GDataQuery : NSObject <NSCopying> {
 60  NSURL *feedURL_;
 61  NSMutableArray *categoryFilters_;
 62  NSMutableDictionary *customParameters_;
 63}
 64
 65+ (id)queryWithFeedURL:(NSURL *)feedURL;
 66
 67- (id)initWithFeedURL:(NSURL *)feedURL;
 68
 69- (NSURL *)URL;
 70
 71
 72- (NSURL *)feedURL;
 73- (void)setFeedURL:(NSURL *)feedURL;
 74
 75// startIndex and maxResults use -1 to indicate parameter is not set
 76- (NSInteger)startIndex;
 77- (void)setStartIndex:(NSInteger)startIndex;
 78
 79- (NSInteger)maxResults;
 80- (void)setMaxResults:(NSInteger)maxResults;
 81
 82- (NSString *)fieldSelection;
 83- (void)setFieldSelection:(NSString *)str;
 84
 85- (NSString *)fullTextQueryString;
 86- (void)setFullTextQueryString:(NSString *)str;
 87
 88- (NSString *)author;
 89- (void)setAuthor:(NSString *)author;
 90
 91- (NSString *)orderBy;
 92- (void)setOrderBy:(NSString *)author;
 93
 94- (BOOL)isAscendingOrder;
 95- (void)setIsAscendingOrder:(BOOL)flag;
 96
 97- (BOOL)shouldShowDeleted;
 98- (void)setShouldShowDeleted:(BOOL)flag;
 99
100- (BOOL)shouldRequireAllDeleted;
101- (void)setShouldRequireAllDeleted:(BOOL)flag;
102
103- (BOOL)shouldShowOnlyDeleted;
104- (void)setShouldShowOnlyDeleted:(BOOL)flag;
105
106- (BOOL)isStrict;
107- (void)setIsStrict:(BOOL)flag;
108
109- (BOOL)shouldPrettyPrint;
110- (void)setShouldPrettyPrint:(BOOL)flag;
111
112- (NSString *)protocolVersion;
113- (void)setProtocolVersion:(NSString *)str;
114
115- (NSString *)resultFormat;  // the "alt" parameter
116- (void)setResultFormat:(NSString *)str;
117
118- (NSString *)language;
119- (void)setLanguage:(NSString *)str;
120
121- (GDataDateTime *)publishedMinDateTime;
122- (void)setPublishedMinDateTime:(GDataDateTime *)dateTime;
123
124- (GDataDateTime *)publishedMaxDateTime;
125- (void)setPublishedMaxDateTime:(GDataDateTime *)dateTime;
126
127- (GDataDateTime *)updatedMinDateTime;
128- (void)setUpdatedMinDateTime:(GDataDateTime *)dateTime;
129
130- (GDataDateTime *)updatedMaxDateTime;
131- (void)setUpdatedMaxDateTime:(GDataDateTime *)dateTime;
132
133- (BOOL)shouldFormatErrorsAsXML;
134- (void)setShouldFormatErrorsAsXML:(BOOL)flag;
135
136- (NSArray *)categoryFilters;
137- (void)setCategoryFilters:(NSArray *)filters;
138- (void)addCategoryFilter:(GDataCategoryFilter *)filter;
139- (void)addCategoryFilterWithCategory:(GDataCategory *)category;
140- (void)addCategoryFilterWithScheme:(NSString *)scheme term:(NSString *)term;
141
142- (NSDictionary *)customParameters;
143- (void)setCustomParameters:(NSDictionary *)dict;
144
145
146// adding a parameter with a value of nil will remove
147// the parameter from the list
148- (void)addCustomParameterWithName:(NSString *)name
149                             value:(NSString *)value;
150- (void)removeCustomParameterWithName:(NSString *)name;
151- (NSString *)valueForParameterWithName:(NSString *)name;
152
153// convenience methods for int parameters
154
155// if val==invalidVal, the parameter is removed
156- (void)addCustomParameterWithName:(NSString *)name
157                          intValue:(NSInteger)val
158                    removeForValue:(NSInteger)invalidVal;
159
160// if the named parameter is not found, missingVal is returned
161- (NSInteger)intValueForParameterWithName:(NSString *)name
162                    missingParameterValue:(NSInteger)missingVal;
163
164// convenience methods for boolean parameters
165- (void)addCustomParameterWithName:(NSString *)name
166                         boolValue:(BOOL)flag
167                      defaultValue:(BOOL)defaultValue;
168
169- (BOOL)boolValueForParameterWithName:(NSString *)name
170                         defaultValue:(BOOL)defaultValue;
171
172// convenience methods for dateTime parameters
173- (void)addCustomParameterWithName:(NSString *)name
174                          dateTime:(GDataDateTime *)dateTime;
175- (GDataDateTime *)dateTimeForParameterWithName:(NSString *)name;
176@end