Samond Classes Library 1.2.2-RELEASE build 188
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 - 2017 by Samond Development Corporation. All rights reserved.
7 //
8 
22 #import <scl/SCTextException.h>
23 #import <scl/SCSorter.h>
24 #import <scl/SCDelegate.h>
25 
26 #pragma mark -
27 #pragma mark Class Constants
28 
37 #define SCTextDelegateClass @"SCTextDelegate"
38 
39 
40 @class SCStrings;
41 @class SCText;
42 @class SCTextFile;
43 
44 #pragma mark -
45 #pragma mark Protocol SCTextDelegate Declaration
46 
60 @protocol SCTextDelegate
61 
62 #pragma mark -
63 #pragma mark Processing Strings
64 
79 - (void)processString:(NSString *)string text:(SCStrings *)text;
80 
81 #pragma mark -
82 #pragma mark Handling Text Errors
83 
100 - (BOOL)text:(SCStrings *)text didDetectException:(SCTextException *)exception;
101 
102 #pragma mark -
103 #pragma mark Adding Strings Events Handlers
104 
121 - (void)text:(SCStrings *)text willAddString:(NSString *)string;
122 
135 - (void)text:(SCStrings *)text willInsertString:(NSString *)string atIndex:(SCIndex)index;
136 
147 - (void)text:(SCStrings *)text didFinishAddingString:(NSString *)string;
148 
161 - (void)text:(SCStrings *)text didFinishInsertingString:(NSString *)string atIndex:(SCIndex)index;
162 
163 #pragma mark -
164 #pragma mark Removing Strings Events Handlers
165 
178 - (void)willRemoveAllStringsFromText:(SCStrings *)text;
179 
190 - (void)text:(SCStrings *)text willRemoveStringAtIndex:(SCIndex)index;
191 
202 - (void)text:(SCStrings *)text willRemoveString:(NSString *)string;
203 
214 - (void)text:(SCText *)text willRemoveTextInRange:(NSRange)range;
215 
226 - (void)text:(SCText *)text willRemoveSubstring:(NSString *)substring;
227 
238 - (void)text:(SCText *)text willRemoveText:(SCStrings *)removedText;
239 
248 - (void)didFinishRemovingAllStringsFromText:(SCStrings *)text;
249 
260 - (void)text:(SCStrings *)text didFinishRemovingStringAtIndex:(SCIndex)index;
261 
272 - (void)text:(SCStrings *)text didFinishRemovingString:(NSString *)string;
273 
284 - (void)text:(SCText *)text didFinishRemovingTextInRange:(NSRange)range;
285 
296 - (void)text:(SCText *)text didFinishRemovingSubstring:(NSString *)substring;
297 
308 - (void)text:(SCText *)text didFinishRemovingText:(SCStrings *)removedText;
309 
310 #pragma mark -
311 #pragma mark Strings Events Handlers
312 
329 - (void)text:(SCStrings *)text willSortAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
330 
343 - (void)text:(SCStrings *)text didFinishSortingAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
344 
345 #pragma mark -
346 #pragma mark Replacing Strings Events Handlers
347 
364 - (void)text:(SCStrings *)text willReplaceStringAtIndex:(SCIndex)index withString:(NSString *)string;
365 
378 - (void)text:(SCStrings *)text willReplaceString:(NSString *)string withString:(NSString *)newString;
379 
393 - (void)text:(SCText *)text willReplaceTextInRange:(NSRange)range withText:(SCStrings *)ntext;
394 
407 - (void)text:(SCText *)text willReplaceText:(SCStrings *)oldText withText:(SCStrings *)newText;
408 
421 - (void)text:(SCStrings *)text didFinishReplacingStringAtIndex:(SCIndex)index withString:(NSString *)string;
422 
435 - (void)text:(SCStrings *)text didFinishReplacingString:(NSString *)string withString:(NSString *)newString;
436 
450 - (void)text:(SCText *)text didFinishReplacingTextInRange:(NSRange)range withText:(SCStrings *)ntext;
451 
464 - (void)text:(SCText *)text didFinishReplacingText:(SCStrings *)oldText withText:(SCStrings *)newText;
465 
466 #pragma mark -
467 #pragma mark Copying and Moving Strings Events Handlers
468 
485 - (void)text:(SCStrings *)text willExchangeStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
486 
497 - (void)text:(SCStrings *)text willDuplicateStringAtIndex:(SCIndex)index;
498 
507 - (void)willDuplicateText:(SCStrings *)text;
508 
522 - (void)text:(SCText *)text willExchangeTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
523 
536 - (void)text:(SCStrings *)text didFinishExchangingStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
537 
548 - (void)text:(SCStrings *)text didFinishDuplicatingStringAtIndex:(SCIndex)index;
549 
558 - (void)didFinishDuplicatingText:(SCStrings *)text;
559 
573 - (void)text:(SCText *)text didFinishExchangingTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
574 
575 #pragma mark -
576 #pragma mark Reading and Writing Files Events Handlers
577 
592 - (void)text:(SCTextFile *)text willReadFromStream:(SCStream *)stream;
593 
604 - (void)text:(SCTextFile *)text willReadWithPath:(NSString *)path;
605 
616 - (void)text:(SCTextFile *)text willWriteToStream:(SCStream *)stream;
617 
628 - (void)text:(SCTextFile *)text willWriteWithPath:(NSString *)path;
629 
638 - (void)willResetText:(SCTextFile *)text;
639 
650 - (void)text:(SCTextFile *)text didFinishReadingFromStream:(SCStream *)stream;
651 
662 - (void)text:(SCTextFile *)text didFinishReadingWithPath:(NSString *)path;
663 
674 - (void)text:(SCTextFile *)text didFinishWritingToStream:(SCStream *)stream;
675 
686 - (void)text:(SCTextFile *)text didFinishWritingWithPath:(NSString *)path;
687 
696 - (void)didFinishResettingText:(SCTextFile *)text;
697 
698 @end
699 
700 #pragma mark -
701 #pragma mark Class SCTextDelegate Declaration
702 
716 
717 #pragma mark -
718 #pragma mark Processing Strings
719 - (void)processString:(NSString *)string text:(SCStrings *)text;
720 
721 #pragma mark -
722 #pragma mark Handling Text Errors
723 - (BOOL)text:(SCStrings *)text didDetectException:(SCTextException *)exception;
724 
725 #pragma mark -
726 #pragma mark Adding Strings Events Handlers
727 - (void)text:(SCStrings *)text willAddString:(NSString *)string;
728 - (void)text:(SCStrings *)text willInsertString:(NSString *)string atIndex:(SCIndex)index;
729 - (void)text:(SCStrings *)text didFinishAddingString:(NSString *)string;
730 - (void)text:(SCStrings *)text didFinishInsertingString:(NSString *)string atIndex:(SCIndex)index;
731 
732 #pragma mark -
733 #pragma mark Removing Strings Events Handlers
734 - (void)willRemoveAllStringsFromText:(SCStrings *)text;
735 - (void)text:(SCStrings *)text willRemoveStringAtIndex:(SCIndex)index;
736 - (void)text:(SCStrings *)text willRemoveString:(NSString *)string;
737 - (void)text:(SCText *)text willRemoveTextInRange:(NSRange)range;
738 - (void)text:(SCText *)text willRemoveSubstring:(NSString *)substring;
739 - (void)text:(SCText *)text willRemoveText:(SCStrings *)removedText;
740 - (void)didFinishRemovingAllStringsFromText:(SCStrings *)text;
741 - (void)text:(SCStrings *)text didFinishRemovingStringAtIndex:(SCIndex)index;
742 - (void)text:(SCStrings *)text didFinishRemovingString:(NSString *)string;
743 - (void)text:(SCText *)text didFinishRemovingTextInRange:(NSRange)range;
744 - (void)text:(SCText *)text didFinishRemovingSubstring:(NSString *)substring;
745 - (void)text:(SCText *)text didFinishRemovingText:(SCStrings *)removedText;
746 
747 #pragma mark -
748 #pragma mark Sorting Strings Events Handlers
749 - (void)text:(SCStrings *)text willSortAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
750 - (void)text:(SCStrings *)text didFinishSortingAscending:(BOOL)ascending sorter:(id<SCSorter>)sorter;
751 
752 #pragma mark -
753 #pragma mark Replacing Strings Events Handlers
754 - (void)text:(SCStrings *)text willReplaceStringAtIndex:(SCIndex)index withString:(NSString *)string;
755 - (void)text:(SCStrings *)text willReplaceString:(NSString *)string withString:(NSString *)newString;
756 - (void)text:(SCText *)text willReplaceTextInRange:(NSRange)range withText:(SCStrings *)ntext;
757 - (void)text:(SCText *)text willReplaceText:(SCStrings *)oldText withText:(SCStrings *)newText;
758 - (void)text:(SCStrings *)text didFinishReplacingStringAtIndex:(SCIndex)index withString:(NSString *)string;
759 - (void)text:(SCStrings *)text didFinishReplacingString:(NSString *)string withString:(NSString *)newString;
760 - (void)text:(SCText *)text didFinishReplacingTextInRange:(NSRange)range withText:(SCStrings *)ntext;
761 - (void)text:(SCText *)text didFinishReplacingText:(SCStrings *)oldText withText:(SCStrings *)newText;
762 
763 #pragma mark -
764 #pragma mark Copying and Moving Strings Events Handlers
765 - (void)text:(SCStrings *)text willExchangeStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
766 - (void)text:(SCStrings *)text willDuplicateStringAtIndex:(SCIndex)index;
767 - (void)willDuplicateText:(SCStrings *)text;
768 - (void)text:(SCText *)text willExchangeTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
769 - (void)text:(SCStrings *)text didFinishExchangingStringAtIndex:(SCIndex)index withStringAtIndex:(SCIndex)destination;
770 - (void)text:(SCStrings *)text didFinishDuplicatingStringAtIndex:(SCIndex)index;
771 - (void)didFinishDuplicatingText:(SCStrings *)text;
772 - (void)text:(SCText *)text didFinishExchangingTextInRange:(NSRange)source withTextInRange:(NSRange)destination;
773 
774 #pragma mark -
775 #pragma mark Reading and Writing Files Events Handlers
776 - (void)text:(SCTextFile *)text willReadFromStream:(SCStream *)stream;
777 - (void)text:(SCTextFile *)text willReadWithPath:(NSString *)path;
778 - (void)text:(SCTextFile *)text willWriteToStream:(SCStream *)stream;
779 - (void)text:(SCTextFile *)text willWriteWithPath:(NSString *)path;
780 - (void)willResetText:(SCTextFile *)text;
781 - (void)text:(SCTextFile *)text didFinishReadingFromStream:(SCStream *)stream;
782 - (void)text:(SCTextFile *)text didFinishReadingWithPath:(NSString *)path;
783 - (void)text:(SCTextFile *)text didFinishWritingToStream:(SCStream *)stream;
784 - (void)text:(SCTextFile *)text didFinishWritingWithPath:(NSString *)path;
785 - (void)didFinishResettingText:(SCTextFile *)text;
786 
787 @end
Text class.
Definition: SCText.h:76
Strings list class.
Definition: SCStrings.h:73
Class SCDelegate header file.
Class SCTextException header file.
Abstract implementation of the protocol SCSorter.
Definition: SCSorter.h:136
Protocol and class SCSorter header file.
Text object event handlers class.
Definition: SCTextDelegate.h:715
Parent class of all library delegate classes.
Definition: SCDelegate.h:53
Text file class.
Definition: SCTextFile.h:87
Text objects delegate protocol.
Definition: SCTextDelegate.h:60
Exception class SCTextException.
Definition: SCTextException.h:335
NSUInteger SCIndex
Definition: SCCollectionProtocols.h:50
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:226