/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.m

https://github.com/Punnya/ShareKit_Posterous · Objective C · 1855 lines · 1689 code · 161 blank · 5 comment · 246 complexity · 556c1bc5abc8fa5db5488e14f134d482 MD5 · raw file

  1. /**
  2. * Autogenerated by Thrift
  3. *
  4. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. */
  6. #import <Foundation/Foundation.h>
  7. #import "TProtocol.h"
  8. #import "TApplicationException.h"
  9. #import "TProtocolUtil.h"
  10. #import "TProcessor.h"
  11. #import "UserStore.h"
  12. #import "Types.h"
  13. #import "Errors.h"
  14. #import "Limits.h"
  15. #import "NoteStore.h"
  16. @implementation EDAMNoteStoreConstants
  17. + (void) initialize {
  18. }
  19. @end
  20. @implementation EDAMSyncState
  21. #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
  22. @dynamic currentTime;
  23. @dynamic fullSyncBefore;
  24. @dynamic updateCount;
  25. @dynamic uploaded;
  26. #endif
  27. - (id) initWithCurrentTime: (EDAMTimestamp) currentTime fullSyncBefore: (EDAMTimestamp) fullSyncBefore updateCount: (int32_t) updateCount uploaded: (int64_t) uploaded
  28. {
  29. self = [super init];
  30. __currentTime = currentTime;
  31. __currentTime_isset = YES;
  32. __fullSyncBefore = fullSyncBefore;
  33. __fullSyncBefore_isset = YES;
  34. __updateCount = updateCount;
  35. __updateCount_isset = YES;
  36. __uploaded = uploaded;
  37. __uploaded_isset = YES;
  38. return self;
  39. }
  40. - (id) initWithCoder: (NSCoder *) decoder
  41. {
  42. self = [super init];
  43. if ([decoder containsValueForKey: @"currentTime"])
  44. {
  45. __currentTime = [decoder decodeInt64ForKey: @"currentTime"];
  46. __currentTime_isset = YES;
  47. }
  48. if ([decoder containsValueForKey: @"fullSyncBefore"])
  49. {
  50. __fullSyncBefore = [decoder decodeInt64ForKey: @"fullSyncBefore"];
  51. __fullSyncBefore_isset = YES;
  52. }
  53. if ([decoder containsValueForKey: @"updateCount"])
  54. {
  55. __updateCount = [decoder decodeInt32ForKey: @"updateCount"];
  56. __updateCount_isset = YES;
  57. }
  58. if ([decoder containsValueForKey: @"uploaded"])
  59. {
  60. __uploaded = [decoder decodeInt64ForKey: @"uploaded"];
  61. __uploaded_isset = YES;
  62. }
  63. return self;
  64. }
  65. - (void) encodeWithCoder: (NSCoder *) encoder
  66. {
  67. if (__currentTime_isset)
  68. {
  69. [encoder encodeInt64: __currentTime forKey: @"currentTime"];
  70. }
  71. if (__fullSyncBefore_isset)
  72. {
  73. [encoder encodeInt64: __fullSyncBefore forKey: @"fullSyncBefore"];
  74. }
  75. if (__updateCount_isset)
  76. {
  77. [encoder encodeInt32: __updateCount forKey: @"updateCount"];
  78. }
  79. if (__uploaded_isset)
  80. {
  81. [encoder encodeInt64: __uploaded forKey: @"uploaded"];
  82. }
  83. }
  84. - (void) dealloc
  85. {
  86. [super dealloc];
  87. }
  88. - (int64_t) currentTime {
  89. return __currentTime;
  90. }
  91. - (void) setCurrentTime: (int64_t) currentTime {
  92. __currentTime = currentTime;
  93. __currentTime_isset = YES;
  94. }
  95. - (BOOL) currentTimeIsSet {
  96. return __currentTime_isset;
  97. }
  98. - (void) unsetCurrentTime {
  99. __currentTime_isset = NO;
  100. }
  101. - (int64_t) fullSyncBefore {
  102. return __fullSyncBefore;
  103. }
  104. - (void) setFullSyncBefore: (int64_t) fullSyncBefore {
  105. __fullSyncBefore = fullSyncBefore;
  106. __fullSyncBefore_isset = YES;
  107. }
  108. - (BOOL) fullSyncBeforeIsSet {
  109. return __fullSyncBefore_isset;
  110. }
  111. - (void) unsetFullSyncBefore {
  112. __fullSyncBefore_isset = NO;
  113. }
  114. - (int32_t) updateCount {
  115. return __updateCount;
  116. }
  117. - (void) setUpdateCount: (int32_t) updateCount {
  118. __updateCount = updateCount;
  119. __updateCount_isset = YES;
  120. }
  121. - (BOOL) updateCountIsSet {
  122. return __updateCount_isset;
  123. }
  124. - (void) unsetUpdateCount {
  125. __updateCount_isset = NO;
  126. }
  127. - (int64_t) uploaded {
  128. return __uploaded;
  129. }
  130. - (void) setUploaded: (int64_t) uploaded {
  131. __uploaded = uploaded;
  132. __uploaded_isset = YES;
  133. }
  134. - (BOOL) uploadedIsSet {
  135. return __uploaded_isset;
  136. }
  137. - (void) unsetUploaded {
  138. __uploaded_isset = NO;
  139. }
  140. - (void) read: (id <TProtocol>) inProtocol
  141. {
  142. NSString * fieldName;
  143. int fieldType;
  144. int fieldID;
  145. [inProtocol readStructBeginReturningName: NULL];
  146. while (true)
  147. {
  148. [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID];
  149. if (fieldType == TType_STOP) {
  150. break;
  151. }
  152. switch (fieldID)
  153. {
  154. case 1:
  155. if (fieldType == TType_I64) {
  156. int64_t fieldValue = [inProtocol readI64];
  157. [self setCurrentTime: fieldValue];
  158. } else {
  159. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  160. }
  161. break;
  162. case 2:
  163. if (fieldType == TType_I64) {
  164. int64_t fieldValue = [inProtocol readI64];
  165. [self setFullSyncBefore: fieldValue];
  166. } else {
  167. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  168. }
  169. break;
  170. case 3:
  171. if (fieldType == TType_I32) {
  172. int32_t fieldValue = [inProtocol readI32];
  173. [self setUpdateCount: fieldValue];
  174. } else {
  175. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  176. }
  177. break;
  178. case 4:
  179. if (fieldType == TType_I64) {
  180. int64_t fieldValue = [inProtocol readI64];
  181. [self setUploaded: fieldValue];
  182. } else {
  183. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  184. }
  185. break;
  186. default:
  187. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  188. break;
  189. }
  190. [inProtocol readFieldEnd];
  191. }
  192. [inProtocol readStructEnd];
  193. }
  194. - (void) write: (id <TProtocol>) outProtocol {
  195. [outProtocol writeStructBeginWithName: @"SyncState"];
  196. if (__currentTime_isset) {
  197. [outProtocol writeFieldBeginWithName: @"currentTime" type: TType_I64 fieldID: 1];
  198. [outProtocol writeI64: __currentTime];
  199. [outProtocol writeFieldEnd];
  200. }
  201. if (__fullSyncBefore_isset) {
  202. [outProtocol writeFieldBeginWithName: @"fullSyncBefore" type: TType_I64 fieldID: 2];
  203. [outProtocol writeI64: __fullSyncBefore];
  204. [outProtocol writeFieldEnd];
  205. }
  206. if (__updateCount_isset) {
  207. [outProtocol writeFieldBeginWithName: @"updateCount" type: TType_I32 fieldID: 3];
  208. [outProtocol writeI32: __updateCount];
  209. [outProtocol writeFieldEnd];
  210. }
  211. if (__uploaded_isset) {
  212. [outProtocol writeFieldBeginWithName: @"uploaded" type: TType_I64 fieldID: 4];
  213. [outProtocol writeI64: __uploaded];
  214. [outProtocol writeFieldEnd];
  215. }
  216. [outProtocol writeFieldStop];
  217. [outProtocol writeStructEnd];
  218. }
  219. - (NSString *) description {
  220. NSMutableString * ms = [NSMutableString stringWithString: @"SyncState("];
  221. [ms appendString: @"currentTime:"];
  222. [ms appendFormat: @"%qi", __currentTime];
  223. [ms appendString: @",fullSyncBefore:"];
  224. [ms appendFormat: @"%qi", __fullSyncBefore];
  225. [ms appendString: @",updateCount:"];
  226. [ms appendFormat: @"%i", __updateCount];
  227. [ms appendString: @",uploaded:"];
  228. [ms appendFormat: @"%qi", __uploaded];
  229. [ms appendString: @")"];
  230. return [NSString stringWithString: ms];
  231. }
  232. @end
  233. @implementation EDAMSyncChunk
  234. #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
  235. @dynamic currentTime;
  236. @dynamic chunkHighUSN;
  237. @dynamic updateCount;
  238. @dynamic notes;
  239. @dynamic notebooks;
  240. @dynamic tags;
  241. @dynamic searches;
  242. @dynamic resources;
  243. @dynamic expungedNotes;
  244. @dynamic expungedNotebooks;
  245. @dynamic expungedTags;
  246. @dynamic expungedSearches;
  247. #endif
  248. - (id) initWithCurrentTime: (EDAMTimestamp) currentTime chunkHighUSN: (int32_t) chunkHighUSN updateCount: (int32_t) updateCount notes: (NSArray *) notes notebooks: (NSArray *) notebooks tags: (NSArray *) tags searches: (NSArray *) searches resources: (NSArray *) resources expungedNotes: (NSArray *) expungedNotes expungedNotebooks: (NSArray *) expungedNotebooks expungedTags: (NSArray *) expungedTags expungedSearches: (NSArray *) expungedSearches
  249. {
  250. self = [super init];
  251. __currentTime = currentTime;
  252. __currentTime_isset = YES;
  253. __chunkHighUSN = chunkHighUSN;
  254. __chunkHighUSN_isset = YES;
  255. __updateCount = updateCount;
  256. __updateCount_isset = YES;
  257. __notes = [notes retain];
  258. __notes_isset = YES;
  259. __notebooks = [notebooks retain];
  260. __notebooks_isset = YES;
  261. __tags = [tags retain];
  262. __tags_isset = YES;
  263. __searches = [searches retain];
  264. __searches_isset = YES;
  265. __resources = [resources retain];
  266. __resources_isset = YES;
  267. __expungedNotes = [expungedNotes retain];
  268. __expungedNotes_isset = YES;
  269. __expungedNotebooks = [expungedNotebooks retain];
  270. __expungedNotebooks_isset = YES;
  271. __expungedTags = [expungedTags retain];
  272. __expungedTags_isset = YES;
  273. __expungedSearches = [expungedSearches retain];
  274. __expungedSearches_isset = YES;
  275. return self;
  276. }
  277. - (id) initWithCoder: (NSCoder *) decoder
  278. {
  279. self = [super init];
  280. if ([decoder containsValueForKey: @"currentTime"])
  281. {
  282. __currentTime = [decoder decodeInt64ForKey: @"currentTime"];
  283. __currentTime_isset = YES;
  284. }
  285. if ([decoder containsValueForKey: @"chunkHighUSN"])
  286. {
  287. __chunkHighUSN = [decoder decodeInt32ForKey: @"chunkHighUSN"];
  288. __chunkHighUSN_isset = YES;
  289. }
  290. if ([decoder containsValueForKey: @"updateCount"])
  291. {
  292. __updateCount = [decoder decodeInt32ForKey: @"updateCount"];
  293. __updateCount_isset = YES;
  294. }
  295. if ([decoder containsValueForKey: @"notes"])
  296. {
  297. __notes = [[decoder decodeObjectForKey: @"notes"] retain];
  298. __notes_isset = YES;
  299. }
  300. if ([decoder containsValueForKey: @"notebooks"])
  301. {
  302. __notebooks = [[decoder decodeObjectForKey: @"notebooks"] retain];
  303. __notebooks_isset = YES;
  304. }
  305. if ([decoder containsValueForKey: @"tags"])
  306. {
  307. __tags = [[decoder decodeObjectForKey: @"tags"] retain];
  308. __tags_isset = YES;
  309. }
  310. if ([decoder containsValueForKey: @"searches"])
  311. {
  312. __searches = [[decoder decodeObjectForKey: @"searches"] retain];
  313. __searches_isset = YES;
  314. }
  315. if ([decoder containsValueForKey: @"resources"])
  316. {
  317. __resources = [[decoder decodeObjectForKey: @"resources"] retain];
  318. __resources_isset = YES;
  319. }
  320. if ([decoder containsValueForKey: @"expungedNotes"])
  321. {
  322. __expungedNotes = [[decoder decodeObjectForKey: @"expungedNotes"] retain];
  323. __expungedNotes_isset = YES;
  324. }
  325. if ([decoder containsValueForKey: @"expungedNotebooks"])
  326. {
  327. __expungedNotebooks = [[decoder decodeObjectForKey: @"expungedNotebooks"] retain];
  328. __expungedNotebooks_isset = YES;
  329. }
  330. if ([decoder containsValueForKey: @"expungedTags"])
  331. {
  332. __expungedTags = [[decoder decodeObjectForKey: @"expungedTags"] retain];
  333. __expungedTags_isset = YES;
  334. }
  335. if ([decoder containsValueForKey: @"expungedSearches"])
  336. {
  337. __expungedSearches = [[decoder decodeObjectForKey: @"expungedSearches"] retain];
  338. __expungedSearches_isset = YES;
  339. }
  340. return self;
  341. }
  342. - (void) encodeWithCoder: (NSCoder *) encoder
  343. {
  344. if (__currentTime_isset)
  345. {
  346. [encoder encodeInt64: __currentTime forKey: @"currentTime"];
  347. }
  348. if (__chunkHighUSN_isset)
  349. {
  350. [encoder encodeInt32: __chunkHighUSN forKey: @"chunkHighUSN"];
  351. }
  352. if (__updateCount_isset)
  353. {
  354. [encoder encodeInt32: __updateCount forKey: @"updateCount"];
  355. }
  356. if (__notes_isset)
  357. {
  358. [encoder encodeObject: __notes forKey: @"notes"];
  359. }
  360. if (__notebooks_isset)
  361. {
  362. [encoder encodeObject: __notebooks forKey: @"notebooks"];
  363. }
  364. if (__tags_isset)
  365. {
  366. [encoder encodeObject: __tags forKey: @"tags"];
  367. }
  368. if (__searches_isset)
  369. {
  370. [encoder encodeObject: __searches forKey: @"searches"];
  371. }
  372. if (__resources_isset)
  373. {
  374. [encoder encodeObject: __resources forKey: @"resources"];
  375. }
  376. if (__expungedNotes_isset)
  377. {
  378. [encoder encodeObject: __expungedNotes forKey: @"expungedNotes"];
  379. }
  380. if (__expungedNotebooks_isset)
  381. {
  382. [encoder encodeObject: __expungedNotebooks forKey: @"expungedNotebooks"];
  383. }
  384. if (__expungedTags_isset)
  385. {
  386. [encoder encodeObject: __expungedTags forKey: @"expungedTags"];
  387. }
  388. if (__expungedSearches_isset)
  389. {
  390. [encoder encodeObject: __expungedSearches forKey: @"expungedSearches"];
  391. }
  392. }
  393. - (void) dealloc
  394. {
  395. [__notes release];
  396. [__notebooks release];
  397. [__tags release];
  398. [__searches release];
  399. [__resources release];
  400. [__expungedNotes release];
  401. [__expungedNotebooks release];
  402. [__expungedTags release];
  403. [__expungedSearches release];
  404. [super dealloc];
  405. }
  406. - (int64_t) currentTime {
  407. return __currentTime;
  408. }
  409. - (void) setCurrentTime: (int64_t) currentTime {
  410. __currentTime = currentTime;
  411. __currentTime_isset = YES;
  412. }
  413. - (BOOL) currentTimeIsSet {
  414. return __currentTime_isset;
  415. }
  416. - (void) unsetCurrentTime {
  417. __currentTime_isset = NO;
  418. }
  419. - (int32_t) chunkHighUSN {
  420. return __chunkHighUSN;
  421. }
  422. - (void) setChunkHighUSN: (int32_t) chunkHighUSN {
  423. __chunkHighUSN = chunkHighUSN;
  424. __chunkHighUSN_isset = YES;
  425. }
  426. - (BOOL) chunkHighUSNIsSet {
  427. return __chunkHighUSN_isset;
  428. }
  429. - (void) unsetChunkHighUSN {
  430. __chunkHighUSN_isset = NO;
  431. }
  432. - (int32_t) updateCount {
  433. return __updateCount;
  434. }
  435. - (void) setUpdateCount: (int32_t) updateCount {
  436. __updateCount = updateCount;
  437. __updateCount_isset = YES;
  438. }
  439. - (BOOL) updateCountIsSet {
  440. return __updateCount_isset;
  441. }
  442. - (void) unsetUpdateCount {
  443. __updateCount_isset = NO;
  444. }
  445. - (NSArray *) notes {
  446. return [[__notes retain] autorelease];
  447. }
  448. - (void) setNotes: (NSArray *) notes {
  449. [notes retain];
  450. [__notes release];
  451. __notes = notes;
  452. __notes_isset = YES;
  453. }
  454. - (BOOL) notesIsSet {
  455. return __notes_isset;
  456. }
  457. - (void) unsetNotes {
  458. [__notes release];
  459. __notes = nil;
  460. __notes_isset = NO;
  461. }
  462. - (NSArray *) notebooks {
  463. return [[__notebooks retain] autorelease];
  464. }
  465. - (void) setNotebooks: (NSArray *) notebooks {
  466. [notebooks retain];
  467. [__notebooks release];
  468. __notebooks = notebooks;
  469. __notebooks_isset = YES;
  470. }
  471. - (BOOL) notebooksIsSet {
  472. return __notebooks_isset;
  473. }
  474. - (void) unsetNotebooks {
  475. [__notebooks release];
  476. __notebooks = nil;
  477. __notebooks_isset = NO;
  478. }
  479. - (NSArray *) tags {
  480. return [[__tags retain] autorelease];
  481. }
  482. - (void) setTags: (NSArray *) tags {
  483. [tags retain];
  484. [__tags release];
  485. __tags = tags;
  486. __tags_isset = YES;
  487. }
  488. - (BOOL) tagsIsSet {
  489. return __tags_isset;
  490. }
  491. - (void) unsetTags {
  492. [__tags release];
  493. __tags = nil;
  494. __tags_isset = NO;
  495. }
  496. - (NSArray *) searches {
  497. return [[__searches retain] autorelease];
  498. }
  499. - (void) setSearches: (NSArray *) searches {
  500. [searches retain];
  501. [__searches release];
  502. __searches = searches;
  503. __searches_isset = YES;
  504. }
  505. - (BOOL) searchesIsSet {
  506. return __searches_isset;
  507. }
  508. - (void) unsetSearches {
  509. [__searches release];
  510. __searches = nil;
  511. __searches_isset = NO;
  512. }
  513. - (NSArray *) resources {
  514. return [[__resources retain] autorelease];
  515. }
  516. - (void) setResources: (NSArray *) resources {
  517. [resources retain];
  518. [__resources release];
  519. __resources = resources;
  520. __resources_isset = YES;
  521. }
  522. - (BOOL) resourcesIsSet {
  523. return __resources_isset;
  524. }
  525. - (void) unsetResources {
  526. [__resources release];
  527. __resources = nil;
  528. __resources_isset = NO;
  529. }
  530. - (NSArray *) expungedNotes {
  531. return [[__expungedNotes retain] autorelease];
  532. }
  533. - (void) setExpungedNotes: (NSArray *) expungedNotes {
  534. [expungedNotes retain];
  535. [__expungedNotes release];
  536. __expungedNotes = expungedNotes;
  537. __expungedNotes_isset = YES;
  538. }
  539. - (BOOL) expungedNotesIsSet {
  540. return __expungedNotes_isset;
  541. }
  542. - (void) unsetExpungedNotes {
  543. [__expungedNotes release];
  544. __expungedNotes = nil;
  545. __expungedNotes_isset = NO;
  546. }
  547. - (NSArray *) expungedNotebooks {
  548. return [[__expungedNotebooks retain] autorelease];
  549. }
  550. - (void) setExpungedNotebooks: (NSArray *) expungedNotebooks {
  551. [expungedNotebooks retain];
  552. [__expungedNotebooks release];
  553. __expungedNotebooks = expungedNotebooks;
  554. __expungedNotebooks_isset = YES;
  555. }
  556. - (BOOL) expungedNotebooksIsSet {
  557. return __expungedNotebooks_isset;
  558. }
  559. - (void) unsetExpungedNotebooks {
  560. [__expungedNotebooks release];
  561. __expungedNotebooks = nil;
  562. __expungedNotebooks_isset = NO;
  563. }
  564. - (NSArray *) expungedTags {
  565. return [[__expungedTags retain] autorelease];
  566. }
  567. - (void) setExpungedTags: (NSArray *) expungedTags {
  568. [expungedTags retain];
  569. [__expungedTags release];
  570. __expungedTags = expungedTags;
  571. __expungedTags_isset = YES;
  572. }
  573. - (BOOL) expungedTagsIsSet {
  574. return __expungedTags_isset;
  575. }
  576. - (void) unsetExpungedTags {
  577. [__expungedTags release];
  578. __expungedTags = nil;
  579. __expungedTags_isset = NO;
  580. }
  581. - (NSArray *) expungedSearches {
  582. return [[__expungedSearches retain] autorelease];
  583. }
  584. - (void) setExpungedSearches: (NSArray *) expungedSearches {
  585. [expungedSearches retain];
  586. [__expungedSearches release];
  587. __expungedSearches = expungedSearches;
  588. __expungedSearches_isset = YES;
  589. }
  590. - (BOOL) expungedSearchesIsSet {
  591. return __expungedSearches_isset;
  592. }
  593. - (void) unsetExpungedSearches {
  594. [__expungedSearches release];
  595. __expungedSearches = nil;
  596. __expungedSearches_isset = NO;
  597. }
  598. - (void) read: (id <TProtocol>) inProtocol
  599. {
  600. NSString * fieldName;
  601. int fieldType;
  602. int fieldID;
  603. [inProtocol readStructBeginReturningName: NULL];
  604. while (true)
  605. {
  606. [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID];
  607. if (fieldType == TType_STOP) {
  608. break;
  609. }
  610. switch (fieldID)
  611. {
  612. case 1:
  613. if (fieldType == TType_I64) {
  614. int64_t fieldValue = [inProtocol readI64];
  615. [self setCurrentTime: fieldValue];
  616. } else {
  617. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  618. }
  619. break;
  620. case 2:
  621. if (fieldType == TType_I32) {
  622. int32_t fieldValue = [inProtocol readI32];
  623. [self setChunkHighUSN: fieldValue];
  624. } else {
  625. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  626. }
  627. break;
  628. case 3:
  629. if (fieldType == TType_I32) {
  630. int32_t fieldValue = [inProtocol readI32];
  631. [self setUpdateCount: fieldValue];
  632. } else {
  633. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  634. }
  635. break;
  636. case 4:
  637. if (fieldType == TType_LIST) {
  638. int _size0;
  639. [inProtocol readListBeginReturningElementType: NULL size: &_size0];
  640. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size0];
  641. int _i1;
  642. for (_i1 = 0; _i1 < _size0; ++_i1)
  643. {
  644. EDAMNote *_elem2 = [[EDAMNote alloc] init];
  645. [_elem2 read: inProtocol];
  646. [fieldValue addObject: _elem2];
  647. [_elem2 release];
  648. }
  649. [inProtocol readListEnd];
  650. [self setNotes: fieldValue];
  651. [fieldValue release];
  652. } else {
  653. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  654. }
  655. break;
  656. case 5:
  657. if (fieldType == TType_LIST) {
  658. int _size3;
  659. [inProtocol readListBeginReturningElementType: NULL size: &_size3];
  660. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size3];
  661. int _i4;
  662. for (_i4 = 0; _i4 < _size3; ++_i4)
  663. {
  664. EDAMNotebook *_elem5 = [[EDAMNotebook alloc] init];
  665. [_elem5 read: inProtocol];
  666. [fieldValue addObject: _elem5];
  667. [_elem5 release];
  668. }
  669. [inProtocol readListEnd];
  670. [self setNotebooks: fieldValue];
  671. [fieldValue release];
  672. } else {
  673. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  674. }
  675. break;
  676. case 6:
  677. if (fieldType == TType_LIST) {
  678. int _size6;
  679. [inProtocol readListBeginReturningElementType: NULL size: &_size6];
  680. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size6];
  681. int _i7;
  682. for (_i7 = 0; _i7 < _size6; ++_i7)
  683. {
  684. EDAMTag *_elem8 = [[EDAMTag alloc] init];
  685. [_elem8 read: inProtocol];
  686. [fieldValue addObject: _elem8];
  687. [_elem8 release];
  688. }
  689. [inProtocol readListEnd];
  690. [self setTags: fieldValue];
  691. [fieldValue release];
  692. } else {
  693. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  694. }
  695. break;
  696. case 7:
  697. if (fieldType == TType_LIST) {
  698. int _size9;
  699. [inProtocol readListBeginReturningElementType: NULL size: &_size9];
  700. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size9];
  701. int _i10;
  702. for (_i10 = 0; _i10 < _size9; ++_i10)
  703. {
  704. EDAMSavedSearch *_elem11 = [[EDAMSavedSearch alloc] init];
  705. [_elem11 read: inProtocol];
  706. [fieldValue addObject: _elem11];
  707. [_elem11 release];
  708. }
  709. [inProtocol readListEnd];
  710. [self setSearches: fieldValue];
  711. [fieldValue release];
  712. } else {
  713. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  714. }
  715. break;
  716. case 8:
  717. if (fieldType == TType_LIST) {
  718. int _size12;
  719. [inProtocol readListBeginReturningElementType: NULL size: &_size12];
  720. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size12];
  721. int _i13;
  722. for (_i13 = 0; _i13 < _size12; ++_i13)
  723. {
  724. EDAMResource *_elem14 = [[EDAMResource alloc] init];
  725. [_elem14 read: inProtocol];
  726. [fieldValue addObject: _elem14];
  727. [_elem14 release];
  728. }
  729. [inProtocol readListEnd];
  730. [self setResources: fieldValue];
  731. [fieldValue release];
  732. } else {
  733. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  734. }
  735. break;
  736. case 9:
  737. if (fieldType == TType_LIST) {
  738. int _size15;
  739. [inProtocol readListBeginReturningElementType: NULL size: &_size15];
  740. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size15];
  741. int _i16;
  742. for (_i16 = 0; _i16 < _size15; ++_i16)
  743. {
  744. NSString * _elem17 = [inProtocol readString];
  745. [fieldValue addObject: _elem17];
  746. }
  747. [inProtocol readListEnd];
  748. [self setExpungedNotes: fieldValue];
  749. [fieldValue release];
  750. } else {
  751. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  752. }
  753. break;
  754. case 10:
  755. if (fieldType == TType_LIST) {
  756. int _size18;
  757. [inProtocol readListBeginReturningElementType: NULL size: &_size18];
  758. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size18];
  759. int _i19;
  760. for (_i19 = 0; _i19 < _size18; ++_i19)
  761. {
  762. NSString * _elem20 = [inProtocol readString];
  763. [fieldValue addObject: _elem20];
  764. }
  765. [inProtocol readListEnd];
  766. [self setExpungedNotebooks: fieldValue];
  767. [fieldValue release];
  768. } else {
  769. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  770. }
  771. break;
  772. case 11:
  773. if (fieldType == TType_LIST) {
  774. int _size21;
  775. [inProtocol readListBeginReturningElementType: NULL size: &_size21];
  776. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size21];
  777. int _i22;
  778. for (_i22 = 0; _i22 < _size21; ++_i22)
  779. {
  780. NSString * _elem23 = [inProtocol readString];
  781. [fieldValue addObject: _elem23];
  782. }
  783. [inProtocol readListEnd];
  784. [self setExpungedTags: fieldValue];
  785. [fieldValue release];
  786. } else {
  787. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  788. }
  789. break;
  790. case 12:
  791. if (fieldType == TType_LIST) {
  792. int _size24;
  793. [inProtocol readListBeginReturningElementType: NULL size: &_size24];
  794. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size24];
  795. int _i25;
  796. for (_i25 = 0; _i25 < _size24; ++_i25)
  797. {
  798. NSString * _elem26 = [inProtocol readString];
  799. [fieldValue addObject: _elem26];
  800. }
  801. [inProtocol readListEnd];
  802. [self setExpungedSearches: fieldValue];
  803. [fieldValue release];
  804. } else {
  805. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  806. }
  807. break;
  808. default:
  809. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  810. break;
  811. }
  812. [inProtocol readFieldEnd];
  813. }
  814. [inProtocol readStructEnd];
  815. }
  816. - (void) write: (id <TProtocol>) outProtocol {
  817. [outProtocol writeStructBeginWithName: @"SyncChunk"];
  818. if (__currentTime_isset) {
  819. [outProtocol writeFieldBeginWithName: @"currentTime" type: TType_I64 fieldID: 1];
  820. [outProtocol writeI64: __currentTime];
  821. [outProtocol writeFieldEnd];
  822. }
  823. if (__chunkHighUSN_isset) {
  824. [outProtocol writeFieldBeginWithName: @"chunkHighUSN" type: TType_I32 fieldID: 2];
  825. [outProtocol writeI32: __chunkHighUSN];
  826. [outProtocol writeFieldEnd];
  827. }
  828. if (__updateCount_isset) {
  829. [outProtocol writeFieldBeginWithName: @"updateCount" type: TType_I32 fieldID: 3];
  830. [outProtocol writeI32: __updateCount];
  831. [outProtocol writeFieldEnd];
  832. }
  833. if (__notes_isset) {
  834. if (__notes != nil) {
  835. [outProtocol writeFieldBeginWithName: @"notes" type: TType_LIST fieldID: 4];
  836. {
  837. [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__notes count]];
  838. int i28;
  839. for (i28 = 0; i28 < [__notes count]; i28++)
  840. {
  841. [[__notes objectAtIndex: i28] write: outProtocol];
  842. }
  843. [outProtocol writeListEnd];
  844. }
  845. [outProtocol writeFieldEnd];
  846. }
  847. }
  848. if (__notebooks_isset) {
  849. if (__notebooks != nil) {
  850. [outProtocol writeFieldBeginWithName: @"notebooks" type: TType_LIST fieldID: 5];
  851. {
  852. [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__notebooks count]];
  853. int i30;
  854. for (i30 = 0; i30 < [__notebooks count]; i30++)
  855. {
  856. [[__notebooks objectAtIndex: i30] write: outProtocol];
  857. }
  858. [outProtocol writeListEnd];
  859. }
  860. [outProtocol writeFieldEnd];
  861. }
  862. }
  863. if (__tags_isset) {
  864. if (__tags != nil) {
  865. [outProtocol writeFieldBeginWithName: @"tags" type: TType_LIST fieldID: 6];
  866. {
  867. [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__tags count]];
  868. int i32;
  869. for (i32 = 0; i32 < [__tags count]; i32++)
  870. {
  871. [[__tags objectAtIndex: i32] write: outProtocol];
  872. }
  873. [outProtocol writeListEnd];
  874. }
  875. [outProtocol writeFieldEnd];
  876. }
  877. }
  878. if (__searches_isset) {
  879. if (__searches != nil) {
  880. [outProtocol writeFieldBeginWithName: @"searches" type: TType_LIST fieldID: 7];
  881. {
  882. [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__searches count]];
  883. int i34;
  884. for (i34 = 0; i34 < [__searches count]; i34++)
  885. {
  886. [[__searches objectAtIndex: i34] write: outProtocol];
  887. }
  888. [outProtocol writeListEnd];
  889. }
  890. [outProtocol writeFieldEnd];
  891. }
  892. }
  893. if (__resources_isset) {
  894. if (__resources != nil) {
  895. [outProtocol writeFieldBeginWithName: @"resources" type: TType_LIST fieldID: 8];
  896. {
  897. [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__resources count]];
  898. int i36;
  899. for (i36 = 0; i36 < [__resources count]; i36++)
  900. {
  901. [[__resources objectAtIndex: i36] write: outProtocol];
  902. }
  903. [outProtocol writeListEnd];
  904. }
  905. [outProtocol writeFieldEnd];
  906. }
  907. }
  908. if (__expungedNotes_isset) {
  909. if (__expungedNotes != nil) {
  910. [outProtocol writeFieldBeginWithName: @"expungedNotes" type: TType_LIST fieldID: 9];
  911. {
  912. [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedNotes count]];
  913. int i38;
  914. for (i38 = 0; i38 < [__expungedNotes count]; i38++)
  915. {
  916. [outProtocol writeString: [__expungedNotes objectAtIndex: i38]];
  917. }
  918. [outProtocol writeListEnd];
  919. }
  920. [outProtocol writeFieldEnd];
  921. }
  922. }
  923. if (__expungedNotebooks_isset) {
  924. if (__expungedNotebooks != nil) {
  925. [outProtocol writeFieldBeginWithName: @"expungedNotebooks" type: TType_LIST fieldID: 10];
  926. {
  927. [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedNotebooks count]];
  928. int i40;
  929. for (i40 = 0; i40 < [__expungedNotebooks count]; i40++)
  930. {
  931. [outProtocol writeString: [__expungedNotebooks objectAtIndex: i40]];
  932. }
  933. [outProtocol writeListEnd];
  934. }
  935. [outProtocol writeFieldEnd];
  936. }
  937. }
  938. if (__expungedTags_isset) {
  939. if (__expungedTags != nil) {
  940. [outProtocol writeFieldBeginWithName: @"expungedTags" type: TType_LIST fieldID: 11];
  941. {
  942. [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedTags count]];
  943. int i42;
  944. for (i42 = 0; i42 < [__expungedTags count]; i42++)
  945. {
  946. [outProtocol writeString: [__expungedTags objectAtIndex: i42]];
  947. }
  948. [outProtocol writeListEnd];
  949. }
  950. [outProtocol writeFieldEnd];
  951. }
  952. }
  953. if (__expungedSearches_isset) {
  954. if (__expungedSearches != nil) {
  955. [outProtocol writeFieldBeginWithName: @"expungedSearches" type: TType_LIST fieldID: 12];
  956. {
  957. [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedSearches count]];
  958. int i44;
  959. for (i44 = 0; i44 < [__expungedSearches count]; i44++)
  960. {
  961. [outProtocol writeString: [__expungedSearches objectAtIndex: i44]];
  962. }
  963. [outProtocol writeListEnd];
  964. }
  965. [outProtocol writeFieldEnd];
  966. }
  967. }
  968. [outProtocol writeFieldStop];
  969. [outProtocol writeStructEnd];
  970. }
  971. - (NSString *) description {
  972. NSMutableString * ms = [NSMutableString stringWithString: @"SyncChunk("];
  973. [ms appendString: @"currentTime:"];
  974. [ms appendFormat: @"%qi", __currentTime];
  975. [ms appendString: @",chunkHighUSN:"];
  976. [ms appendFormat: @"%i", __chunkHighUSN];
  977. [ms appendString: @",updateCount:"];
  978. [ms appendFormat: @"%i", __updateCount];
  979. [ms appendString: @",notes:"];
  980. [ms appendFormat: @"%@", __notes];
  981. [ms appendString: @",notebooks:"];
  982. [ms appendFormat: @"%@", __notebooks];
  983. [ms appendString: @",tags:"];
  984. [ms appendFormat: @"%@", __tags];
  985. [ms appendString: @",searches:"];
  986. [ms appendFormat: @"%@", __searches];
  987. [ms appendString: @",resources:"];
  988. [ms appendFormat: @"%@", __resources];
  989. [ms appendString: @",expungedNotes:"];
  990. [ms appendFormat: @"%@", __expungedNotes];
  991. [ms appendString: @",expungedNotebooks:"];
  992. [ms appendFormat: @"%@", __expungedNotebooks];
  993. [ms appendString: @",expungedTags:"];
  994. [ms appendFormat: @"%@", __expungedTags];
  995. [ms appendString: @",expungedSearches:"];
  996. [ms appendFormat: @"%@", __expungedSearches];
  997. [ms appendString: @")"];
  998. return [NSString stringWithString: ms];
  999. }
  1000. @end
  1001. @implementation EDAMNoteFilter
  1002. #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
  1003. @dynamic order;
  1004. @dynamic ascending;
  1005. @dynamic words;
  1006. @dynamic notebookGuid;
  1007. @dynamic tagGuids;
  1008. @dynamic timeZone;
  1009. @dynamic inactive;
  1010. #endif
  1011. - (id) initWithOrder: (int32_t) order ascending: (BOOL) ascending words: (NSString *) words notebookGuid: (EDAMGuid) notebookGuid tagGuids: (NSArray *) tagGuids timeZone: (NSString *) timeZone inactive: (BOOL) inactive
  1012. {
  1013. self = [super init];
  1014. __order = order;
  1015. __order_isset = YES;
  1016. __ascending = ascending;
  1017. __ascending_isset = YES;
  1018. __words = [words retain];
  1019. __words_isset = YES;
  1020. __notebookGuid = [notebookGuid retain];
  1021. __notebookGuid_isset = YES;
  1022. __tagGuids = [tagGuids retain];
  1023. __tagGuids_isset = YES;
  1024. __timeZone = [timeZone retain];
  1025. __timeZone_isset = YES;
  1026. __inactive = inactive;
  1027. __inactive_isset = YES;
  1028. return self;
  1029. }
  1030. - (id) initWithCoder: (NSCoder *) decoder
  1031. {
  1032. self = [super init];
  1033. if ([decoder containsValueForKey: @"order"])
  1034. {
  1035. __order = [decoder decodeInt32ForKey: @"order"];
  1036. __order_isset = YES;
  1037. }
  1038. if ([decoder containsValueForKey: @"ascending"])
  1039. {
  1040. __ascending = [decoder decodeBoolForKey: @"ascending"];
  1041. __ascending_isset = YES;
  1042. }
  1043. if ([decoder containsValueForKey: @"words"])
  1044. {
  1045. __words = [[decoder decodeObjectForKey: @"words"] retain];
  1046. __words_isset = YES;
  1047. }
  1048. if ([decoder containsValueForKey: @"notebookGuid"])
  1049. {
  1050. __notebookGuid = [[decoder decodeObjectForKey: @"notebookGuid"] retain];
  1051. __notebookGuid_isset = YES;
  1052. }
  1053. if ([decoder containsValueForKey: @"tagGuids"])
  1054. {
  1055. __tagGuids = [[decoder decodeObjectForKey: @"tagGuids"] retain];
  1056. __tagGuids_isset = YES;
  1057. }
  1058. if ([decoder containsValueForKey: @"timeZone"])
  1059. {
  1060. __timeZone = [[decoder decodeObjectForKey: @"timeZone"] retain];
  1061. __timeZone_isset = YES;
  1062. }
  1063. if ([decoder containsValueForKey: @"inactive"])
  1064. {
  1065. __inactive = [decoder decodeBoolForKey: @"inactive"];
  1066. __inactive_isset = YES;
  1067. }
  1068. return self;
  1069. }
  1070. - (void) encodeWithCoder: (NSCoder *) encoder
  1071. {
  1072. if (__order_isset)
  1073. {
  1074. [encoder encodeInt32: __order forKey: @"order"];
  1075. }
  1076. if (__ascending_isset)
  1077. {
  1078. [encoder encodeBool: __ascending forKey: @"ascending"];
  1079. }
  1080. if (__words_isset)
  1081. {
  1082. [encoder encodeObject: __words forKey: @"words"];
  1083. }
  1084. if (__notebookGuid_isset)
  1085. {
  1086. [encoder encodeObject: __notebookGuid forKey: @"notebookGuid"];
  1087. }
  1088. if (__tagGuids_isset)
  1089. {
  1090. [encoder encodeObject: __tagGuids forKey: @"tagGuids"];
  1091. }
  1092. if (__timeZone_isset)
  1093. {
  1094. [encoder encodeObject: __timeZone forKey: @"timeZone"];
  1095. }
  1096. if (__inactive_isset)
  1097. {
  1098. [encoder encodeBool: __inactive forKey: @"inactive"];
  1099. }
  1100. }
  1101. - (void) dealloc
  1102. {
  1103. [__words release];
  1104. [__notebookGuid release];
  1105. [__tagGuids release];
  1106. [__timeZone release];
  1107. [super dealloc];
  1108. }
  1109. - (int32_t) order {
  1110. return __order;
  1111. }
  1112. - (void) setOrder: (int32_t) order {
  1113. __order = order;
  1114. __order_isset = YES;
  1115. }
  1116. - (BOOL) orderIsSet {
  1117. return __order_isset;
  1118. }
  1119. - (void) unsetOrder {
  1120. __order_isset = NO;
  1121. }
  1122. - (BOOL) ascending {
  1123. return __ascending;
  1124. }
  1125. - (void) setAscending: (BOOL) ascending {
  1126. __ascending = ascending;
  1127. __ascending_isset = YES;
  1128. }
  1129. - (BOOL) ascendingIsSet {
  1130. return __ascending_isset;
  1131. }
  1132. - (void) unsetAscending {
  1133. __ascending_isset = NO;
  1134. }
  1135. - (NSString *) words {
  1136. return [[__words retain] autorelease];
  1137. }
  1138. - (void) setWords: (NSString *) words {
  1139. [words retain];
  1140. [__words release];
  1141. __words = words;
  1142. __words_isset = YES;
  1143. }
  1144. - (BOOL) wordsIsSet {
  1145. return __words_isset;
  1146. }
  1147. - (void) unsetWords {
  1148. [__words release];
  1149. __words = nil;
  1150. __words_isset = NO;
  1151. }
  1152. - (NSString *) notebookGuid {
  1153. return [[__notebookGuid retain] autorelease];
  1154. }
  1155. - (void) setNotebookGuid: (NSString *) notebookGuid {
  1156. [notebookGuid retain];
  1157. [__notebookGuid release];
  1158. __notebookGuid = notebookGuid;
  1159. __notebookGuid_isset = YES;
  1160. }
  1161. - (BOOL) notebookGuidIsSet {
  1162. return __notebookGuid_isset;
  1163. }
  1164. - (void) unsetNotebookGuid {
  1165. [__notebookGuid release];
  1166. __notebookGuid = nil;
  1167. __notebookGuid_isset = NO;
  1168. }
  1169. - (NSArray *) tagGuids {
  1170. return [[__tagGuids retain] autorelease];
  1171. }
  1172. - (void) setTagGuids: (NSArray *) tagGuids {
  1173. [tagGuids retain];
  1174. [__tagGuids release];
  1175. __tagGuids = tagGuids;
  1176. __tagGuids_isset = YES;
  1177. }
  1178. - (BOOL) tagGuidsIsSet {
  1179. return __tagGuids_isset;
  1180. }
  1181. - (void) unsetTagGuids {
  1182. [__tagGuids release];
  1183. __tagGuids = nil;
  1184. __tagGuids_isset = NO;
  1185. }
  1186. - (NSString *) timeZone {
  1187. return [[__timeZone retain] autorelease];
  1188. }
  1189. - (void) setTimeZone: (NSString *) timeZone {
  1190. [timeZone retain];
  1191. [__timeZone release];
  1192. __timeZone = timeZone;
  1193. __timeZone_isset = YES;
  1194. }
  1195. - (BOOL) timeZoneIsSet {
  1196. return __timeZone_isset;
  1197. }
  1198. - (void) unsetTimeZone {
  1199. [__timeZone release];
  1200. __timeZone = nil;
  1201. __timeZone_isset = NO;
  1202. }
  1203. - (BOOL) inactive {
  1204. return __inactive;
  1205. }
  1206. - (void) setInactive: (BOOL) inactive {
  1207. __inactive = inactive;
  1208. __inactive_isset = YES;
  1209. }
  1210. - (BOOL) inactiveIsSet {
  1211. return __inactive_isset;
  1212. }
  1213. - (void) unsetInactive {
  1214. __inactive_isset = NO;
  1215. }
  1216. - (void) read: (id <TProtocol>) inProtocol
  1217. {
  1218. NSString * fieldName;
  1219. int fieldType;
  1220. int fieldID;
  1221. [inProtocol readStructBeginReturningName: NULL];
  1222. while (true)
  1223. {
  1224. [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID];
  1225. if (fieldType == TType_STOP) {
  1226. break;
  1227. }
  1228. switch (fieldID)
  1229. {
  1230. case 1:
  1231. if (fieldType == TType_I32) {
  1232. int32_t fieldValue = [inProtocol readI32];
  1233. [self setOrder: fieldValue];
  1234. } else {
  1235. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1236. }
  1237. break;
  1238. case 2:
  1239. if (fieldType == TType_BOOL) {
  1240. BOOL fieldValue = [inProtocol readBool];
  1241. [self setAscending: fieldValue];
  1242. } else {
  1243. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1244. }
  1245. break;
  1246. case 3:
  1247. if (fieldType == TType_STRING) {
  1248. NSString * fieldValue = [inProtocol readString];
  1249. [self setWords: fieldValue];
  1250. } else {
  1251. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1252. }
  1253. break;
  1254. case 4:
  1255. if (fieldType == TType_STRING) {
  1256. NSString * fieldValue = [inProtocol readString];
  1257. [self setNotebookGuid: fieldValue];
  1258. } else {
  1259. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1260. }
  1261. break;
  1262. case 5:
  1263. if (fieldType == TType_LIST) {
  1264. int _size45;
  1265. [inProtocol readListBeginReturningElementType: NULL size: &_size45];
  1266. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size45];
  1267. int _i46;
  1268. for (_i46 = 0; _i46 < _size45; ++_i46)
  1269. {
  1270. NSString * _elem47 = [inProtocol readString];
  1271. [fieldValue addObject: _elem47];
  1272. }
  1273. [inProtocol readListEnd];
  1274. [self setTagGuids: fieldValue];
  1275. [fieldValue release];
  1276. } else {
  1277. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1278. }
  1279. break;
  1280. case 6:
  1281. if (fieldType == TType_STRING) {
  1282. NSString * fieldValue = [inProtocol readString];
  1283. [self setTimeZone: fieldValue];
  1284. } else {
  1285. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1286. }
  1287. break;
  1288. case 7:
  1289. if (fieldType == TType_BOOL) {
  1290. BOOL fieldValue = [inProtocol readBool];
  1291. [self setInactive: fieldValue];
  1292. } else {
  1293. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1294. }
  1295. break;
  1296. default:
  1297. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1298. break;
  1299. }
  1300. [inProtocol readFieldEnd];
  1301. }
  1302. [inProtocol readStructEnd];
  1303. }
  1304. - (void) write: (id <TProtocol>) outProtocol {
  1305. [outProtocol writeStructBeginWithName: @"NoteFilter"];
  1306. if (__order_isset) {
  1307. [outProtocol writeFieldBeginWithName: @"order" type: TType_I32 fieldID: 1];
  1308. [outProtocol writeI32: __order];
  1309. [outProtocol writeFieldEnd];
  1310. }
  1311. if (__ascending_isset) {
  1312. [outProtocol writeFieldBeginWithName: @"ascending" type: TType_BOOL fieldID: 2];
  1313. [outProtocol writeBool: __ascending];
  1314. [outProtocol writeFieldEnd];
  1315. }
  1316. if (__words_isset) {
  1317. if (__words != nil) {
  1318. [outProtocol writeFieldBeginWithName: @"words" type: TType_STRING fieldID: 3];
  1319. [outProtocol writeString: __words];
  1320. [outProtocol writeFieldEnd];
  1321. }
  1322. }
  1323. if (__notebookGuid_isset) {
  1324. if (__notebookGuid != nil) {
  1325. [outProtocol writeFieldBeginWithName: @"notebookGuid" type: TType_STRING fieldID: 4];
  1326. [outProtocol writeString: __notebookGuid];
  1327. [outProtocol writeFieldEnd];
  1328. }
  1329. }
  1330. if (__tagGuids_isset) {
  1331. if (__tagGuids != nil) {
  1332. [outProtocol writeFieldBeginWithName: @"tagGuids" type: TType_LIST fieldID: 5];
  1333. {
  1334. [outProtocol writeListBeginWithElementType: TType_STRING size: [__tagGuids count]];
  1335. int i49;
  1336. for (i49 = 0; i49 < [__tagGuids count]; i49++)
  1337. {
  1338. [outProtocol writeString: [__tagGuids objectAtIndex: i49]];
  1339. }
  1340. [outProtocol writeListEnd];
  1341. }
  1342. [outProtocol writeFieldEnd];
  1343. }
  1344. }
  1345. if (__timeZone_isset) {
  1346. if (__timeZone != nil) {
  1347. [outProtocol writeFieldBeginWithName: @"timeZone" type: TType_STRING fieldID: 6];
  1348. [outProtocol writeString: __timeZone];
  1349. [outProtocol writeFieldEnd];
  1350. }
  1351. }
  1352. if (__inactive_isset) {
  1353. [outProtocol writeFieldBeginWithName: @"inactive" type: TType_BOOL fieldID: 7];
  1354. [outProtocol writeBool: __inactive];
  1355. [outProtocol writeFieldEnd];
  1356. }
  1357. [outProtocol writeFieldStop];
  1358. [outProtocol writeStructEnd];
  1359. }
  1360. - (NSString *) description {
  1361. NSMutableString * ms = [NSMutableString stringWithString: @"NoteFilter("];
  1362. [ms appendString: @"order:"];
  1363. [ms appendFormat: @"%i", __order];
  1364. [ms appendString: @",ascending:"];
  1365. [ms appendFormat: @"%i", __ascending];
  1366. [ms appendString: @",words:"];
  1367. [ms appendFormat: @"\"%@\"", __words];
  1368. [ms appendString: @",notebookGuid:"];
  1369. [ms appendFormat: @"\"%@\"", __notebookGuid];
  1370. [ms appendString: @",tagGuids:"];
  1371. [ms appendFormat: @"%@", __tagGuids];
  1372. [ms appendString: @",timeZone:"];
  1373. [ms appendFormat: @"\"%@\"", __timeZone];
  1374. [ms appendString: @",inactive:"];
  1375. [ms appendFormat: @"%i", __inactive];
  1376. [ms appendString: @")"];
  1377. return [NSString stringWithString: ms];
  1378. }
  1379. @end
  1380. @implementation EDAMNoteList
  1381. #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
  1382. @dynamic startIndex;
  1383. @dynamic totalNotes;
  1384. @dynamic notes;
  1385. @dynamic stoppedWords;
  1386. @dynamic searchedWords;
  1387. #endif
  1388. - (id) initWithStartIndex: (int32_t) startIndex totalNotes: (int32_t) totalNotes notes: (NSArray *) notes stoppedWords: (NSArray *) stoppedWords searchedWords: (NSArray *) searchedWords
  1389. {
  1390. self = [super init];
  1391. __startIndex = startIndex;
  1392. __startIndex_isset = YES;
  1393. __totalNotes = totalNotes;
  1394. __totalNotes_isset = YES;
  1395. __notes = [notes retain];
  1396. __notes_isset = YES;
  1397. __stoppedWords = [stoppedWords retain];
  1398. __stoppedWords_isset = YES;
  1399. __searchedWords = [searchedWords retain];
  1400. __searchedWords_isset = YES;
  1401. return self;
  1402. }
  1403. - (id) initWithCoder: (NSCoder *) decoder
  1404. {
  1405. self = [super init];
  1406. if ([decoder containsValueForKey: @"startIndex"])
  1407. {
  1408. __startIndex = [decoder decodeInt32ForKey: @"startIndex"];
  1409. __startIndex_isset = YES;
  1410. }
  1411. if ([decoder containsValueForKey: @"totalNotes"])
  1412. {
  1413. __totalNotes = [decoder decodeInt32ForKey: @"totalNotes"];
  1414. __totalNotes_isset = YES;
  1415. }
  1416. if ([decoder containsValueForKey: @"notes"])
  1417. {
  1418. __notes = [[decoder decodeObjectForKey: @"notes"] retain];
  1419. __notes_isset = YES;
  1420. }
  1421. if ([decoder containsValueForKey: @"stoppedWords"])
  1422. {
  1423. __stoppedWords = [[decoder decodeObjectForKey: @"stoppedWords"] retain];
  1424. __stoppedWords_isset = YES;
  1425. }
  1426. if ([decoder containsValueForKey: @"searchedWords"])
  1427. {
  1428. __searchedWords = [[decoder decodeObjectForKey: @"searchedWords"] retain];
  1429. __searchedWords_isset = YES;
  1430. }
  1431. return self;
  1432. }
  1433. - (void) encodeWithCoder: (NSCoder *) encoder
  1434. {
  1435. if (__startIndex_isset)
  1436. {
  1437. [encoder encodeInt32: __startIndex forKey: @"startIndex"];
  1438. }
  1439. if (__totalNotes_isset)
  1440. {
  1441. [encoder encodeInt32: __totalNotes forKey: @"totalNotes"];
  1442. }
  1443. if (__notes_isset)
  1444. {
  1445. [encoder encodeObject: __notes forKey: @"notes"];
  1446. }
  1447. if (__stoppedWords_isset)
  1448. {
  1449. [encoder encodeObject: __stoppedWords forKey: @"stoppedWords"];
  1450. }
  1451. if (__searchedWords_isset)
  1452. {
  1453. [encoder encodeObject: __searchedWords forKey: @"searchedWords"];
  1454. }
  1455. }
  1456. - (void) dealloc
  1457. {
  1458. [__notes release];
  1459. [__stoppedWords release];
  1460. [__searchedWords release];
  1461. [super dealloc];
  1462. }
  1463. - (int32_t) startIndex {
  1464. return __startIndex;
  1465. }
  1466. - (void) setStartIndex: (int32_t) startIndex {
  1467. __startIndex = startIndex;
  1468. __startIndex_isset = YES;
  1469. }
  1470. - (BOOL) startIndexIsSet {
  1471. return __startIndex_isset;
  1472. }
  1473. - (void) unsetStartIndex {
  1474. __startIndex_isset = NO;
  1475. }
  1476. - (int32_t) totalNotes {
  1477. return __totalNotes;
  1478. }
  1479. - (void) setTotalNotes: (int32_t) totalNotes {
  1480. __totalNotes = totalNotes;
  1481. __totalNotes_isset = YES;
  1482. }
  1483. - (BOOL) totalNotesIsSet {
  1484. return __totalNotes_isset;
  1485. }
  1486. - (void) unsetTotalNotes {
  1487. __totalNotes_isset = NO;
  1488. }
  1489. - (NSArray *) notes {
  1490. return [[__notes retain] autorelease];
  1491. }
  1492. - (void) setNotes: (NSArray *) notes {
  1493. [notes retain];
  1494. [__notes release];
  1495. __notes = notes;
  1496. __notes_isset = YES;
  1497. }
  1498. - (BOOL) notesIsSet {
  1499. return __notes_isset;
  1500. }
  1501. - (void) unsetNotes {
  1502. [__notes release];
  1503. __notes = nil;
  1504. __notes_isset = NO;
  1505. }
  1506. - (NSArray *) stoppedWords {
  1507. return [[__stoppedWords retain] autorelease];
  1508. }
  1509. - (void) setStoppedWords: (NSArray *) stoppedWords {
  1510. [stoppedWords retain];
  1511. [__stoppedWords release];
  1512. __stoppedWords = stoppedWords;
  1513. __stoppedWords_isset = YES;
  1514. }
  1515. - (BOOL) stoppedWordsIsSet {
  1516. return __stoppedWords_isset;
  1517. }
  1518. - (void) unsetStoppedWords {
  1519. [__stoppedWords release];
  1520. __stoppedWords = nil;
  1521. __stoppedWords_isset = NO;
  1522. }
  1523. - (NSArray *) searchedWords {
  1524. return [[__searchedWords retain] autorelease];
  1525. }
  1526. - (void) setSearchedWords: (NSArray *) searchedWords {
  1527. [searchedWords retain];
  1528. [__searchedWords release];
  1529. __searchedWords = searchedWords;
  1530. __searchedWords_isset = YES;
  1531. }
  1532. - (BOOL) searchedWordsIsSet {
  1533. return __searchedWords_isset;
  1534. }
  1535. - (void) unsetSearchedWords {
  1536. [__searchedWords release];
  1537. __searchedWords = nil;
  1538. __searchedWords_isset = NO;
  1539. }
  1540. - (void) read: (id <TProtocol>) inProtocol
  1541. {
  1542. NSString * fieldName;
  1543. int fieldType;
  1544. int fieldID;
  1545. [inProtocol readStructBeginReturningName: NULL];
  1546. while (true)
  1547. {
  1548. [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID];
  1549. if (fieldType == TType_STOP) {
  1550. break;
  1551. }
  1552. switch (fieldID)
  1553. {
  1554. case 1:
  1555. if (fieldType == TType_I32) {
  1556. int32_t fieldValue = [inProtocol readI32];
  1557. [self setStartIndex: fieldValue];
  1558. } else {
  1559. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1560. }
  1561. break;
  1562. case 2:
  1563. if (fieldType == TType_I32) {
  1564. int32_t fieldValue = [inProtocol readI32];
  1565. [self setTotalNotes: fieldValue];
  1566. } else {
  1567. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1568. }
  1569. break;
  1570. case 3:
  1571. if (fieldType == TType_LIST) {
  1572. int _size50;
  1573. [inProtocol readListBeginReturningElementType: NULL size: &_size50];
  1574. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size50];
  1575. int _i51;
  1576. for (_i51 = 0; _i51 < _size50; ++_i51)
  1577. {
  1578. EDAMNote *_elem52 = [[EDAMNote alloc] init];
  1579. [_elem52 read: inProtocol];
  1580. [fieldValue addObject: _elem52];
  1581. [_elem52 release];
  1582. }
  1583. [inProtocol readListEnd];
  1584. [self setNotes: fieldValue];
  1585. [fieldValue release];
  1586. } else {
  1587. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1588. }
  1589. break;
  1590. case 4:
  1591. if (fieldType == TType_LIST) {
  1592. int _size53;
  1593. [inProtocol readListBeginReturningElementType: NULL size: &_size53];
  1594. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size53];
  1595. int _i54;
  1596. for (_i54 = 0; _i54 < _size53; ++_i54)
  1597. {
  1598. NSString * _elem55 = [inProtocol readString];
  1599. [fieldValue addObject: _elem55];
  1600. }
  1601. [inProtocol readListEnd];
  1602. [self setStoppedWords: fieldValue];
  1603. [fieldValue release];
  1604. } else {
  1605. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1606. }
  1607. break;
  1608. case 5:
  1609. if (fieldType == TType_LIST) {
  1610. int _size56;
  1611. [inProtocol readListBeginReturningElementType: NULL size: &_size56];
  1612. NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size56];
  1613. int _i57;
  1614. for (_i57 = 0; _i57 < _size56; ++_i57)
  1615. {
  1616. NSString * _elem58 = [inProtocol readString];
  1617. [fieldValue addObject: _elem58];
  1618. }
  1619. [inProtocol readListEnd];
  1620. [self setSearchedWords: fieldValue];
  1621. [fieldValue release];
  1622. } else {
  1623. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1624. }
  1625. break;
  1626. default:
  1627. [TProtocolUtil skipType: fieldType onProtocol: inProtocol];
  1628. break;
  1629. }
  1630. [inProtocol readFieldEnd];
  1631. }
  1632. [inProtocol readStructEnd];
  1633. }
  1634. - (void) write: (id <TProtocol>) outProtocol {
  1635. [outProtocol writeStructBeginWithName: @"NoteList"];
  1636. if (__startIndex_isset) {
  1637. [outProtocol writeFieldBeginWithName: @"startIndex" type: TType_I32 fieldID: 1];
  1638. [outProtocol writeI32: __startIndex];
  1639. [outProtocol writeFieldEnd];
  1640. }
  1641. if (__totalNotes_isset) {
  1642. [outProtocol writeFieldBeginWithName: @"totalNotes" type: TType_I32 fieldID: 2];
  1643. [outProtocol writeI32: __totalNotes];
  1644. [outProtocol writeFieldEnd];
  1645. }
  1646. if (__notes_isset) {
  1647. if (__notes != nil) {
  1648. [outProtocol writeFieldBeginWithName: @"notes" type: TType_LIST fieldID: 3];
  1649. {
  1650. [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__notes count]];
  1651. int i60;
  1652. for (i60 = 0; i60 < [__notes count]; i60++)
  1653. {
  1654. [[__notes objectAtIndex: i60] write: outProtocol];
  1655. }
  1656. [outProtocol writeListEnd];
  1657. }
  1658. [outProtocol writeFieldEnd];
  1659. }
  1660. }
  1661. if (__stoppedWords_isset) {
  1662. if (__stoppedWords != nil) {
  1663. [outProtocol writeFieldBeginWithName: @"stoppedWords" type: TType_LIST fieldID: 4];
  1664. {
  1665. [outProtocol writeListBeginWithElementType: TType_STRING size: [__stoppedWords count]];
  1666. int i62;
  1667. for (i62 = 0; i62 < [__stoppedWords count]; i62++)
  1668. {
  1669. [outProtocol writeString: [__stoppedWords objectAtIndex: i62]];
  1670. }
  1671. [outProtocol writeListEnd];
  1672. }
  1673. [outProtocol writeFieldEnd];
  1674. }
  1675. }
  1676. if (__searchedWords_isset) {
  1677. if (__searchedWords != nil) {
  1678. [outProtocol writeFieldBeginWithName: @"searchedWords" type: TType_LIST fieldID: 5];
  1679. {
  1680. [outProtocol writeListBeginWithElementType: TType_STRING size: [__searchedWords count]];
  1681. int i64;
  1682. for (i64 = 0; i64 < [__searchedWords count]; i64++)
  1683. {
  1684. [outProtocol writeString: [__searchedWords objectAtIndex: i64]];
  1685. }
  1686. [outProtocol writeListEnd];
  1687. }
  1688. [outProtocol writeFieldEnd];
  1689. }
  1690. }
  1691. [outProtocol writeFieldStop];
  1692. [outProtocol writeStructEnd];
  1693. }
  1694. - (NSString