This file is indexed.

/usr/include/GNUstep/Frameworks/Pantomime.framework/Versions/1.2/CWFolder.h is in libpantomime1.2-dev 1.2.2~r289+dfsg-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
/*
**  CWFolder.h
**
**  Copyright (c) 2001-2006
**                2013 Free Software Foundation
**
**  Author: Ludovic Marcotte <ludovic@Sophos.ca>
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**  
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
**  Lesser General Public License for more details.
**  
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef _Pantomime_H_CWFolder
#define _Pantomime_H_CWFolder

#import <Foundation/NSArray.h>
#import <Foundation/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSNotification.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>

#include <Pantomime/CWConstants.h>

@class CWFlags;
@class CWMessage;

/*!
  @const PantomimeFolderAppendCompleted
*/
extern NSString* PantomimeFolderAppendCompleted;

/*!
  @const PantomimeFolderAppendFailed
*/
extern NSString* PantomimeFolderAppendFailed;

/*!
  @const PantomimeFolderCloseCompleted
*/
extern NSString* PantomimeFolderCloseCompleted;

/*!
  @const PantomimeFolderCloseFailed
*/
extern NSString* PantomimeFolderCloseFailed;

/*!
  @const PantomimeFolderExpungeCompleted
*/
extern NSString* PantomimeFolderExpungeCompleted;

/*!
  @const PantomimeFolderExpungeFailed
*/
extern NSString* PantomimeFolderExpungeFailed;

/*!
  @const PantomimeFolderListCompleted
*/
extern NSString* PantomimeFolderListCompleted;

/*!
  @const PantomimeFolderListFailed
*/
extern NSString* PantomimeFolderListFailed;

/*!
  @const PantomimeFolderListSubscribedCompleted
*/
extern NSString* PantomimeFolderListSubscribedCompleted;

/*!
  @const PantomimeFolderListSubscribedFailed
*/
extern NSString* PantomimeFolderListSubscribedFailed;

/*!
  @const PantomimeFolderOpenCompleted
*/
extern NSString* PantomimeFolderOpenCompleted;

/*!
  @const PantomimeFolderOpenFailed
*/
extern NSString* PantomimeFolderOpenFailed;

/*!
  @const PantomimeFolderPrefetchCompleted
*/
extern NSString* PantomimeFolderPrefetchCompleted;

/*!
  @const PantomimeFolderPrefetchFailed
*/
extern NSString* PantomimeFolderPrefetchFailed;

/*!
  @const PantomimeFolderSearchCompleted
*/
extern NSString* PantomimeFolderSearchCompleted;

/*!
  @const PantomimeFolderSearchFailed
*/
extern NSString* PantomimeFolderSearchFailed;


/*!
  @category NSObject (PantomimeFolderDelegate)
  @discussion This informal protocol defines methods that can implemented in
              CWFolder's delegate to control the behavior of the class 
	      or to obtain status information.
*/
@interface NSObject (PantomimeFolderDelegate)

/*!
  @method folderAppendCompleted:
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the last
	      message append operation was sucessful.
	      A PantomimeFolderAppendCompleted notification is
	      also posted.
  @param theNotification The notification holding the information.
*/
- (void) folderAppendCompleted: (NSNotification *) theNotification;

/*!
  @method folderAppendFailed:
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the last
	      message append operation failed.
	      A PantomimeFolderAppendCompleted notification is
	      also posted.
  @param theNotification The notification holding the information.
*/
- (void) folderAppendFailed: (NSNotification *) theNotification;

/*!
  @method folderCloseCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the close
	      operation completed.
  @param theNotification The notification holding the information.
 */
- (void) folderCloseCompleted: (NSNotification *) theNotification;

/*!
  @method folderCloseFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the close
	      operation failed.
  @param theNotification The notification holding the information.
 */
- (void) folderCloseFailed: (NSNotification *) theNotification;

/*!
  @method folderExpungeCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the expunge
	      operation completed.
  @param theNotification The notification holding the information.
 */
- (void) folderExpungeCompleted: (NSNotification *) theNotification;

/*!
  @method folderExpungeFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the expunge
	      operation failed.
  @param theNotification The notification holding the information.
 */
- (void) folderExpungeFailed: (NSNotification *) theNotification;

/*!
  @method folderListCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the mailbox listing
	      operation completed.
  @param theNotification The notification holding the information.
 */
- (void) folderListCompleted: (NSNotification *) theNotification;

