InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDialogMgr.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Burbidge
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 __IDialogMgr_h__
25 #define __IDialogMgr_h__
26 
27 #include "IPMUnknown.h"
28 #include "IDialog.h"
29 #include "ShuksanID.h"
30 
31 class IResourceAccess;
32 class RsrcSpec;
33 class IWindow;
34 
40 class IDialogMgr : public IPMUnknown
41 {
42 public:
43  enum { kDefaultIID = IID_IDIALOGMGR };
44 
49  enum
50  {
51  kAllowMultipleCopies = kTrue,
52  kDontAllowMultipleCopies = kFalse,
53 
54  kCacheDialog = kTrue,
55  kDontCacheDialog = kFalse,
56 
57  kAllowUserResize = kTrue,
58  kDontAllowUserResize = kFalse,
59  };
60 
78  virtual IDialog* CreateNewDialog(const RsrcSpec& spec,
79  const IDialog::DialogType& dialogType,
80  bool16 allowMultipleCopies = kAllowMultipleCopies,
81  bool16 okToCacheDialog = kCacheDialog,
82  bool16 allowResize = kDontAllowUserResize) = 0;
83 
94  virtual IDialog* CreateNewDialog(ClassID windowClass, const RsrcSpec& spec,
95  const IDialog::DialogType& dialogType,
96  bool16 allowMultipleCopies = kAllowMultipleCopies,
97  bool16 okToCacheDialog = kCacheDialog,
98  bool16 allowResize = kDontAllowUserResize) = 0;
99 
101  virtual bool16 IsModalDialogOpen() const = 0;
102 
104  virtual bool16 IsModelessDialogInFront() const = 0;
105 
107  virtual bool16 IsAnyDialogInFront() const = 0;
108 
111  virtual IWindow* GetFrontmostDialogWindow() const = 0;
112 
113  // ----- Internal Use -----
114  virtual void IncrementModalDialogCnt() = 0;
115  virtual void DecrementModalDialogCnt() = 0;
116  virtual uint16 GetModalDialogCnt() const = 0;
117 
122  virtual void SetSuppressDialogs( bool16 suppress ) = 0 ;
123 
126  virtual bool16 GetSuppressDialogs() const = 0 ;
127 
128 #ifdef WINDOWS
129  // Following set of APIs should be used by users to mark the opening and closing of clients own platform defined dialog.
130  // While opening the dialog, clients should call PlatformWindowOpening and while closing the dialog PlatformWindowClosed.
131  virtual void PlatformWindowOpening() = 0;
132  virtual void PlatformWindowClosed() = 0;
133  virtual bool16 IsPlatformWindowOpen() = 0;
134 
135  // Following APIs are used internally in Indesign to save the current focus control in the platform windows control.
136  // And restore focus to the saved control
137  // Clients should use this functions only if they want to save and restore the focus.
138  virtual bool16 HasSavedFocusedPlatformWindow() = 0;
139  virtual void SaveFocusedPlatformWindow() = 0;
140  virtual void RestoreFocusToPlatformWindow() = 0;
141 #endif
142 
143  /* Internal Use */
144  virtual uint64 ClearDialogInstanceList(bool16 reportMemoryUsed=kFalse) = 0;
145  virtual bool16 CanProcessDelayedWaitForDialog(IDialog *iDialog) = 0;
146  virtual void ClearDialogFromInstanceList(IDialog* iDialog) = 0;
147 #ifdef WINDOWS
148  virtual void SaveFocusedExternalWindow() = 0;
149  virtual void RestoreFocusToExternalWindow() = 0;
150 #endif
151 
152 #ifdef MACINTOSH
153  /* ----- Internal Use -----
154  It is used to stop the modal loop triggerd by modal dialog
155  */
156  virtual void StopModal() = 0;
157 #endif
158 };
159 
160 #endif