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 #if !defined(XMLELEMENTDECL_HPP)
00128 #define XMLELEMENTDECL_HPP
00129
00130 #include <xercesc/util/XMLString.hpp>
00131 #include <xercesc/framework/XMLAttr.hpp>
00132 #include <xercesc/framework/XMLAttDefList.hpp>
00133
00134 class ContentSpecNode;
00135 class XMLContentModel;
00136
00152 class XMLElementDecl
00153 {
00154 public:
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 enum CreateReasons
00171 {
00172 NoReason
00173 , Declared
00174 , AttList
00175 , InContentModel
00176 , AsRootElem
00177 , JustFaultIn
00178 };
00179
00180 enum LookupOpts
00181 {
00182 AddIfNotFound
00183 , FailIfNotFound
00184 };
00185
00186 enum CharDataOpts
00187 {
00188 NoCharData
00189 , SpacesOk
00190 , AllCharData
00191 };
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 static const unsigned int fgInvalidElemId;
00209 static const unsigned int fgPCDataElemId;
00210 static const XMLCh fgPCDataElemName[];
00211
00212
00213
00214
00215
00216
00219
00221
00222
00223
00224
00225
00226
00229
00258 virtual XMLAttDef* findAttr
00259 (
00260 const XMLCh* const qName
00261 , const unsigned int uriId
00262 , const XMLCh* const baseName
00263 , const XMLCh* const prefix
00264 , const LookupOpts options
00265 , bool& wasAdded
00266 ) const = 0;
00267
00279 virtual XMLAttDefList& getAttDefList() const = 0;
00280
00288 virtual CharDataOpts getCharDataOpts() const = 0;
00289
00296 virtual bool hasAttDefs() const = 0;
00297
00305 virtual bool resetDefs() = 0;
00306
00314 virtual const ContentSpecNode* getContentSpec() const = 0;
00315
00321 virtual ContentSpecNode* getContentSpec() = 0;
00322
00332 virtual void setContentSpec(ContentSpecNode* toAdopt) = 0;
00333
00345 virtual XMLContentModel* getContentModel() = 0;
00346
00358 virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0;
00359
00372 virtual const XMLCh* getFormattedContentModel () const = 0;
00373
00375
00376
00377
00378
00379
00380
00383
00391 const XMLCh* getBaseName() const;
00392 XMLCh* getBaseName();
00393
00400 unsigned int getURI() const;
00401
00409 const QName* getElementName() const;
00410 QName* getElementName();
00411
00420 const XMLCh* getFullName() const;
00421
00432
00433 CreateReasons getCreateReason() const;
00434
00444 unsigned int getId() const;
00445
00455 bool isDeclared() const;
00456
00464
00465 bool isExternal() const;
00466
00468
00469
00470
00471
00472
00473
00476
00487 void setElementName(const XMLCh* const prefix
00488 , const XMLCh* const localPart
00489 , const int uriId );
00490
00500 void setElementName(const XMLCh* const rawName
00501 , const int uriId );
00502
00511 void setElementName(const QName* const elementName);
00512
00523 void setCreateReason(const CreateReasons newReason);
00524
00531 void setId(const unsigned int newId);
00532
00533
00537 void setExternalElemDeclaration(const bool aValue);
00538
00540
00541
00542
00543
00544
00545
00548
00550
00551
00552 protected :
00553
00554
00555
00556 XMLElementDecl();
00557
00558 private :
00559
00560
00561
00562 XMLElementDecl(const XMLElementDecl&);
00563 void operator=(const XMLElementDecl&);
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589 QName* fElementName;
00590 CreateReasons fCreateReason;
00591 unsigned int fId;
00592 bool fExternalElement;
00593 };
00594
00595
00596
00597
00598
00599 inline const XMLCh* XMLElementDecl::getBaseName() const
00600 {
00601 return fElementName->getLocalPart();
00602 }
00603
00604 inline XMLCh* XMLElementDecl::getBaseName()
00605 {
00606 return fElementName->getLocalPart();
00607 }
00608
00609 inline unsigned int XMLElementDecl::getURI() const
00610 {
00611 return fElementName->getURI();
00612 }
00613
00614 inline const QName* XMLElementDecl::getElementName() const
00615 {
00616 return fElementName;
00617 }
00618
00619 inline QName* XMLElementDecl::getElementName()
00620 {
00621 return fElementName;
00622 }
00623
00624 inline const XMLCh* XMLElementDecl::getFullName() const
00625 {
00626 return fElementName->getRawName();
00627 }
00628
00629 inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
00630 {
00631 return fCreateReason;
00632 }
00633
00634 inline unsigned int XMLElementDecl::getId() const
00635 {
00636 return fId;
00637 }
00638
00639 inline bool XMLElementDecl::isDeclared() const
00640 {
00641 return (fCreateReason == Declared);
00642 }
00643
00644
00645 inline bool XMLElementDecl::isExternal() const
00646 {
00647 return fExternalElement;
00648 }
00649
00650
00651
00652
00653
00654 inline void
00655 XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
00656 {
00657 fCreateReason = newReason;
00658 }
00659
00660 inline void XMLElementDecl::setId(const unsigned int newId)
00661 {
00662 fId = newId;
00663 }
00664
00665
00666 inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue)
00667 {
00668 fExternalElement = aValue;
00669 }
00670
00671 #endif