/*!
  @method folderListFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the mailbox listing
	      operation failed.
  @param theNotification The notification holding the information.
 */
- (void) folderListFailed: (NSNotification *) theNotification;

/*!
  @method folderListSubscribedCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the listing operation
	      of subscribed mailboxes completed.
  @param theNotification The notification holding the information.
 */
- (void) folderListSubscribedCompleted: (NSNotification *) theNotification;

/*!
  @method folderListSuscribedFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the listing operation
	      of subscribed mailboxes failed.
  @param theNotification The notification holding the information.
 */
- (void) folderListSubscribedFailed: (NSNotification *) theNotification;

/*!
  @method folderOpenCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the open
	      operation completed.
  @param theNotification The notification holding the information.
 */
- (void) folderOpenCompleted: (NSNotification *) theNotification;

/*!
  @method folderOpenFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the open
	      operation failed.
  @param theNotification The notification holding the information.
 */
- (void) folderOpenFailed: (NSNotification *) theNotification;

/*!
  @method folderPrefetchCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the prefetch
	      operation completed.
  @param theNotification The notification holding the information.
 */
- (void) folderPrefetchCompleted: (NSNotification *) theNotification;

/*!
  @method folderPrefetchFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the prefetch
	      operation failed.
  @param theNotification The notification holding the information.
 */
- (void) folderPrefetchFailed: (NSNotification *) theNotification;

/*!
  @method folderSearchCompleted
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the search
	      operation completed.
  @param theNotification The notification holding the information.
 */
- (void) folderSearchCompleted: (NSNotification *) theNotification;

/*!
  @method folderSearchFailed
  @discussion This method is automatically invoked on the store's
              delegate in order to indicate that the search
	      operation failed.
  @param theNotification The notification holding the information.
 */
- (void) folderSearchFailed: (NSNotification *) theNotification;

@end

/*!
  @class CWFolder
  @abstract A CWFolder object holds CWMessage instances.
  @discussion This abstract class is used to represent a folder which holds messages.
              A folder is a synonym for mailbox. Normally, you should never create
              an instance of CWFolder directly but rather use the subclasses which
	      are CWIMAPFolder, CWLocalFolder and CWPOP3Folder. Futhermore, the corresponding
	      CWStore classes will instanciate the CWFolder subclasses for you.
*/
@interface CWFolder : NSObject 
{
  @public
    NSMutableArray *allMessages;

  @protected
    NSMutableDictionary *_properties;
    NSString *_name;

    id _cacheManager;
    id _store;

    NSMutableArray *_allVisibleMessages;
    NSMutableArray *_allContainers;
   
    BOOL _show_deleted;
    BOOL _show_read;

    PantomimeFolderMode _mode;
}

/*!
  @method initWithName:
  @discussion This method initialize a folder with the
              specified name. The name can contain folder
	      separators in order to create subfolders.
	      The separator can be obtained from a
	      class that implements the CWStore protocol.
  @param theName The full path of the folder.
  @result The folder, nil in case of an error.
*/
- (id) initWithName: (NSString *) theName;

/*!
  @method name
  @discussion This method returns the name of the folder.
  @result The full name of the folder.
*/
- (NSString *) name;

/*!
  @method setName:
  @discussion Sets the name of a folder.
  @param theName The name of the folder.
*/
- (void) setName: (NSString *) theName;

/*!
  @method appendMessage:
  @discussion This method is used to add a message to
              a CWFolder instance. This method will NOT add
	      the message to the underlying store. You MUST
	      use -appendMessageFromRawSource: flags: if you
	      want the message to be saved to the underlying
	      store. Generally, you should not use this
	      method directly. If the folder was threaded,
	      this method will NOT thread the appended message.
  @param theMessage The message to append to the folder.
*/
- (void) appendMessage: (CWMessage *) theMessage;


/*!
  @method appendMessageFromRawSource:flags:
  @discussion This method is used to append a message
              from its raw source representation (RFC2822 compliant)
	      to the underlying store. This method will raise an
	      exception if it's invoked on an instance of CWFolder or
	      CWPOP3Folder instead of an instance of CWIMAPFolder and CWLocalFolder.
	      If the folder was threaded, this method will NOT thread the appended message.
	      Methods will be invoked on the delegate and notifications
	      will be posted. See the PantomimeFolderDelegate informal
	      protocol for more details.
  @param theData The raw representation of the message to append.
  @param theFlags The flags of the message, nil if no flags need to be kept.
*/
- (void) appendMessageFromRawSource: (NSData *) theData
                              flags: (CWFlags *) theFlags;

