InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CListControlDataOf.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 __CListControlDataOf_h__
25 #define __CListControlDataOf_h__
26 
27 #include "IListControlDataOf.h"
28 #include "K2Vector.h"
29 #include "CPMUnknown.h"
30 
31 //========================================================================================
32 // TEMPLATE CListControlDataOf
33 //========================================================================================
34 
35 template <class T>
36 class CListControlDataOf : public CPMUnknown< IListControlDataOf<T> >
37 {
38 public:
40  virtual ~CListControlDataOf() {}
41 
42  void ReadWrite(IPMStream *s, ImplementationID prop);
43 
44  // ----- List maintainence -----
45 
46  virtual void Add(const T& item, int32 at, bool16 invalidate, bool16 notifyOfChange);
47  virtual void Add(const K2Vector<T>& items, bool16 invalidate, bool16 notifyOfChange);
48  virtual void Remove(int32 index, bool16 invalidate, bool16 notifyOfChange);
49  virtual void Replace(const T& item, int32 index, bool16 invalidate, bool16 notifyOfChange);
50  virtual void Clear(bool16 invalidate, bool16 notifyOfChange);
51 
52  // ----- List query -----
53 
54  virtual T operator[](int32 index) const;
55  virtual int32 Length() const;
56  virtual void Refresh() const;
57 
58 protected:
59  virtual void ItemAdded(const T& item, int32 at, bool16 invalidate);
60  virtual void ItemRemoved(int32 index, bool16 invalidate);
61  virtual void ItemReplaced(const T& item, int32 index, bool16 invalidate);
62  virtual void ItemsCleared(bool16 invalidate, bool16 notifyOfChange);
63 
64  virtual void NotifyOfChange(bool16 invalidate, bool16 notifyOfChange, int32 changeMessage);
65 
66 private:
67  mutable K2Vector<T> fItemList;
68 };
69 #ifdef _INCLUDE_TPP_IN_H_
70  #include "CListControlDataOf.tpp"
71 #endif //_INCLUDE_TPP_IN_H_
72 
73 #endif // __CListControlDataOf_h__