InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IListBoxController.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Tom Taylor
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 __IListBoxController__
25 #define __IListBoxController__
26 
27 
28 // WARNING: listboxes are DEPRECATED and will disappear from a future version of InDesign. Please use TreeViews instead.
29 
30 #include "IPMUnknown.h"
31 #include "IControlView.h"
32 #include "widgetid.h"
33 #include "IEvent.h"
34 
35 // Some List Constants
36 
37 const int16 kTopAutoScrollSlop = 4; // area below top of list that we autoscroll the list in while dragging
38 const int16 kScrollBarWidth = 15;
39 
45 {
46 public:
47  enum { kNoSelection = -1 };
48  enum { kDefaultIID = IID_ILISTBOXCONTROLLER };
49 
52 
58  virtual void Select(int32 index, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue) = 0;
59 
64  virtual void SelectAll(bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue) = 0;
65 
71  virtual void Deselect(int32 index = -1, bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue) = 0;
72 
77  virtual void DeselectAll(bool16 invalidate = kTrue, bool16 notifyOfChange = kTrue) = 0;
78 
82  virtual bool16 IsSelected(int32 index) const = 0;
83 
87  virtual int32 GetSelected() const = 0;
88 
93  virtual void GetSelected(K2Vector<int32>& multipleSelection) const = 0;
94 
100  virtual void GetCheckedItems(K2Vector<int32>& checkedItems) const = 0;
101 
109  virtual void SetCheckedItems( const K2Vector<int32>& vecIndices, bool16 bInvalidate = kTrue, bool16 bNotify = kTrue) = 0;
110 
114  virtual void SetMasterItem(int32 itemNumber) = 0;
115 
119  virtual int32 GetMasterItem() const = 0;
121 
124 
127  virtual void SetClickItem(int32 itemNumber) = 0;
128 
129 
132  virtual int32 GetClickItem() const = 0;
133 
134 
137  virtual int32 FindRowHit(const PMPoint& clickPoint) = 0;
138 
151  };
152 
156  virtual eListBoxPart ClickedWhichPart(const PMPoint& clickPoint) = 0;
157 
159  enum eScrollDirection { kNoScroll = 0, kScrollUp, kScrollUpSlow, kScrollDown, kScrollDownSlow, kScrollLeft, kScrollLeftSlow, kScrollRight, kScrollRightSlow, kInsideDoNothing
170  };
171 
174  virtual void ScrollList(const eScrollDirection direction) = 0;
175 
176 
179  virtual void ScrollItemIntoView(int32 itemNumber) = 0;
180 
181 
184  virtual int32 GetFirstVisibleItem() const = 0;
185 
186 
189  virtual int32 GetMaximumVisibleItems() const = 0;
190 
191 
211  virtual int32 Search(const PMString& subString) const = 0;
212 
213 
217  virtual PMString GetNthItemString(int32 n) const = 0;
218 
219 
220  // These function are typically for internal use
223  virtual void GetVisibleItemBounds(int32 item, PMRect& newBounds) = 0;
224 
228 
231  virtual eScrollDirection CheckDragScroll(const PMPoint& where) = 0;
232 
238  virtual void SetSelected( const K2Vector<int32>& vecIndices, bool16 bInvalidate = kTrue, bool16 bNotify = kTrue) = 0;
239 
244  virtual void ProcessSelectionRules(IEvent* event, int32 index) = 0;
245 
247 
248 
249 };
250 
251 #endif