Qt 4.8
qcocoawindowdelegate_mac_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 //
52 
53 #include "qmacdefines_mac.h"
54 
55 #ifdef QT_MAC_USE_COCOA
56 #import <Cocoa/Cocoa.h>
57 
59 template <class Key, class T> class QHash;
65 
66 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
67 @protocol NSWindowDelegate <NSObject>
68 - (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize;
69 - (void)windowDidMiniaturize:(NSNotification*)notification;
70 - (void)windowDidResize:(NSNotification *)notification;
71 - (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)defaultFrame;
72 - (void)windowDidMove:(NSNotification *)notification;
73 - (BOOL)windowShouldClose:(id)window;
74 - (void)windowDidDeminiaturize:(NSNotification *)notification;
75 - (void)windowDidBecomeMain:(NSNotification*)notification;
76 - (void)windowDidResignMain:(NSNotification*)notification;
77 - (void)windowDidBecomeKey:(NSNotification*)notification;
78 - (void)windowDidResignKey:(NSNotification*)notification;
79 - (void)windowDidChangeScreen:(NSNotification*)notification;
80 - (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu;
81 - (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard;
82 - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
83 @end
84 
85 @protocol NSDrawerDelegate <NSObject>
86 - (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:(NSSize)contentSize;
87 @end
88 
89 #endif
90 
91 
92 
93 @interface QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) : NSObject<NSWindowDelegate, NSDrawerDelegate> {
94  QHash<NSWindow *, QWidget *> *m_windowHash;
95  QHash<NSDrawer *, QWidget *> *m_drawerHash;
96 }
97 + (QT_MANGLE_NAMESPACE(QCocoaWindowDelegate)*)sharedDelegate;
98 - (void)becomeDelegateForWindow:(NSWindow *)window widget:(QWidget *)widget;
99 - (void)resignDelegateForWindow:(NSWindow *)window;
100 - (void)becomeDelegateForDrawer:(NSDrawer *)drawer widget:(QWidget *)widget;
101 - (void)resignDelegateForDrawer:(NSDrawer *)drawer;
102 - (void)dumpMaximizedStateforWidget:(QWidget*)qwidget window:(NSWindow *)window;
103 - (void)syncSizeForWidget:(QWidget *)qwidget
104  toSize:(const QSize &)newSize
105  fromSize:(const QSize &)oldSize;
106 - (NSSize)closestAcceptableSizeForWidget:(QWidget *)qwidget
107  window:(NSWindow *)window withNewSize:(NSSize)proposedSize;
108 - (QWidget *)qt_qwidgetForWindow:(NSWindow *)window;
109 - (void)syncContentViewFrame: (NSNotification *)notification;
110 @end
111 #endif
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
#define QT_FORWARD_DECLARE_CLASS(name)
Definition: qglobal.h:95
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
#define QT_PREPEND_NAMESPACE(name)
This macro qualifies identifier with the full namespace.
Definition: qglobal.h:87
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
struct CGPoint NSPoint
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53