InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IWindow.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Robin_Briggs
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IWINDOW__
25 #define __IWINDOW__
26 
27 #include "IPMUnknown.h"
28 #include "ShuksanID.h"
29 
30 #include "PMReal.h"
31 #include "PMRect.h"
32 #include "WindowVisibleState.h"
33 
34 class ICursorMgr;
35 class PMString;
36 class IEvent;
37 class IViewPort;
38 class InterfaceFontInfo;
39 
40 // window property constants to get the data we want on the mac.
41 const uint32 kIWindowPtrProp = 'IWin'; // data is the IWindow*
42 
45 class INTERFACE_DECL IWindow : public IPMUnknown
46 {
47 public:
48  enum { kDefaultIID = IID_IWINDOW };
49 
51  enum VisibleState { kHide = SW_HIDE, kMaximize = SW_MAXIMIZE, kMinimize = SW_MINIMIZE,
52  kRestore = SW_RESTORE, kShow = SW_SHOW, kShowNormal = SW_SHOWNORMAL,
53  kShowNoActivate = SW_SHOWNA };
54 
62  enum WindowSpec{
63  /* The lowest 4 bits are for Window layer property. Each window must have exactly one window layer specified. This determines which windows float above
64  which others. This property must be set. The following layer constants are sequenced in front to back order so that layers with a higher enum value overlap those with a lower enum value.
65  Note there are some holes for possible additional window layers in the future. The window layer for a window will determine the default window frame, controls, and other policies for the window
66  kWindowLayerMask is the mask to use to get the window layer bits out of the window spec bitfield.
67  */
68  kWindowLayerMask = (0x0000000FUL),
69 
71  kAppRootWindowLayer = 1,
73  kDocumentWindowLayer = 2,
75  kToolbarWindowLayer = 4,
77  kPaletteWindowLayer = 5,
79  kAppModalWindowLayer = 7,
82  kUtilityWindowLayer = 11,
84  kMenuWindowLayer = 13,
86  kHelpWindowLayer = 14,
87 
88 
91  kWindowFrameMask = (0x000000F0UL),
93  kStandardWindowFrame = 0,
95  kDocWindowFrame = (1UL << 4),
97  kPaletteWindowFrame = (2UL << 4),
99  kModelessDialogWindowFrame = (3UL << 4),
101  kMovableModalDialogWindowFrame = (4UL << 4),
103  kModalDialogWindowFrame = (5UL << 4),
105  kMovableAlertWindowFrame = (6UL << 4),
107  kAlertWindowFrame = (7UL << 4),
109  kAppRootWindowFrame = (8UL << 4),
111  kBorderOnlyWindowFrame = (9UL << 4),
113  kCustomWindowFrame = (14UL << 4),
115  kNoWindowFrame = (15UL << 4),
116 
119  kWindowControlsMask = (0x0000FF00),
127  kStandardWindowControls = 0,
129  kCloseWindowControl = (1UL << 8),
131  kZoomWindowControl = (1UL << 9),
133  kCollapseWindowControl = (1UL << 10),
135  kResizeWindowControl = (1UL << 11),
137  kToolbarWindowControl = (1UL << 12),
139  kSideTitlebarControl = (1UL << 13),
141  kRemoveTitlebarControl = (1UL << 14),
143  kListAbsentWindowControls = (1UL << 15),
145  kNoWindowControls = kWindowControlsMask,
147  kAllWindowControls = kListAbsentWindowControls,
149  kStandardDocWindowControls = (kCloseWindowControl | kZoomWindowControl | kCollapseWindowControl | kResizeWindowControl),
151  kStandardPaletteWindowControls = (kCloseWindowControl | kZoomWindowControl),
152 
156  kWindowPolicyMask = (0xFFFF0000UL),
158  kStandardWindowPolicy = 0,
159 
161  kHideInBackgroundWindowPolicy = (1UL << 16),
163  kDontHideInBackgroundWindowPolicy = (1UL << 17),
164 
166  kTabCyclesKeyFocusWindowPolicy = (1UL << 18),
168  kTabDoesntCycleKeyFocusWindowPolicy = (1UL << 19),
169 
171  kRememberLastEditboxKeyFocusWindowPolicy = (1UL << 20),
173  kDontRememberLastEditboxKeyFocusWindowPolicy = (1UL << 21),
174 
176  kHasDefaultButtonWindowPolicy = (1UL << 22),
178  kDoesntHaveDefaultButtonWindowPolicy = (1UL << 23),
179 
181  kMovableWindowPolicy = (1UL << 24),
183  kNonMovableWindowPolicy = (1UL << 25),
184 
186  kListBoxGrabsKeyFocusWindowPolicy = (1UL << 26),
188  kListBoxDoesntGrabsKeyFocusWindowPolicy = (1UL << 27),
189 
191  kDoUnused1WindowPolicy = (1UL << 28),
193  kDontUnused1WindowPolicy = (1UL << 29),
194 
196  kDoUnused2WindowPolicy = (1UL << 30),
198  kDontUnused2WindowPolicy = (1UL << 31)
199  };
200 
201 
202 public:
206  virtual void InitWindow( uint32 policyBits) = 0;
207 
210  virtual void OpenWindow() = 0;
211 
214  virtual void CloseWindow() = 0;
215 
218  virtual void PlatformWindowClosed() = 0;
219 
223  virtual void SetTitle(const PMString& newtitle) = 0;
224 
228  virtual const PMString& GetTitle() const = 0;
229 
233  virtual const InterfaceFontInfo& GetFont() const = 0;
234 
238  virtual const InterfaceFontInfo& GetHiliteFont() const = 0;
239 
243  virtual void SetFrameBBox(const GSysRect& rt) = 0;
244 
248  virtual GSysRect GetFrameBBox() const = 0;
249 
253  virtual GSysRect GetContentBBox() const = 0;
254 
258  virtual void SetContentBBox(const GSysRect& bbox) = 0;
259 
262  virtual int32 GetTitlebarHeight() const = 0;
263 
266  virtual int32 GetBorderWidth() const = 0;
267 
271  virtual SysRect GetVisRgnBBox() const = 0;
272 
277  virtual void Resize(SysCoord newWidth, SysCoord newHeight) = 0;
278 
285  virtual void SetPosition(GSysCoord xPos, GSysCoord yPos, bool16 inFront) = 0;
286 
289  virtual void CenterOnScreen() = 0;
290 
294  virtual SysWindow GetSysWindow() const = 0;
295 
296 #ifdef ID_DEPRECATED
297  virtual void SetSysWindow(const SysWindow sysWindow) = 0;
298 #endif
299 
300  typedef enum { kZoomedOut, kZoomedIn, kResetZoomedOut} ZoomState;
301 
305  virtual void Zoom(ZoomState zoomState, GSysRect *zoomRect) = 0;
306 
309  virtual ZoomState GetZoomState() const = 0;
312  virtual void SetZoomState(ZoomState zoomState) = 0;
313 
316  virtual void SetVisible(VisibleState state, bool16 apply = kTrue) = 0;
317 
320  virtual VisibleState GetVisible() const = 0;
321 
324  virtual bool16 IsVisible() const = 0;
325 
328  virtual void VisibleStateChanged(VisibleState state) = 0;
329 
332  virtual void BringToFront() = 0;
333 
336  virtual void Activate() = 0;
337 
340  virtual void Deactivate() = 0;
341 
344  virtual bool16 IsActive() const = 0;
345 
346  typedef enum{ kLimitMinimumWidth, kLimitMaximumWidth, kLimitMinimumHeight, kLimitMaximumHeight } LimitType;
347 
350  virtual SysCoord GetLimits( const LimitType type ) const = 0;
351 
354  virtual void SetLimits( const LimitType type, const SysCoord newLimit) = 0;
355 
358  virtual void Paint(IViewPort* viewPort, SysRgn updateRgn) = 0;
359 
362  virtual void SystemPaint() = 0;
363 
366  virtual bool16 IsRolledUp(bool16& changed) const = 0;
367 
370  virtual bool16 DoesFloat() const = 0;
371 
383  virtual SysRgn SystemScroll(const SysPoint& delta, bool16 bDoInval = kTrue, SysRect *bbox = nil) = 0;
384 
389  virtual void ForceRedraw(SysRgn invalidRgnToAdopt, bool16 forceRedraw) = 0;
390 
393  virtual bool16 IsOnScreen() const = 0;
394 
397  virtual void EnsureOnScreen() = 0;
398 
402  virtual uint32 GetWindowPolicy() const = 0;
403 
407  virtual void SetWindowPolicy(uint32 policy) = 0;
408 
409  /* Set the drover theme on the top level window for Palette, Dialog or Document
410  *
411  */
412  virtual void InitThemeForWindow() = 0;
413 };
414 
415 DECLARE_BASE_TYPE(IWindow::WindowSpec);
416 
417 #endif