| 1 |
14 |
jhriggs |
/*
|
| 2 |
|
|
* Copyright (c) 2009, Jim Riggs, Christian Serving, L.L.C.
|
| 3 |
|
|
* All rights reserved.
|
| 4 |
|
|
*
|
| 5 |
|
|
* Redistribution and use in source and binary forms, with or without
|
| 6 |
|
|
* modification, are permitted provided that the following conditions are
|
| 7 |
|
|
* met:
|
| 8 |
|
|
* * Redistributions of source code must retain the above copyright
|
| 9 |
|
|
* notice, this list of conditions and the following disclaimer.
|
| 10 |
|
|
* * Redistributions in binary form must reproduce the above
|
| 11 |
|
|
* copyright notice, this list of conditions and the following
|
| 12 |
|
|
* disclaimer in the documentation and/or other materials provided
|
| 13 |
|
|
* with the distribution.
|
| 14 |
|
|
* * Neither the name of Christian Serving, L.L.C. nor the names of
|
| 15 |
|
|
* its contributors may be used to endorse or promote products
|
| 16 |
|
|
* derived from this software without specific prior written
|
| 17 |
|
|
* permission.
|
| 18 |
|
|
*
|
| 19 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 20 |
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 21 |
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 22 |
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 23 |
|
|
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 24 |
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 25 |
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 26 |
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 27 |
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 28 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 29 |
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 30 |
|
|
*/
|
| 31 |
|
|
|
| 32 |
|
|
/*!
|
| 33 |
|
|
* @header
|
| 34 |
|
|
* Defines the <code>TruePreviewMessageViewer</code> category for
|
| 35 |
|
|
* <code>MessageViewer</code>.
|
| 36 |
|
|
* @copyright Copyright (c) 2009 Jim Riggs, Christian Serving, L.L.C. All rights reserved.
|
| 37 |
|
|
* @version \@(#) $Id: TruePreviewLibraryMessage.h 2 2009-06-27 07:02:45Z jhriggs $
|
| 38 |
|
|
* @updated $Date: 2009-06-27 02:02:45 -0500 (Sat, 27 Jun 2009) $
|
| 39 |
|
|
*/
|
| 40 |
|
|
|
| 41 |
|
|
#import "TruePreviewLibraryMessage.h"
|
| 42 |
|
|
|
| 43 |
|
|
/*!
|
| 44 |
|
|
* @class
|
| 45 |
|
|
* Adds a method for overriding the "mark as viewed" behavior of
|
| 46 |
|
|
* <code>MessageViewer</code>.
|
| 47 |
|
|
* @version \@(#) $Id: TruePreviewLibraryMessage.h 2 2009-06-27 07:02:45Z jhriggs $
|
| 48 |
|
|
* @updated $Date: 2009-06-27 02:02:45 -0500 (Sat, 27 Jun 2009) $
|
| 49 |
|
|
*/
|
| 50 |
|
|
@interface TruePreviewMessageViewer : NSObject {
|
| 51 |
|
|
}
|
| 52 |
|
|
|
| 53 |
|
|
#pragma mark Class methods
|
| 54 |
|
|
/*! @group Class methods */
|
| 55 |
|
|
|
| 56 |
|
|
/*!
|
| 57 |
|
|
* Returns the timers for instances of this class.
|
| 58 |
|
|
* @result
|
| 59 |
|
|
* The <code>NSMutableDictionary</code> containing the <code>NSTimer</code>
|
| 60 |
|
|
* for each instance of this class. The key is an <code>NSNumber</code>
|
| 61 |
|
|
* (unsigned long) of the address of each instance.
|
| 62 |
|
|
*/
|
| 63 |
|
|
+ (NSMutableDictionary*)truePreviewTimers;
|
| 64 |
|
|
|
| 65 |
|
|
#pragma mark Swizzled instance methods
|
| 66 |
|
|
/*! @group Swizzled instance methods */
|
| 67 |
|
|
|
| 68 |
|
|
/*!
|
| 69 |
|
|
* Invalidates this instance's timer and stops observing scroll changes before
|
| 70 |
|
|
* deallocating.
|
| 71 |
|
|
*/
|
| 72 |
|
|
- (void)truePreviewDealloc;
|
| 73 |
|
|
|
| 74 |
|
|
/*!
|
| 75 |
|
|
* Invalidates this instance's timer and stops observing scroll changes when a
|
| 76 |
|
|
* message is explicitly marked as read.
|
| 77 |
|
|
* @param inSender
|
| 78 |
|
|
* Unused.
|
| 79 |
|
|
*/
|
| 80 |
|
|
- (void)truePreviewMarkAsRead:(id)inSender;
|
| 81 |
|
|
|
| 82 |
|
|
/*!
|
| 83 |
|
|
* Invalidates this instance's timer and stops observing scroll changes when a
|
| 84 |
|
|
* message is explicitly marked as unread.
|
| 85 |
|
|
* @param inSender
|
| 86 |
|
|
* Unused.
|
| 87 |
|
|
*/
|
| 88 |
|
|
- (void)truePreviewMarkAsUnread:(id)inSender;
|
| 89 |
|
|
|
| 90 |
|
|
/*!
|
| 91 |
|
|
* Marks the displayed message as viewed, sets a timer to mark the displayed
|
| 92 |
|
|
* message as viewed, and/or adds a notification observer to mark the message as
|
| 93 |
|
|
* viewed when it is scrolled as appropriate.
|
| 94 |
|
|
* @param inNotification
|
| 95 |
|
|
* The <code>NSNotification</code> describing the event.
|
| 96 |
|
|
*/
|
| 97 |
|
|
- (void)truePreviewMessageWasDisplayedInTextView:(id)inNotification;
|
| 98 |
|
|
|
| 99 |
|
|
/*!
|
| 100 |
|
|
* Invalidates this instance's timer and stops observing scroll changes.
|
| 101 |
|
|
* @param inNotification
|
| 102 |
|
|
* The <code>NSNotification</code> describing the event.
|
| 103 |
|
|
*/
|
| 104 |
|
|
- (void)truePreviewMessageNoLongerDisplayedInTextView:(NSNotification*)inNotification;
|
| 105 |
|
|
|
| 106 |
|
|
#pragma mark Accessors
|
| 107 |
|
|
/*! @group Accessors */
|
| 108 |
|
|
|
| 109 |
|
|
/*!
|
| 110 |
|
|
* Returns the timer for this instance.
|
| 111 |
|
|
* @result
|
| 112 |
|
|
* The <code>NSTimer</code> for this instance.
|
| 113 |
|
|
*/
|
| 114 |
|
|
- (NSTimer*)truePreviewTimer;
|
| 115 |
|
|
|
| 116 |
|
|
/*!
|
| 117 |
|
|
* Sets the timer for this instance.
|
| 118 |
|
|
* @param inTimer
|
| 119 |
|
|
* The <code>NSTimer</code> for this instance.
|
| 120 |
|
|
*/
|
| 121 |
|
|
- (void)truePreviewSetTimer:(NSTimer*)inTimer;
|
| 122 |
|
|
|
| 123 |
|
|
#pragma mark Instance methods
|
| 124 |
|
|
/*! @group Instance methods */
|
| 125 |
|
|
|
| 126 |
|
|
/*!
|
| 127 |
|
|
* Invalidates this instance's timer and stops observing scroll changes.
|
| 128 |
|
|
*/
|
| 129 |
|
|
- (void)truePreviewReset;
|
| 130 |
|
|
|
| 131 |
|
|
/*!
|
| 132 |
|
|
* Marks the currently-displayed message as read.
|
| 133 |
|
|
* @param inTimer
|
| 134 |
|
|
* Unused.
|
| 135 |
|
|
*/
|
| 136 |
|
|
- (void)truePreviewTimerFired:(NSTimer*)inTimer;
|
| 137 |
|
|
|
| 138 |
|
|
/*!
|
| 139 |
|
|
* Marks the currently-displayed message as read.
|
| 140 |
|
|
* @param inNotification
|
| 141 |
|
|
* Unused.
|
| 142 |
|
|
*/
|
| 143 |
|
|
- (void)truePreviewBoundsDidChange:(NSNotification*)inNotification;
|
| 144 |
|
|
|
| 145 |
|
|
@end
|