/*!
  @method allMessages
  @discussion This method is used to obtain all visible messages
              in the CWFolder instance. It hides messages marked
	      as Deleted if -setShowDeleted: was invoked with
	      NO as the parameter and the the same for messages
	      marked as read (see -setShowRead:). Note that the
	      messages MIGHT NOT been all completely initialized.
  @result An array of all visible messages.
*/
- (NSArray *) allMessages;

/*!
  @method setMessages:
  @discussion This method is used to replace all messages in the
               CWFolder instance by the ones specified in the array.
	       Normally, you shouldn't use this method directly.
  @param theMessages The array of messages.
*/
- (void) setMessages: (NSArray *) theMessages;

/*!
  @method messageAtIndex:
  @discussion This method is used to obtain the message at the
              specified index (which is zero-based). If the index
	      is out of bounds, nil is returned.
  @param theIndex The index of the message.
  @result The message at the specified index, nil otherwise.
*/
- (CWMessage *) messageAtIndex: (int) theIndex;

/*!
  @method count
  @discussion This method is used to obtain the number of messages
              present in the folder. Hidden messages will NOT
	      be part of the value returned. So, for example, if
	      a folder has 10 messages, 2 of them have the
	      PantomimeDeleted flag set and -setShowDeleted: NO was
	      invoked on the folder, this method will return
	      8 as the messages count.
  @result The number of messages in the folder.
*/
- (NSUInteger) count;

/*!
  @method close
  @discussion This method is used to close the folder. 
              The subclasses of CWFolder MUST this method.
*/
- (void) close;

/*!
  @method expunge:
  @discussion This method is used to permanently remove
              messages marked as deleted in the folder.
*/
- (void) expunge;

/*!
  @method store
  @discussion This method returns the associated store
              to this folder. This will generally be an instance
	      of CWIMAPStore, CWLocalStore or CWPOP3Store.
  @result The associated store.
*/
- (id) store;

/*!
  @method setStore:
  @discussion This method is used to set the associated store
              to this folder. The store will NOT be retained
	      since it is the store which holds and retains
              the CWFolder instances.
  @param theStore The associated store.
*/
- (void) setStore: (id) theStore;

/*!
  @method removeMessage:
  @discussion  This method removes permenantly a message from 
               the folder. It is used when transferring message 
	       between folders in order to update the view or 
	       when expunge deletes messages from a view. If the
	       folder is threaded, this method will rethread the
	       folder before returning.
  @param theMessage The CWMessage instance to remove from the folder.
*/
- (void) removeMessage: (CWMessage *) theMessage;

/*!
  @method showDeleted
  @discussion This method returns YES if messages marked as deleted
              are shown in this folder, NO otherwise.
  @result A BOOL corresponding to the value.
*/
- (BOOL) showDeleted;

/*!
  @method setShowDeleted:
  @discussion This method is used to specify if we want to show or
              hide messages marked as deleted in this folder.
  @param theBOOL YES if we want to hide messages marked as deleted,
                 NO otherwise.
*/
- (void) setShowDeleted: (BOOL) theBOOL;

/*!
  @method showRead
  @discussion This method returns YES if messages marked as read
              are shown in this folder, NO otherwise.
  @result A BOOL corresponding to the value.
*/
- (BOOL) showRead;

/*!
  @method setShowRead:
  @discussion This method is used to specify if we want to show or
              hide messages marked as read in this folder.
  @param theBOOL YES if we want to hide messages marked as read,
                 NO otherwise.
*/
- (void) setShowRead: (BOOL) theBOOL;

/*!
  @method numberOfDeletedMessages
  @discussion This method returns the number of messages in this
              folder that have the PantomimeDeleted flag set.
  @result The number of message marked has deleted, 0 if none.
*/
- (NSUInteger) numberOfDeletedMessages;

/*!
  @method numberOfUnreadMessages
  @discussion This method returns the number of messages in this
              folder that do not have the PantomimeSeen flag set.
  @result The number of unread messages, 0 if none.
*/
- (NSUInteger) numberOfUnreadMessages;

/*!
  @method size
  @discussion This method returns the size of the folder. That is,
               it returns the sum of the size of all visible messages in
	       the folder.
  @result The size of the folder.
*/
- (long) size;

