1 | /* |
---|
2 | * Adium is the legal property of its developers, whose names are listed in the copyright file included |
---|
3 | * with this source distribution. |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
---|
6 | * General Public License as published by the Free Software Foundation; either version 2 of the License, |
---|
7 | * or (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
---|
10 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
11 | * Public License for more details. |
---|
12 | * |
---|
13 | * You should have received a copy of the GNU General Public License along with this program; if not, |
---|
14 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
15 | */ |
---|
16 | |
---|
17 | #import <AIUtilities/AISendingTextView.h> |
---|
18 | #import <Adium/AIAdiumProtocol.h> |
---|
19 | #import <Adium/AIInterfaceControllerProtocol.h> |
---|
20 | #import <Adium/AIContactControllerProtocol.h> |
---|
21 | |
---|
22 | @class AIListContact, AIAccount, AIChat; |
---|
23 | |
---|
24 | @interface AISimpleTextView : NSView { |
---|
25 | NSAttributedString *string; |
---|
26 | } |
---|
27 | - (void)setString:(NSAttributedString *)inString; |
---|
28 | @end |
---|
29 | |
---|
30 | |
---|
31 | @interface AIMessageEntryTextView : AISendingTextView <AITextEntryView, AIListObjectObserver> { |
---|
32 | AIChat *chat; |
---|
33 | |
---|
34 | BOOL clearOnEscape; |
---|
35 | BOOL historyEnabled; |
---|
36 | BOOL pushPopEnabled; |
---|
37 | BOOL homeToStartOfLine; |
---|
38 | BOOL enableTypingNotifications; |
---|
39 | |
---|
40 | NSMutableArray *historyArray; |
---|
41 | int currentHistoryLocation; |
---|
42 | |
---|
43 | NSMutableArray *pushArray; |
---|
44 | BOOL pushIndicatorVisible; |
---|
45 | NSButton *pushIndicator; |
---|
46 | NSMenu *pushMenu; |
---|
47 | NSDictionary *defaultTypingAttributes; |
---|
48 | |
---|
49 | NSSize lastPostedSize; |
---|
50 | NSSize _desiredSizeCached; |
---|
51 | BOOL resizing; |
---|
52 | |
---|
53 | NSView *associatedView; |
---|
54 | |
---|
55 | AISimpleTextView *characterCounter; |
---|
56 | int maxCharacters; |
---|
57 | } |
---|
58 | |
---|
59 | //Configure |
---|
60 | - (void)setClearOnEscape:(BOOL)inBool; |
---|
61 | - (void)setHomeToStartOfLine:(BOOL)inBool; |
---|
62 | - (void)setAssociatedView:(NSView *)inView; |
---|
63 | - (NSView *)associatedView; |
---|
64 | |
---|
65 | //Adium Text Entry |
---|
66 | - (void)setAttributedString:(NSAttributedString *)inAttributedString; |
---|
67 | - (void)setString:(NSString *)string; |
---|
68 | - (void)setTypingAttributes:(NSDictionary *)attrs; |
---|
69 | - (void)pasteAsRichText:(id)sender; |
---|
70 | - (NSSize)desiredSize; |
---|
71 | |
---|
72 | //Context |
---|
73 | - (void)setChat:(AIChat *)inChat; |
---|
74 | - (AIChat *)chat; |
---|
75 | - (AIListContact *)listObject; |
---|
76 | |
---|
77 | //Paging |
---|
78 | - (void)scrollPageUp:(id)sender; |
---|
79 | - (void)scrollPageDown:(id)sender; |
---|
80 | |
---|
81 | //History |
---|
82 | - (void)setHistoryEnabled:(BOOL)inHistoryEnabled; |
---|
83 | - (void)historyUp; |
---|
84 | - (void)historyDown; |
---|
85 | |
---|
86 | //Push and Pop |
---|
87 | - (void)setPushPopEnabled:(BOOL)inBool; |
---|
88 | - (void)pushContent; |
---|
89 | - (void)popContent; |
---|
90 | - (void)swapContent; |
---|
91 | |
---|
92 | @end |
---|
93 | |
---|
94 | @interface NSObject (AIMessageEntryTextViewDelegate) |
---|
95 | /*! |
---|
96 | * @brief Should the tab key trigger an autocomplete? |
---|
97 | * |
---|
98 | * Implementation is optional. |
---|
99 | */ |
---|
100 | - (BOOL)textViewShouldTabComplete:(NSTextView *)inTextView; |
---|
101 | |
---|
102 | - (void)textViewDidCancel:(NSTextView *)inTextView; |
---|
103 | @end |
---|