Prevent sending 0-byte files. Fixes #8711.
[adiumx.git] / Source / AIListWindowController.h
blobdd852bdc95c4894e5165335234cf5c05c475819c
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.
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.
18 * NOTE TO FUTURE MERGE
19 * Something was happening when the two commented out imports were left in place.
20 * I took it out and added the @protocol line below and everything worked fine. This
21 * will surely be a problem in the future merger though.
24 #import "AIListController.h"
25 #import <Adium/AIWindowController.h>
26 #import <AIUtilities/AIFunctions.h>
27 #import <Adium/AIInterfaceControllerProtocol.h>
29 typedef enum {
30 AIContactListWindowHidingStyleNone = 0,
31 AIContactListWindowHidingStyleBackground,
32 AIContactListWindowHidingStyleSliding
33 } AIContactListWindowHidingStyle;
35 #define KEY_CL_WINDOW_HIDING_STYLE @"Window Hiding Style"
36 #define KEY_CL_SLIDE_ONLY_IN_BACKGROUND @"Hide By Sliding Only in Background"
38 #define PREF_GROUP_CONTACT_LIST_DISPLAY @"Contact List Display"
39 #define KEY_DUAL_RESIZE_VERTICAL @"Autoresize Vertical"
40 #define KEY_DUAL_RESIZE_HORIZONTAL @"Autoresize Horizontal"
42 #define KEY_CL_ALL_SPACES @"Show Contact List On All Spaces"
44 @protocol AIContactListViewController, AIInterfaceContainer;
46 @interface AIListWindowController : AIWindowController <AIInterfaceContainer, AIListControllerDelegate> {
47 BOOL borderless;
49 NSSize minWindowSize;
50 IBOutlet AIAutoScrollView *scrollView_contactList;
51 IBOutlet AIListOutlineView *contactListView;
52 AIListController *contactListController;
53 AIListObject<AIContainingObject> *contactListRoot;
55 AIContactListWindowHidingStyle windowHidingStyle;
56 BOOL slideOnlyInBackground;
57 // refers to the GUI preference. Sometimes this is expressed as dock-like
58 // sliding instead, sometimes as orderOut:-type hiding.
59 BOOL windowShouldBeVisibleInBackground;
61 // used by the "show contact list" event behavior to prevent the contact list
62 // from hiding during the amount of time it is to be shown
63 BOOL preventHiding;
64 BOOL overrodeWindowLevel;
65 int previousWindowLevel;
67 //this needs to be stored because we turn the shadow off when the window slides offscreen
68 BOOL listHasShadow;
70 BOOL permitSlidingInForeground;
71 AIRectEdgeMask windowSlidOffScreenEdgeMask;
72 NSScreen *windowLastScreen;
73 NSTimer *slideWindowIfNeededTimer;
75 NSRect oldFrame;
76 NSScreen *currentScreen;
77 NSRect currentScreenFrame;
79 NSViewAnimation *windowAnimation;
80 float previousAlpha;
82 AIListWindowController *attachToBottom;
85 // Create additional windows
86 + (AIListWindowController *)listWindowControllerForContactList:(AIListObject<AIContainingObject> *)contactList;
87 + (AIListWindowController *)listWindowController;
89 - (AIListController *)listController;
90 - (AIListOutlineView *)contactListView;
91 - (AIListObject<AIContainingObject> *) contactList;
92 - (void)setContactList:(AIListObject<AIContainingObject> *)contactList;
93 - (void)close:(id)sender;
95 // Dock-like hiding
96 - (void)slideWindowOnScreenWithAnimation:(BOOL)flag;
97 - (BOOL)shouldSlideWindowOnScreen;
98 - (BOOL)shouldSlideWindowOffScreen;
100 - (AIRectEdgeMask)slidableEdgesAdjacentToWindow;
101 - (void)slideWindowOffScreenEdges:(AIRectEdgeMask)rectEdgeMask;
102 - (void)slideWindowOnScreen;
103 - (void)setPreventHiding:(BOOL)newPreventHiding;
104 - (BOOL)windowShouldHideOnDeactivate;
105 - (AIRectEdgeMask)windowSlidOffScreenEdgeMask;
106 - (void)moveWindowToPoint:(NSPoint)inOrigin;
108 // Window snapping
109 - (void)snapToOtherWindows;
110 - (NSPoint)snapTo:(NSWindow *)neighborWindow with:(NSRect)window saveTo:(NSPoint)location;
111 - (NSPoint)windowSpacing;
114 void manualWindowMoveToPoint(NSWindow *inWindow,
115 NSPoint targetPoint,
116 AIRectEdgeMask windowSlidOffScreenEdgeMask,
117 BOOL keepOnScreen);
119 @end