/*!
  @method updateCache
  @discussion This method is used to update our cache (_allVisibleMessages).
              Applications can call this method if they set the PantomimeDeleted flags to
              messages inside this folder. If not called, the cache won't be updated
              the messages having the flag PantomimeDeleted will still be visible.
*/
- (void) updateCache;

/*!
  @method allContainers
  @discussion This method returns the list of root containers when using
              message threading.
  @result Root containers if using message threading, nil otherwise.
*/
- (NSArray *) allContainers;

/*!
  @method thread
  @discussion This method implements Jamie Zawinski's message threading algorithm.
              The full algorithm is available here: http://www.jwz.org/doc/threading.html
	      After calling this method, -allContainers can be called to obtain the
	      root set of CWContainer instances.
*/
- (void) thread;

/*!
  @method unthread
  @discussion This method is used to release all resources taken by the
              message threading code. After calling this method,
	      -allContainers will return nil.
*/
- (void) unthread;

/*!
  @method search: mask: options:
  @discussion This method is used to search this folder using a criteria,
              mask and options. This method will post a PantomimeFolderSearchCompleted
	      (or invoked -folderSearchCompleted: on the delegate) once it has
	      completed its execution (or post PantomimeFolderSearchFailed or invoke
	      -folderSearchFailed on the delegate if it failed). This method will
	      do absolutely nothing on CWPOP3Folder instances as search operations
	      are not supported in POP3.
  @param theString The string to search for. This can be a regex for LocalFolder instances.
  @param theMask The mask to use. The values can be either one of the
                 PantomimeSearchMask enum. This parameter is ignored for IMAPFolder instances.
  @param theOptions The search options. Can be either PantomimeRegularExpression
                    or PantomimeCaseInsensitiveSearch. This parameter is ignored for
		    CWIMAPFolder instances.
*/
- (void) search: (NSString *) theString
           mask: (PantomimeSearchMask) theMask
        options: (PantomimeSearchOption) theOptions;

/*!
  @method cacheManager
  @discussion This method returns the associated cache manager for this folder.
	      For a CWIMAPFolder, a CWIMAPCacheManager instance will be returned.
              For a CWLocalFolder, a CWLocalFolderCacheManager instance will be returned.
	      For a CWPOP3Folder, a CWPOP3CacheManager instance will be returned.
  @result The associated cache manager instance, nil otherwise.
*/
- (id) cacheManager;

/*!
  @method setCacheManager:
  @discussion This method is used to set the respective cache manager instance
              for this folder. Instance of CWIMAPCacheManager, CWLocalFolderCacheManager
	      or CWPOP3CacheManager will generally be used.
  @param theCacheManager The cache manager instance for this folder.
*/
- (void) setCacheManager: (id) theCacheManager;

/*!
  @method mode
  @discussion This method is used to get the mode of the folders. The returned
              values can be either PantomimeUnknownMode, PantomimeReadOnlyMode
	      or PantomimeReadWriteMode. Calling this method on an instance
	      of Folder (ie., not a subclass) will raise an exception.
  @result The mode of the folder.
*/
- (PantomimeFolderMode) mode;

/*!
  @method setMode:
  @discussion This method is used to adjust the mode on the specified folder.
              If has no impact on how the mailbox was open. For example,
	      if a mailbox was open as read-only, the mailbox will not
	      be re-opened as read-write after this method call.
  @param theMode The new mode.
*/
- (void) setMode: (PantomimeFolderMode) theMode;

/*!
  @method setFlags: messages:
  @discussion This method is used to set the same flags to a set of messages.
              This can be useful, especially when dealing with CWIMAPFolder
	      instances in order to NOT send many IMAP commands to the server
	      but rather send just one.
  @param theFlags The flags to set to all messages.
  @param theMessages The array of messages to which flags will be applied.
*/
- (void) setFlags: (CWFlags *) theFlags
         messages: (NSArray *) theMessages;

/*!
  @method propertyForKey:
  @discussion This method is used to get an extra property for the
              specified key.
  @result The property for the specified key, nil if key isn't found.
*/
- (id) propertyForKey: (id) theKey;

/*!
  @method setProperty: forKey:
  @discussion This method is used to set an extra property for the
              specified key on this folder. If nil is passed for
	      theProperty parameter, the value will actually be
	      REMOVED for theKey.
  @param theProperty The value of the property.
  @param theKey The key of the property.
*/
- (void) setProperty: (id) theProperty
              forKey: (id) theKey;
@end

#endif // _Pantomime_H_CWFolder