InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IXRefFormat.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Jianlan Song
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 
25 #include "IPMUnknown.h"
26 #include "IOwnedItem.h"
27 
28 #include "HyperlinkID.h"
29 
30 #include "XRefBuildingBlock.h"
31 
32 #define kDefaultXRefFormatCount 9
33 
37 typedef struct CharStyleRange
38 {
39  typedef base_type data_type;
40 
41  CharStyleRange() : charStyle(kInvalidUID), startOffset(0), length(0) {}
42  bool16 operator==(const CharStyleRange& s) const
43  { return ( charStyle == s.charStyle && startOffset == s.startOffset && length == s.length); }
44 
45  UID charStyle;
46  TextIndex startOffset;
47  int32 length;
49 
55 class IXRefFormat : public IPMUnknown
56 {
57 public:
58  enum { kDefaultIID = IID_IXREFFORMAT };
59 
60  virtual void CopyData(const IXRefFormat* other) = 0;
61 
65  virtual void SetName(const PMString & formatName) = 0;
69  virtual PMString GetName() const = 0;
70 
73  virtual void SetCharacterStyle(UID charStyle) = 0;
74  virtual UID GetCharacterStyle() const = 0;
75 
79  virtual void SetBuildingBlocks(const K2Vector<XRefBuildingBlock>& buildingBlocks) = 0;
80 
84  virtual void GetBuildingBlocks(K2Vector<XRefBuildingBlock>& buildingBlocks) const = 0;
85 
89  virtual int32 GetBuildingBlockCount() const = 0;
90 
96  virtual bool16 GetNthBuildingBlock(int32 index, XRefBuildingBlock& buildingBlock) const = 0;
97 
101  virtual bool16 HasParagraphBlock() const = 0;
102 
108  virtual PMString GenerateBlocksString() const = 0;
109 
121  virtual PMString GenerateSourceString(const IOwnedItem* destMarker, bool16 isParagraphDest, K2Vector<CharStyleRange>& charStyleRanges,
122  K2Vector<uint32>& pageNumLocations, K2Vector<uint32>& chapterNumLocations, std::map<TextIndex, WideString>* variableLocations,
123  std::map<TextIndex, TextIndex>* inlineLocations) const = 0;
124 };
125 
126