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
00134
00135
00136
00137
00138
00139
00140
00141
00142 #if !defined(XMLELEMENTDECL_HPP)
00143 #define XMLELEMENTDECL_HPP
00144
00145 #include <xercesc/framework/XMLAttr.hpp>
00146 #include <xercesc/framework/XMLAttDefList.hpp>
00147 #include <xercesc/util/XMLString.hpp>
00148 #include <xercesc/util/PlatformUtils.hpp>
00149
00150 XERCES_CPP_NAMESPACE_BEGIN
00151
00152 class ContentSpecNode;
00153 class XMLContentModel;
00154
00170 class XMLElementDecl : public XMemory
00171 {
00172 public:
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188 enum CreateReasons
00189 {
00190 NoReason
00191 , Declared
00192 , AttList
00193 , InContentModel
00194 , AsRootElem
00195 , JustFaultIn
00196 };
00197
00198 enum LookupOpts
00199 {
00200 AddIfNotFound
00201 , FailIfNotFound
00202 };
00203
00204 enum CharDataOpts
00205 {
00206 NoCharData
00207 , SpacesOk
00208 , AllCharData
00209 };
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226 static const unsigned int fgInvalidElemId;
00227 static const unsigned int fgPCDataElemId;
00228 static const XMLCh fgPCDataElemName[];
00229
00230
00231
00232
00233
00234
00237 virtual ~XMLElementDecl();
00239
00240
00241
00242
00243
00244
00247
00276 virtual XMLAttDef* findAttr
00277 (
00278 const XMLCh* const qName
00279 , const unsigned int uriId
00280 , const XMLCh* const baseName
00281 , const XMLCh* const prefix
00282 , const LookupOpts options
00283 , bool& wasAdded
00284 ) const = 0;
00285
00297 virtual XMLAttDefList& getAttDefList() const = 0;
00298
00306 virtual CharDataOpts getCharDataOpts() const = 0;
00307
00314 virtual bool hasAttDefs() const = 0;
00315
00323 virtual bool resetDefs() = 0;
00324
00332 virtual const ContentSpecNode* getContentSpec() const = 0;
00333
00339 virtual ContentSpecNode* getContentSpec() = 0;
00340
00350 virtual void setContentSpec(ContentSpecNode* toAdopt) = 0;
00351
00363 virtual XMLContentModel* getContentModel() = 0;
00364
00376 virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0;
00377
00390 virtual const XMLCh* getFormattedContentModel () const = 0;
00391
00393
00394
00395
00396
00397
00398
00401
00409 const XMLCh* getBaseName() const;
00410 XMLCh* getBaseName();
00411
00418 unsigned int getURI() const;
00419
00427 const QName* getElementName() const;
00428 QName* getElementName();
00429
00438 const XMLCh* getFullName() const;
00439
00451 CreateReasons getCreateReason() const;
00452
00462 unsigned int getId() const;
00463
00464
00468 virtual const XMLCh* getDOMTypeInfoUri() const = 0;
00469
00473 virtual const XMLCh* getDOMTypeInfoName() const = 0;
00474
00475
00485 bool isDeclared() const;
00486
00495 bool isExternal() const;
00496
00504 MemoryManager* getMemoryManager() const;
00505
00507
00508
00509
00510
00511
00512
00515
00526 void setElementName(const XMLCh* const prefix
00527 , const XMLCh* const localPart
00528 , const int uriId );
00529
00539 void setElementName(const XMLCh* const rawName
00540 , const int uriId );
00541
00550 void setElementName(const QName* const elementName);
00551
00562 void setCreateReason(const CreateReasons newReason);
00563
00570 void setId(const unsigned int newId);
00571
00572
00576 void setExternalElemDeclaration(const bool aValue);
00577
00579
00580
00581
00582
00583
00584
00587
00589
00590
00591 protected :
00592
00593
00594
00595 XMLElementDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00596
00597 private :
00598
00599
00600
00601 XMLElementDecl(const XMLElementDecl&);
00602 XMLElementDecl& operator=(const XMLElementDecl&);
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628 MemoryManager* fMemoryManager;
00629 QName* fElementName;
00630 CreateReasons fCreateReason;
00631 unsigned int fId;
00632 bool fExternalElement;
00633 };
00634
00635
00636
00637
00638
00639 inline const XMLCh* XMLElementDecl::getBaseName() const
00640 {
00641 return fElementName->getLocalPart();
00642 }
00643
00644 inline XMLCh* XMLElementDecl::getBaseName()
00645 {
00646 return fElementName->getLocalPart();
00647 }
00648
00649 inline unsigned int XMLElementDecl::getURI() const
00650 {
00651 return fElementName->getURI();
00652 }
00653
00654 inline const QName* XMLElementDecl::getElementName() const
00655 {
00656 return fElementName;
00657 }
00658
00659 inline QName* XMLElementDecl::getElementName()
00660 {
00661 return fElementName;
00662 }
00663
00664 inline const XMLCh* XMLElementDecl::getFullName() const
00665 {
00666 return fElementName->getRawName();
00667 }
00668
00669 inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
00670 {
00671 return fCreateReason;
00672 }
00673
00674 inline unsigned int XMLElementDecl::getId() const
00675 {
00676 return fId;
00677 }
00678
00679 inline bool XMLElementDecl::isDeclared() const
00680 {
00681 return (fCreateReason == Declared);
00682 }
00683
00684
00685 inline bool XMLElementDecl::isExternal() const
00686 {
00687 return fExternalElement;
00688 }
00689
00690 inline MemoryManager* XMLElementDecl::getMemoryManager() const
00691 {
00692 return fMemoryManager;
00693 }
00694
00695
00696
00697
00698
00699 inline void
00700 XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
00701 {
00702 fCreateReason = newReason;
00703 }
00704
00705 inline void XMLElementDecl::setId(const unsigned int newId)
00706 {
00707 fId = newId;
00708 }
00709
00710
00711 inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue)
00712 {
00713 fExternalElement = aValue;
00714 }
00715
00716 XERCES_CPP_NAMESPACE_END
00717
00718 #endif