Subversion Repositories TruePreview

[/] [trunk/] [Source/] [TruePreview.h] - Blame information for rev 42

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1 jhriggs
/*
2 42 jhriggs
 * Copyright (c) 2009-2011, Jim Riggs, Christian Serving, L.L.C.
3 1 jhriggs
 * 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>TruePreview</code> Mail bundler (the entrypoint for the
35
 * plugin) and the <code>TruePreviewObject</code> category for
36
 * <code>NSObject</code>.
37 42 jhriggs
 * @copyright Copyright (c) 2009-2011 Jim Riggs, Christian Serving, L.L.C. All rights reserved.
38 1 jhriggs
 * @version \@(#) $Id: TruePreview.h 42 2011-03-22 12:57:21Z jhriggs $
39
 * @updated $Date: 2011-03-22 07:57:21 -0500 (Tue, 22 Mar 2011) $
40
 */
41
 
42
#import <objc/objc-class.h>
43
 
44 17 jhriggs
#import "TruePreviewLibraryMessage.h"
45
#import "TruePreviewMessageViewer.h"
46
#import "TruePreviewPreferences.h"
47 1 jhriggs
#import "TruePreviewPreferencesModule.h"
48 17 jhriggs
#import "TruePreviewPreferenceValueTransformer.h"
49 1 jhriggs
 
50
/*!
51
 * @class
52
 * The <code>TruePreview</code> class is the subclass of
53 17 jhriggs
 * <code>MVMailBundle</code> that provides the plugin entrypoint for the
54 1 jhriggs
 * TruePreview plugin.
55
 * @version \@(#) $Id: TruePreview.h 42 2011-03-22 12:57:21Z jhriggs $
56
 * @updated $Date: 2011-03-22 07:57:21 -0500 (Tue, 22 Mar 2011) $
57
 */
58 17 jhriggs
@interface TruePreview : NSObject {
59 1 jhriggs
}
60
 
61
#pragma mark Class initialization
62
/*! @group Class initialization */
63
 
64
/*!
65
 * Registers this plugin and swizzles the methods necessary for TruePreview's
66
 * functionality.
67
 */
68
+ (void)initialize;
69
 
70
#pragma mark MVMailBundle class methods
71
/*! @group MVMailBundle class methods */
72
 
73
/*!
74
 * Indicates that this plugin has a preference panel.
75
 * @result
76
 *   <code>YES</code>.
77
 */
78
+ (BOOL)hasPreferencesPanel;
79
 
80
/*!
81
 * Returns the class name for this plugin's preference panel owner.
82
 * @result
83
 *   <code>TruePreviewPreferencesModule</code>.
84
 */
85
+ (NSString*)preferencesOwnerClassName;
86
 
87
/*!
88
 * Returns the name for this plugin's preferences panel.
89
 * @result
90
 *   <code>TruePreview</code>.
91
 */
92
+ (NSString*)preferencesPanelName;
93
 
94
@end
95
 
96
/*!
97
 * @category
98
 * Adds a method for method swizzling to <code>NSObject</code> instances.
99
 * @version \@(#) $Id: TruePreview.h 42 2011-03-22 12:57:21Z jhriggs $
100
 * @updated $Date: 2011-03-22 07:57:21 -0500 (Tue, 22 Mar 2011) $
101
 */
102
@interface NSObject (TruePreviewObject)
103
 
104
#pragma mark Class methods
105
/*! @group Class methods */
106
 
107
/*!
108 17 jhriggs
 * Adds the methods from this class to the specified class.  This is in essence
109
 * adding a category, but we do it through the objective-c runtime, because of
110
 * the "hiding" of classes in >= 10.6.
111
 * @param inClass
112
 *   The <code>Class</code> to which this class's methods should be added.
113
 */
114
+ (void)truePreviewAddAsCategoryToClass:(Class)inClass;
115
 
116
/*!
117 1 jhriggs
 * Swaps ("swizzles") two methods.  Based on
118
 * <a href="http://www.cocoadev.com/index.pl?MethodSwizzling">http://www.cocoadev.com/index.pl?MethodSwizzling</a>.
119
 * @param inOriginalSelector
120
 *   The selector specifying the method being replaced.
121
 * @param inReplacementSelector
122
 *   The selector specifying the replacement method.
123
 * @param inIsClassMethod
124
 *   The <code>BOOL</code> indicating whether or not the methods being swizzled
125
 *   are class methods.
126
 */
127
+ (void)truePreviewSwizzleMethod:(SEL)inOriginalSelector withMethod:(SEL)inReplacementSelector isClassMethod:(BOOL)inIsClassMethod;
128
 
129
@end