PageRenderTime 86ms CodeModel.GetById 35ms app.highlight 48ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/externals/GData/Source/Clients/Docs/GDataQueryDocs.m

http://google-email-uploader-mac.googlecode.com/
Objective C | 231 lines | 169 code | 45 blank | 17 comment | 1 complexity | 0eae371eef807911545e34b7e2840f8f 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//  GDataQueryDocument.m
 18//
 19
 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE
 21
 22#define GDATAQUERYDOCS_DEFINE_GLOBALS 1
 23#import "GDataQueryDocs.h"
 24
 25static NSString *const kTitleParamName          = @"title";
 26static NSString *const kExactTitleParamName     = @"title-exact";
 27static NSString *const kParentFolderParamName   = @"folder";
 28static NSString *const kShowFoldersParamName    = @"showfolders";
 29static NSString *const kOwnerParamName          = @"owner";
 30static NSString *const kReaderParamName         = @"reader";
 31static NSString *const kWriterParamName         = @"writer";
 32static NSString *const kOpenedMinParamName      = @"opened-min";
 33static NSString *const kOpenedMaxParamName      = @"opened-max";
 34static NSString *const kEditedMinParamName      = @"edited-min";
 35static NSString *const kEditedMaxParamName      = @"edited-max";
 36static NSString *const kShowRootParamName       = @"showroot";
 37static NSString *const kTargetLanguageParamName = @"targetLanguage";
 38static NSString *const kSourceLanguageParamName = @"sourceLanguage";
 39static NSString *const kDeleteParamName         = @"delete";
 40static NSString *const kConvertParamName        = @"convert";
 41static NSString *const kOCRParamName            = @"ocr";
 42static NSString *const kNewRevisionParamName    = @"new-revision";
 43
 44
 45@implementation GDataQueryDocs
 46
 47+ (GDataQueryDocs *)documentQueryWithFeedURL:(NSURL *)feedURL {
 48  return [self queryWithFeedURL:feedURL];
 49}
 50
 51- (NSString *)titleQuery {
 52  NSString *str = [self valueForParameterWithName:kTitleParamName];
 53  return str;
 54}
 55
 56- (void)setTitleQuery:(NSString *)str {
 57  [self addCustomParameterWithName:kTitleParamName value:str];
 58}
 59
 60- (BOOL)isTitleQueryExact {
 61  return [self boolValueForParameterWithName:kExactTitleParamName
 62                                defaultValue:NO];
 63}
 64
 65- (void)setIsTitleQueryExact:(BOOL)flag {
 66  [self addCustomParameterWithName:kExactTitleParamName
 67                         boolValue:flag
 68                      defaultValue:NO];
 69}
 70
 71- (NSString *)parentFolderName {
 72  NSString *str = [self valueForParameterWithName:kParentFolderParamName];
 73  return str;
 74}
 75
 76- (void)setParentFolderName:(NSString *)str {
 77  [self addCustomParameterWithName:kParentFolderParamName value:str];
 78}
 79
 80- (BOOL)shouldShowFolders {
 81  return [self boolValueForParameterWithName:kShowFoldersParamName
 82                                defaultValue:NO];
 83}
 84
 85- (void)setShouldShowFolders:(BOOL)flag {
 86  [self addCustomParameterWithName:kShowFoldersParamName
 87                         boolValue:flag
 88                      defaultValue:NO];
 89}
 90
 91- (void)setOwner:(NSString *)str {
 92  [self addCustomParameterWithName:kOwnerParamName value:str];
 93}
 94
 95- (NSString *)owner {
 96  NSString *str = [self valueForParameterWithName:kOwnerParamName];
 97  return str;
 98}
 99
