00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 #if !defined(XMLELEMENTDECL_HPP)
00134 #define XMLELEMENTDECL_HPP
00135
00136 #include <xercesc/util/XMLString.hpp>
00137 #include <xercesc/framework/XMLAttr.hpp>
00138 #include <xercesc/framework/XMLAttDefList.hpp>
00139
00140 XERCES_CPP_NAMESPACE_BEGIN
00141
00142 class ContentSpecNode;
00143 class XMLContentModel;
00144
00160 class XMLElementDecl
00161 {
00162 public:
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178 enum CreateReasons
00179 {
00180 NoReason
00181 , Declared
00182 , AttList
00183 , InContentModel
00184 , AsRootElem
00185 , JustFaultIn
00186 };
00187
00188 enum LookupOpts
00189 {
00190 AddIfNotFound
00191 , FailIfNotFound
00192 };
00193
00194 enum CharDataOpts
00195 {
00196 NoCharData
00197 , SpacesOk
00198 , AllCharData
00199 };
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216 static const unsigned int fgInvalidElemId;
00217 static const unsigned int fgPCDataElemId;
00218 static const XMLCh fgPCDataElemName[];
00219
00220
00221
00222
00223
00224
00227 virtual ~XMLElementDecl();
00229
00230
00231
00232
00233
00234
00237
00266 virtual XMLAttDef* findAttr
00267 (
00268 const XMLCh* const qName
00269 , const unsigned int uriId
00270 , const XMLCh* const baseName
00271 , const XMLCh* const prefix
00272 , const LookupOpts options
00273 , bool& wasAdded
00274 ) const = 0;
00275
00287 virtual XMLAttDefList& getAttDefList() const = 0;
00288
00296 virtual CharDataOpts getCharDataOpts() const = 0;
00297
00304 virtual bool hasAttDefs() const = 0;
00305
00313 virtual bool resetDefs() = 0;
00314
00322 virtual const ContentSpecNode* getContentSpec() const = 0;
00323
00329 virtual ContentSpecNode* getContentSpec() = 0;
00330
00340 virtual void setContentSpec(ContentSpecNode* toAdopt) = 0;
00341
00353 virtual XMLContentModel* getContentModel() = 0;
00354
00366 virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0;
00367
00380 virtual const XMLCh* getFormattedContentModel () const = 0;
00381
00383
00384
00385
00386
00387
00388
00391
00399 const XMLCh* getBaseName() const;
00400 XMLCh* getBaseName();
00401
00408 unsigned int getURI() const;
00409
00417 const QName* getElementName() const;
00418 QName* getElementName();
00419
00428 const XMLCh* getFullName() const;
00429
00441 CreateReasons getCreateReason() const;
00442
00452 unsigned int getId() const;
00453
00454
00458 virtual const XMLCh* getDOMTypeInfoUri() const = 0;
00459
00463 virtual const XMLCh* getDOMTypeInfoName() const = 0;
00464
00465
00475 bool isDeclared() const;
00476
00485 bool isExternal() const;
00486
00488
00489
00490
00491
00492
00493
00496
00507 void setElementName(const XMLCh* const prefix
00508 , const XMLCh* const localPart
00509 , const int uriId );
00510
00520 void setElementName(const XMLCh* const rawName
00521 , const int uriId );
00522
00531 void setElementName(const QName* const elementName);
00532
00543 void setCreateReason(const CreateReasons newReason);
00544
00551 void setId(const unsigned int newId);
00552
00553
00557 void setExternalElemDeclaration(const bool aValue);
00558
00560
00561
00562
00563
00564
00565
00568
00570
00571
00572 protected :
00573
00574
00575
00576 XMLElementDecl();
00577
00578 private :
00579
00580
00581
00582 XMLElementDecl(const XMLElementDecl&);
00583 void operator=(const XMLElementDecl&);
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609 QName* fElementName;
00610 CreateReasons fCreateReason;
00611 unsigned int fId;
00612 bool fExternalElement;
00613 };
00614
00615
00616
00617
00618
00619 inline const XMLCh* XMLElementDecl::getBaseName() const
00620 {
00621 return fElementName->getLocalPart();
00622 }
00623
00624 inline XMLCh* XMLElementDecl::getBaseName()
00625 {
00626 return fElementName->getLocalPart();
00627 }
00628
00629 inline unsigned int XMLElementDecl::getURI() const
00630 {
00631 return fElementName->getURI();
00632 }
00633
00634 inline const QName* XMLElementDecl::getElementName() const
00635 {
00636 return fElementName;
00637 }
00638
00639 inline QName* XMLElementDecl::getElementName()
00640 {
00641 return fElementName;
00642 }
00643
00644 inline const XMLCh* XMLElementDecl::getFullName() const
00645 {
00646 return fElementName->getRawName();
00647 }
00648
00649 inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
00650 {
00651 return fCreateReason;
00652 }
00653
00654 inline unsigned int XMLElementDecl::getId() const
00655 {
00656 return fId;
00657 }
00658
00659 inline bool XMLElementDecl::isDeclared() const
00660 {
00661 return (fCreateReason == Declared);
00662 }
00663
00664
00665 inline bool XMLElementDecl::isExternal() const
00666 {
00667 return fExternalElement;
00668 }
00669
00670
00671
00672
00673
00674 inline void
00675 XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
00676 {
00677 fCreateReason = newReason;
00678 }
00679
00680 inline void XMLElementDecl::setId(const unsigned int newId)
00681 {
00682 fId = newId;
00683 }
00684
00685
00686 inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue)
00687 {
00688 fExternalElement = aValue;
00689 }
00690
00691 XERCES_CPP_NAMESPACE_END
00692
00693 #endif