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 #if !defined(XMLELEMENTDECL_HPP)
00125 #define XMLELEMENTDECL_HPP
00126
00127 #include <xercesc/util/XMLString.hpp>
00128 #include <xercesc/framework/XMLAttr.hpp>
00129 #include <xercesc/framework/XMLAttDefList.hpp>
00130
00131 class ContentSpecNode;
00132 class XMLContentModel;
00133
00149 class XMLElementDecl
00150 {
00151 public:
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 enum CreateReasons
00168 {
00169 NoReason
00170 , Declared
00171 , AttList
00172 , InContentModel
00173 , AsRootElem
00174 , JustFaultIn
00175 };
00176
00177 enum LookupOpts
00178 {
00179 AddIfNotFound
00180 , FailIfNotFound
00181 };
00182
00183 enum CharDataOpts
00184 {
00185 NoCharData
00186 , SpacesOk
00187 , AllCharData
00188 };
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205 static const unsigned int fgInvalidElemId;
00206 static const unsigned int fgPCDataElemId;
00207 static const XMLCh fgPCDataElemName[];
00208
00209
00210
00211
00212
00213
00216
00218
00219
00220
00221
00222
00223
00226
00255 virtual XMLAttDef* findAttr
00256 (
00257 const XMLCh* const qName
00258 , const unsigned int uriId
00259 , const XMLCh* const baseName
00260 , const XMLCh* const prefix
00261 , const LookupOpts options
00262 , bool& wasAdded
00263 ) const = 0;
00264
00276 virtual XMLAttDefList& getAttDefList() const = 0;
00277
00285 virtual CharDataOpts getCharDataOpts() const = 0;
00286
00293 virtual bool hasAttDefs() const = 0;
00294
00302 virtual bool resetDefs() = 0;
00303
00311 virtual const ContentSpecNode* getContentSpec() const = 0;
00312
00318 virtual ContentSpecNode* getContentSpec() = 0;
00319
00329 virtual void setContentSpec(ContentSpecNode* toAdopt) = 0;
00330
00342 virtual XMLContentModel* getContentModel() = 0;
00343
00355 virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0;
00356
00369 virtual const XMLCh* getFormattedContentModel () const = 0;
00370
00372
00373
00374
00375
00376
00377
00380
00388 const XMLCh* getBaseName() const;
00389 XMLCh* getBaseName();
00390
00397 const unsigned int getURI() const;
00398
00406 const QName* getElementName() const;
00407 QName* getElementName();
00408
00417 const XMLCh* getFullName() const;
00418
00429
00430 CreateReasons getCreateReason() const;
00431
00441 unsigned int getId() const;
00442
00452 bool isDeclared() const;
00453
00461
00462 bool isExternal() const;
00463
00465
00466
00467
00468
00469
00470
00473
00484 void setElementName(const XMLCh* const prefix
00485 , const XMLCh* const localPart
00486 , const int uriId );
00487
00497 void setElementName(const XMLCh* const rawName
00498 , const int uriId );
00499
00508 void setElementName(const QName* const elementName);
00509
00520 void setCreateReason(const CreateReasons newReason);
00521
00528 void setId(const unsigned int newId);
00529
00530
00534 void setExternalElemDeclaration(const bool aValue);
00535
00537
00538
00539
00540
00541
00542
00545
00547
00548
00549 protected :
00550
00551
00552
00553 XMLElementDecl();
00554
00555 private :
00556
00557
00558
00559 XMLElementDecl(const XMLElementDecl&);
00560 void operator=(const XMLElementDecl&);
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586 QName* fElementName;
00587 CreateReasons fCreateReason;
00588 unsigned int fId;
00589 bool fExternalElement;
00590 };
00591
00592
00593
00594
00595
00596 inline const XMLCh* XMLElementDecl::getBaseName() const
00597 {
00598 return fElementName->getLocalPart();
00599 }
00600
00601 inline XMLCh* XMLElementDecl::getBaseName()
00602 {
00603 return fElementName->getLocalPart();
00604 }
00605
00606 inline const unsigned int XMLElementDecl::getURI() const
00607 {
00608 return fElementName->getURI();
00609 }
00610
00611 inline const QName* XMLElementDecl::getElementName() const
00612 {
00613 return fElementName;
00614 }
00615
00616 inline QName* XMLElementDecl::getElementName()
00617 {
00618 return fElementName;
00619 }
00620
00621 inline const XMLCh* XMLElementDecl::getFullName() const
00622 {
00623 return fElementName->getRawName();
00624 }
00625
00626 inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
00627 {
00628 return fCreateReason;
00629 }
00630
00631 inline unsigned int XMLElementDecl::getId() const
00632 {
00633 return fId;
00634 }
00635
00636 inline bool XMLElementDecl::isDeclared() const
00637 {
00638 return (fCreateReason == Declared);
00639 }
00640
00641
00642 inline bool XMLElementDecl::isExternal() const
00643 {
00644 return fExternalElement;
00645 }
00646
00647
00648
00649
00650
00651 inline void
00652 XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
00653 {
00654 fCreateReason = newReason;
00655 }
00656
00657 inline void XMLElementDecl::setId(const unsigned int newId)
00658 {
00659 fId = newId;
00660 }
00661
00662
00663 inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue)
00664 {
00665 fExternalElement = aValue;
00666 }
00667
00668 #endif