Samond Classes Library 1.2.6-STABLE build 219
SCTextDelegate.h
Go to the documentation of this file.
1 //
2 // SCTextDelegate.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 05.02.13.
6 // Copyright (c) 2007 - 2018 by Samond Development Corporation. All rights reserved.
7 //
8 
22 #import <Foundation/Foundation.h>
23 #import <scl/SCDelegate.h>
24 #import <scl/SCSorter.h>
25 #import <scl/SCTextException.h>
26 
27 #pragma mark -
28 #pragma mark Class Constants
29 
38 #define SCTextDelegateClass @"SCTextDelegate"
39 
40 
41 @class SCStrings;
42 @class SCText;
43 @class SCTextFile;
44 
45 #pragma mark -
46 #pragma mark Protocol SCTextDelegate Declaration
47 
61 @protocol SCTextDelegate
62 
63 #pragma mark -
64 #pragma mark Processing Strings
65 
80 - (void)processString:(NSString *)string text:(SCStrings *)text;
81 
82 #pragma mark -
83 #pragma mark Handling Text Errors
84 
101 - (BOOL)text:(SCStrings *)text didDetectException:(SCTextException *)exception;
102 
103 #pragma mark -
104 #pragma mark Adding Strings Events Handlers
105 
122 - (void)text:(SCStrings *)text willAddString:(NSString *)string;
123 
136 - (void)text:(SCStrings *)text willInsertString:(NSString *)string atIndex:(SCIndex)index;
137 
148 - (void)text:(SCStrings *)text didFinishAddingString:(NSString *)string;
149 
162 - (void)text:(SCStrings *)text didFinishInsertingString:(NSString *)string atIndex:(SCIndex)index;
163 
164 #pragma mark -
165 #pragma mark Removing Strings Events Handlers
166 
179 - (void)willRemoveAllStringsFromText:(SCStrings *)text;
180 
191 - (void)text:(SCStrings *)text willRemoveStringAtIndex:(SCIndex)index;
192 
203 - (void)text:(SCStrings *)text willRemoveString:(NSString *)string;
204 
215 - (void)text:(SCText *)text willRemoveTextInRange:(NSRange)range;
216 
227 - (void)text:(SCText *)text willRemoveSubstring:(NSString *)substring;
228 
239 - (void)text:(SCText *)text willRemoveText:(SCStrings *)removedText;
240 
249 - (void)didFinishRemovingAllStringsFromText:(SCStrings *)text;
250 
261 - (void)text:(SCStrings *)text didFinishRemovingStringAtIndex:(SCIndex)index;
262 
273 - (void)text:(SCStrings *)text didFinishRemovingString:(NSString *)string;
274 
285 - (void)text:(SCText *)text didFinishRemovingTextInRange:(NSRange)range;
286 
297 - (void)text:(SCText *)text didFinishRemovingSubstring:(NSString *)substring;
298 
309 - (void)text:(SCText *)text didFinishRemovingText:(SCStrings *)removedText;
310 
311 #pragma mark -
312 #pragma mark Strings Events Handlers
313 
330 - (void)text:(SCStrings *)text willSortAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
331 
344 - (void)text:(SCStrings *)text didFinishSortingAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
345 
346 #pragma mark -
347 #pragma mark Replacing Strings Events Handlers
348 
365 - (void)text:(SCStrings *)text willReplaceStringAtIndex:(SCIndex)index withString:(NSString *)string;
366 
379 - (void)text:(SCStrings *)text willReplaceString:(NSString *)string withString:(NSString *)newString;
380 
394 - (void)text:(SCText *)text willReplaceTextInRange:(NSRange)range withText:(SCStrings *)ntext;
395 
408 - (void)text:(SCText *)text willReplaceText:(SCStrings *)oldText withText:(SCStrings *)newText;
409 
422 - (void)text:(SCStrings *)text didFinishReplacingStringAtIndex:(SCIndex)index withString:(NSString *)string;
423 
436 - (void)text:(SCStrings *)text didFinishReplacingString:(NSString *)string withString:(NSString *)newString;
437 
451 - (void)text:(SCText *)text didFinishReplacingTextInRange:(NSRange)range withText:(SCStrings *)ntext;
452 
465 - (void)text:(SCText *)text didFinishReplacingText:(SCStrings *)oldText withText:(SCStrings *)newText;
466 
467 #pragma mark -
468 #pragma mark Copying and Moving Strings Events Handlers
469 
486 - (void)text:(SCStrings *)text willExchangeStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
487 
498 - (void)text:(SCStrings *)text willDuplicateStringAtIndex:(SCIndex)index;
499 
508 - (void)willDuplicateText:(SCStrings *)text;
509 
523 - (void)text:(SCText *)text willExchangeTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
524 
537 - (void)text:(SCStrings *)text didFinishExchangingStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
538 
549 - (void)text:(SCStrings *)text didFinishDuplicatingStringAtIndex:(SCIndex)index;
550 
559 - (void)didFinishDuplicatingText:(SCStrings *)text;
560 
574 - (void)text:(SCText *)text didFinishExchangingTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
575 
576 #pragma mark -
577 #pragma mark Reading and Writing Files Events Handlers
578 
593 - (void)text:(SCTextFile *)text willReadFromStream:(SCStream *)stream;
594 
605 - (void)text:(SCTextFile *)text willReadWithPath:(NSString *)path;
606 
617 - (void)text:(SCTextFile *)text willWriteToStream:(SCStream *)stream;
618 
629 - (void)text:(SCTextFile *)text willWriteWithPath:(NSString *)path;
630 
639 - (void)willResetText:(SCTextFile *)text;
640 
651 - (void)text:(SCTextFile *)text didFinishReadingFromStream:(SCStream *)stream;
652 
663 - (void)text:(SCTextFile *)text didFinishReadingWithPath:(NSString *)path;
664 
675 - (void)text:(SCTextFile *)text didFinishWritingToStream:(SCStream *)stream;
676 
687 - (void)text:(SCTextFile *)text didFinishWritingWithPath:(NSString *)path;
688 
697 - (void)didFinishResettingText:(SCTextFile *)text;
698 
699 @end
700 
701 #pragma mark -
702 #pragma mark Class SCTextDelegate Declaration
703 
717 
718 #pragma mark -
719 #pragma mark Processing Strings
720 - (void)processString:(NSString *)string text:(SCStrings *)text;
721 
722 #pragma mark -
723 #pragma mark Handling Text Errors
724 - (BOOL)text:(SCStrings *)text didDetectException:(SCTextException *)exception;
725 
726 #pragma mark -
727 #pragma mark Adding Strings Events Handlers
728 - (void)text:(SCStrings *)text willAddString:(NSString *)string;
729 - (void)text:(SCStrings *)text willInsertString:(NSString *)string atIndex:(SCIndex)index;
730 - (void)text:(SCStrings *)text didFinishAddingString:(NSString *)string;
731 - (void)text:(SCStrings *)text didFinishInsertingString:(NSString *)string atIndex:(SCIndex)index;
732 
733 #pragma mark -
734 #pragma mark Removing Strings Events Handlers
735 - (void)willRemoveAllStringsFromText:(SCStrings *)text;
736 - (void)text:(SCStrings *)text willRemoveStringAtIndex:(SCIndex)index;
737 - (void)text:(SCStrings *)text willRemoveString:(NSString *)string;
738 - (void)text:(SCText *)text willRemoveTextInRange:(NSRange)range;
739 - (void)text:(SCText *)text willRemoveSubstring:(NSString *)substring;
740 - (void)text:(SCText *)text willRemoveText:(SCStrings *)removedText;
741 - (void)didFinishRemovingAllStringsFromText:(SCStrings *)text;
742 - (void)text:(SCStrings *)text didFinishRemovingStringAtIndex:(SCIndex)index;
743 - (void)text:(SCStrings *)text didFinishRemovingString:(NSString *)string;
744 - (void)text:(SCText *)text didFinishRemovingTextInRange:(NSRange)range;
745 - (void)text:(SCText *)text didFinishRemovingSubstring:(NSString *)substring;
746 - (void)text:(SCText *)text didFinishRemovingText:(SCStrings *)removedText;
747 
748 #pragma mark -
749 #pragma mark Sorting Strings Events Handlers
750 - (void)text:(SCStrings *)text willSortAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
751 - (void)text:(SCStrings *)text didFinishSortingAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
752 
753 #pragma mark -
754 #pragma mark Replacing Strings Events Handlers
755 - (void)text:(SCStrings *)text willReplaceStringAtIndex:(SCIndex)index withString:(NSString *)string;
756 - (void)text:(SCStrings *)text willReplaceString:(NSString *)string withString:(NSString *)newString;
757 - (void)text:(SCText *)text willReplaceTextInRange:(NSRange)range withText:(SCStrings *)ntext;
758 - (void)text:(SCText *)text willReplaceText:(SCStrings *)oldText withText:(SCStrings *)newText;
759 - (void)text:(SCStrings *)text didFinishReplacingStringAtIndex:(SCIndex)index withString:(NSString *)string;
760 - (void)text:(SCStrings *)text didFinishReplacingString:(NSString *)string withString:(NSString *)newString;
761 - (void)text:(SCText *)text didFinishReplacingTextInRange:(NSRange)range withText:(SCStrings *)ntext;
762 - (void)text:(SCText *)text didFinishReplacingText:(SCStrings *)oldText withText:(SCStrings *)newText;
763 
764 #pragma mark -
765 #pragma mark Copying and Moving Strings Events Handlers
766 - (void)text:(SCStrings *)text willExchangeStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
767 - (void)text:(SCStrings *)text willDuplicateStringAtIndex:(SCIndex)index;
768 - (void)willDuplicateText:(SCStrings *)text;
769 - (void)text:(SCText *)text willExchangeTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
770 - (void)text:(SCStrings *)text didFinishExchangingStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
771 - (void)text:(SCStrings *)text didFinishDuplicatingStringAtIndex:(SCIndex)index;
772 - (void)didFinishDuplicatingText:(SCStrings *)text;
773 - (void)text:(SCText *)text didFinishExchangingTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
774 
775 #pragma mark -
776 #pragma mark Reading and Writing Files Events Handlers
777 - (void)text:(SCTextFile *)text willReadFromStream:(SCStream *)stream;
778 - (void)text:(SCTextFile *)text willReadWithPath:(NSString *)path;
779 - (void)text:(SCTextFile *)text willWriteToStream:(SCStream *)stream;
780 - (void)text:(SCTextFile *)text willWriteWithPath:(NSString *)path;
781 - (void)willResetText:(SCTextFile *)text;
782 - (void)text:(SCTextFile *)text didFinishReadingFromStream:(SCStream *)stream;
783 - (void)text:(SCTextFile *)text didFinishReadingWithPath:(NSString *)path;
784 - (void)text:(SCTextFile *)text didFinishWritingToStream:(SCStream *)stream;
785 - (void)text:(SCTextFile *)text didFinishWritingWithPath:(NSString *)path;
786 - (void)didFinishResettingText:(SCTextFile *)text;
787 
788 @end
Text class.
Definition: SCText.h:77
Strings list class.
Definition: SCStrings.h:74
Class SCDelegate header file.
Class SCTextException header file.
Abstract implementation of the protocol SCSorter.
Definition: SCSorter.h:138
Protocol and class SCSorter header file.
Text object event handlers class.
Definition: SCTextDelegate.h:716
Parent class of all library delegate classes.
Definition: SCDelegate.h:54
Text file class.
Definition: SCTextFile.h:88
Text objects delegate protocol.
Definition: SCTextDelegate.h:61
Exception class SCTextException.
Definition: SCTextException.h:336
NSUInteger SCIndex
Definition: SCCollectionProtocols.h:53
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:224