100- (void)setReader:(NSString *)str {
101  [self addCustomParameterWithName:kReaderParamName value:str];
102}
103
104- (NSString *)reader {
105  NSString *str = [self valueForParameterWithName:kReaderParamName];
106  return str;
107}
108
109- (void)setWriter:(NSString *)str {
110  [self addCustomParameterWithName:kWriterParamName value:str];
111}
112
113- (NSString *)writer {
114  NSString *str = [self valueForParameterWithName:kWriterParamName];
115  return str;
116}
117
118- (void)setOpenedMinDateTime:(GDataDateTime *)dateTime {
119  [self addCustomParameterWithName:kOpenedMinParamName
120                          dateTime:dateTime];
121}
122
123- (GDataDateTime *)openedMinDateTime {
124  return [self dateTimeForParameterWithName:kOpenedMinParamName];
125}
126
127- (void)setOpenedMaxDateTime:(GDataDateTime *)dateTime {
128  [self addCustomParameterWithName:kOpenedMaxParamName
129                          dateTime:dateTime];
130}
131
132- (GDataDateTime *)openedMaxDateTime {
133  return [self dateTimeForParameterWithName:kOpenedMaxParamName];
134}
135
136- (void)setEditedMinDateTime:(GDataDateTime *)dateTime {
137  [self addCustomParameterWithName:kEditedMinParamName
138                          dateTime:dateTime];
139}
140
141- (GDataDateTime *)editedMinDateTime {
142  return [self dateTimeForParameterWithName:kEditedMinParamName];
143}
144
145- (void)setEditedMaxDateTime:(GDataDateTime *)dateTime {
146  [self addCustomParameterWithName:kEditedMaxParamName
147                          dateTime:dateTime];
148}
149
150- (GDataDateTime *)editedMaxDateTime {
151  return [self dateTimeForParameterWithName:kEditedMaxParamName];
152}
153
154- (void)setShouldShowRootParentLink:(BOOL)flag {
155  [self addCustomParameterWithName:kShowRootParamName
156                         boolValue:flag
157                      defaultValue:NO];
158}
159
160- (BOOL)shouldShowRootParentLink {
161  return [self boolValueForParameterWithName:kShowRootParamName
162                                defaultValue:NO];
163}
164
165- (void)setShouldActuallyDelete:(BOOL)flag {
166  [self addCustomParameterWithName:kDeleteParamName
167                         boolValue:flag
168                      defaultValue:NO];
169}
170
171- (BOOL)shouldActuallyDelete {
172  return [self boolValueForParameterWithName:kDeleteParamName
173                                defaultValue:NO];
174}
175
176- (void)setShouldConvertUpload:(BOOL)flag {
177  [self addCustomParameterWithName:kConvertParamName
178                         boolValue:flag
179                      defaultValue:YES];
180}
181
182- (BOOL)shouldConvertUpload {
183  return [self boolValueForParameterWithName:kConvertParamName
184                                defaultValue:YES];
185}
186
187- (void)setShouldOCRUpload:(BOOL)flag {
188  [self addCustomParameterWithName:kOCRParamName
189                         boolValue:flag
190                      defaultValue:NO];
191}
192
193- (BOOL)shouldOCRUpload {
194  return [self boolValueForParameterWithName:kOCRParamName
195                                defaultValue:NO];
196}
197
198- (void)setShouldCreateNewRevision:(BOOL)flag {
199  [self addCustomParameterWithName:kNewRevisionParamName
200                         boolValue:flag
201                      defaultValue:NO];
202}
203
204- (BOOL)shouldCreateNewRevision {
205  return [self boolValueForParameterWithName:kNewRevisionParamName
206                                defaultValue:NO];
207}
208
209- (NSString *)sourceLanguage {
210  NSString *str = [self valueForParameterWithName:kSourceLanguageParamName];
211  return str;
212}
213
214- (void)setSourceLanguage:(NSString *)str {
215  [self addCustomParameterWithName:kSourceLanguageParamName
216                             value:str];
217}
218
219- (NSString *)targetLanguage {
220  NSString *str = [self valueForParameterWithName:kTargetLanguageParamName];
221  return str;
222}
223
224- (void)setTargetLanguage:(NSString *)str {
225  [self addCustomParameterWithName:kTargetLanguageParamName
226                             value:str];
227}
228
229@end
230
231#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE