InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IWindowList.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: frits habermann
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 // Purpose: IWindowList provides an interface for collecting a set of windows. It also provides methods for opening
24 // and closing a window.
25 //
26 //========================================================================================
27 
28 #ifndef __IWINDOWLIST__
29 #define __IWINDOWLIST__
30 
31 #include "IPMUnknown.h"
32 #include "ShuksanID.h"
33 #include "IWindow.h"
34 
35 class IWindow;
39 class IWindowList : public IPMUnknown
40 {
41 public:
42  enum {kDefaultIID = IID_IWINDOWLIST};
43 
47  virtual void AddWindow(IWindow *newWin) = 0;
48 
53  virtual void WindowOpened(IWindow * win) = 0;
54 
59  virtual void WindowClosed(IWindow * win) = 0;
60 
65  virtual void CloseWindow(int32 index) = 0;
66 
70  virtual void CloseAll() = 0;
71 
77  virtual IPMUnknown *GetPMUnknown(SysWindow window) = 0;
78 
79 
80 
81 #ifdef ID_DEPRECATED
82 
84  virtual IWindow* GetFrontWindow() = 0;
85 #endif
86 
90  virtual bool16 IsWindowInList(IWindow *) const = 0;
91 
94  class iterator
95  {
96  friend class IWindowList;
97  public:
98  typedef std::ptrdiff_t difference_type;
99  typedef IWindow* value_type;
100  bool16 operator==(const iterator& rhs) const { return n == rhs.n && list == rhs.list;}
101  bool16 operator!=(const iterator& rhs) const { return !(*this == rhs);}
102  iterator& operator++() { ++n; return *this;}
103  IWindow* operator*() const { return list->GetNthWindow(n);}
104  private:
105  IWindowList* list;
106  int32 n;
107  iterator();
108  iterator(IWindowList* inList, int32 inN) : list(inList), n(inN) {}
109  };
113  {
114  friend class IWindowList;
115  public:
116  typedef std::ptrdiff_t difference_type;
117  typedef IWindow* value_type;
118  bool16 operator==(const reverse_iterator& rhs) const { return n == rhs.n && list == rhs.list;}
119  bool16 operator!=(const reverse_iterator& rhs) const { return !(*this == rhs);}
120  reverse_iterator& operator++() { --n; return *this;}
121  IWindow* operator*() const { return list->GetNthWindow(n-1);}
122  private:
123  IWindowList* list;
124  int32 n;
126  reverse_iterator(IWindowList* inList, int32 inN) : list(inList), n(inN) {}
127  };
128  friend class iterator;
129  friend class reverse_iterator;
130 
131  iterator begin() { return iterator(this, 0);}
132  iterator end(){ return iterator(this, WindowCount());}
133  reverse_iterator rbegin() { return reverse_iterator(this, WindowCount());}
134  reverse_iterator rend() { return reverse_iterator(this, 0);}
135 
136 
137 public://until I get everyone using the iterators
138 
143  virtual IWindow* GetNthWindow(int32 n ) = 0;
144 
148  virtual int32 WindowCount() const = 0;
149 
153  virtual const K2Vector<IWindow *>& GetZOrderSortedDocumentWindows() const = 0;
154 
158  virtual void MakeDocumentWindowTopmost(IWindow * docWindow) = 0;
159 
160 
161 #ifdef ID_DEPRECATED
162 
164  int32 Length() const {return WindowCount();};
165 #endif
166 };
167 
168 
169 #endif