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
00143
00144
00145
00146
00147
00148
00149
00150
00151 #if !defined(XMLELEMENTDECL_HPP)
00152 #define XMLELEMENTDECL_HPP
00153
00154 #include <xercesc/framework/XMLAttr.hpp>
00155 #include <xercesc/framework/XMLAttDefList.hpp>
00156 #include <xercesc/util/XMLString.hpp>
00157 #include <xercesc/util/PlatformUtils.hpp>
00158 #include <xercesc/internal/XSerializable.hpp>
00159
00160 XERCES_CPP_NAMESPACE_BEGIN
00161
00162 class ContentSpecNode;
00163 class XMLContentModel;
00164
00180 class XMLElementDecl : public XSerializable, public XMemory
00181 {
00182 public:
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198 enum CreateReasons
00199 {
00200 NoReason
00201 , Declared
00202 , AttList
00203 , InContentModel
00204 , AsRootElem
00205 , JustFaultIn
00206 };
00207
00212 enum LookupOpts
00213 {
00214 AddIfNotFound
00215 , FailIfNotFound
00216 };
00217
00218 enum CharDataOpts
00219 {
00220 NoCharData
00221 , SpacesOk
00222 , AllCharData
00223 };
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240 static const unsigned int fgInvalidElemId;
00241 static const unsigned int fgPCDataElemId;
00242 static const XMLCh fgPCDataElemName[];
00243
00244
00245
00246
00247
00248
00251 virtual ~XMLElementDecl();
00253
00254
00255
00256
00257
00258
00261
00292 virtual XMLAttDef* findAttr
00293 (
00294 const XMLCh* const qName
00295 , const unsigned int uriId
00296 , const XMLCh* const baseName
00297 , const XMLCh* const prefix
00298 , const LookupOpts options
00299 , bool& wasAdded
00300 ) const = 0;
00301
00313 virtual XMLAttDefList& getAttDefList() const = 0;
00314
00322 virtual CharDataOpts getCharDataOpts() const = 0;
00323
00330 virtual bool hasAttDefs() const = 0;
00331
00339 virtual bool resetDefs() = 0;
00340
00348 virtual const ContentSpecNode* getContentSpec() const = 0;
00349
00355 virtual ContentSpecNode* getContentSpec() = 0;
00356
00366 virtual void setContentSpec(ContentSpecNode* toAdopt) = 0;
00367
00379 virtual XMLContentModel* getContentModel() = 0;
00380
00392 virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0;
00393
00406 virtual const XMLCh* getFormattedContentModel () const = 0;
00407
00409
00410
00411
00412
00413
00414
00417
00425 const XMLCh* getBaseName() const;
00426 XMLCh* getBaseName();
00427
00434 unsigned int getURI() const;
00435
00443 const QName* getElementName() const;
00444 QName* getElementName();
00445
00454 const XMLCh* getFullName() const;
00455
00467 CreateReasons getCreateReason() const;
00468
00478 unsigned int getId() const;
00479
00480
00485 virtual const XMLCh* getDOMTypeInfoUri() const = 0;
00486
00491 virtual const XMLCh* getDOMTypeInfoName() const = 0;
00492
00493
00503 bool isDeclared() const;
00504
00513 bool isExternal() const;
00514
00522 MemoryManager* getMemoryManager() const;
00523
00525
00526
00527
00528
00529
00530
00533
00544 void setElementName(const XMLCh* const prefix
00545 , const XMLCh* const localPart
00546 , const int uriId );
00547
00557 void setElementName(const XMLCh* const rawName
00558 , const int uriId );
00559
00568 void setElementName(const QName* const elementName);
00569
00580 void setCreateReason(const CreateReasons newReason);
00581
00588 void setId(const unsigned int newId);
00589
00590
00594 void setExternalElemDeclaration(const bool aValue);
00595
00597
00598
00599
00600
00601
00602
00605
00607
00608
00609
00610
00611 DECL_XSERIALIZABLE(XMLElementDecl)
00612
00613 protected :
00614
00615
00616
00617 XMLElementDecl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00618
00619 private :
00620
00621
00622
00623 XMLElementDecl(const XMLElementDecl&);
00624 XMLElementDecl& operator=(const XMLElementDecl&);
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650 MemoryManager* fMemoryManager;
00651 QName* fElementName;
00652 CreateReasons fCreateReason;
00653 unsigned int fId;
00654 bool fExternalElement;
00655 };
00656
00657
00658
00659
00660
00661 inline const XMLCh* XMLElementDecl::getBaseName() const
00662 {
00663 return fElementName->getLocalPart();
00664 }
00665
00666 inline XMLCh* XMLElementDecl::getBaseName()
00667 {
00668 return fElementName->getLocalPart();
00669 }
00670
00671 inline unsigned int XMLElementDecl::getURI() const
00672 {
00673 return fElementName->getURI();
00674 }
00675
00676 inline const QName* XMLElementDecl::getElementName() const
00677 {
00678 return fElementName;
00679 }
00680
00681 inline QName* XMLElementDecl::getElementName()
00682 {
00683 return fElementName;
00684 }
00685
00686 inline const XMLCh* XMLElementDecl::getFullName() const
00687 {
00688 return fElementName->getRawName();
00689 }
00690
00691 inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
00692 {
00693 return fCreateReason;
00694 }
00695
00696 inline unsigned int XMLElementDecl::getId() const
00697 {
00698 return fId;
00699 }
00700
00701 inline bool XMLElementDecl::isDeclared() const
00702 {
00703 return (fCreateReason == Declared);
00704 }
00705
00706
00707 inline bool XMLElementDecl::isExternal() const
00708 {
00709 return fExternalElement;
00710 }
00711
00712 inline MemoryManager* XMLElementDecl::getMemoryManager() const
00713 {
00714 return fMemoryManager;
00715 }
00716
00717
00718
00719
00720
00721 inline void
00722 XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
00723 {
00724 fCreateReason = newReason;
00725 }
00726
00727 inline void XMLElementDecl::setId(const unsigned int newId)
00728 {
00729 fId = newId;
00730 }
00731
00732
00733 inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue)
00734 {
00735 fExternalElement = aValue;
00736 }
00737
00738 XERCES_CPP_NAMESPACE_END
00739
00740 #endif