InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CCollection.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: vaggarwa
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 __Collection__
25 #define __Collection__
26 
27 // ----- Interfaces -----
28 #include "ICommand.h"
29 
30 // ----- Includes -----
31 #include "ContentDropperTypes.h"
32 #include "BravoForwardDecl.h"
33 // ----- ID.h files -----
34 #include "ContentDropperToolID.h"
35 
36 //========================================================================================
37 // class Collection
38 //========================================================================================
39 
41 {
42 public:
43  explicit CCollection(int32 objType,IDataBase* db): fType(objType),fDb(db),fCaptureID(-1),fLinkPolicy(ContentDropperTypes::kUnknownPolicy) {};
44  virtual ~CCollection(){};
45  //For general operations on a colection
46 
47  virtual bool16 Find(UID)const = 0 ;
48  virtual bool16 Remove(UID) = 0;
49  virtual bool16 RemoveNth(int32) = 0;
50 
51  virtual CCollection* GetNthElement(int16) const = 0 ;
52  virtual int32 GetNumberOfElements(void) const = 0 ;
53 
54  //returns UIDList of all the items in this collection. Flattened List with all the children
55  //@param - true if the returned list should be sorted in order of z-order, uses ArrangeUtils Sorting
56  virtual const UIDList GetFlattenedUIDList(bool16 sorted = kTrue) const = 0 ;
57 
58  //Check operations that may be restricted
59  virtual bool16 IsExpandable()const = 0 ;
60  virtual bool16 CanUnbundle() const= 0 ;
61  //virtual bool16 IsCollapsed()const = 0 ;
62 
63 
64  //Preview handling
65  virtual void ReadWrite(IPMStream* s, ImplementationID id) = 0;
66 
67  virtual int32 GetType() const {return fType;}
68 
69  virtual bool16 GetPreview(CAGMImage & newImage, const uint32 maxWidth, const uint32 maxHeight) const = 0;
70 
71  virtual void SetCaptureID(int32 id) {fCaptureID = id;}
72  virtual int32 GetCaptureID() const {return fCaptureID;}
73 
74  virtual void SetLinkPolicy(ContentDropperTypes::LinkPolicy linkPolicy) { fLinkPolicy = linkPolicy; }
75  virtual ContentDropperTypes::LinkPolicy GetLinkPolicy() const { return fLinkPolicy; }
76 
77 protected:
78  int32 fType; //stores identifier for each subclass type. CollectionFactory uses this.
79  IDataBase* fDb;
80  int32 fCaptureID;
81  ContentDropperTypes::LinkPolicy fLinkPolicy;
82 };
83 
84 #endif