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 #if !defined(XMLELEMENTDECL_HPP)
00122 #define XMLELEMENTDECL_HPP
00123
00124 #include <util/XMLString.hpp>
00125 #include <framework/XMLAttr.hpp>
00126 #include <framework/XMLAttDefList.hpp>
00127
00128 class ContentSpecNode;
00129 class XMLContentModel;
00130
00146 class XMLElementDecl
00147 {
00148 public:
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 enum CreateReasons
00165 {
00166 NoReason
00167 , Declared
00168 , AttList
00169 , InContentModel
00170 , AsRootElem
00171 , JustFaultIn
00172 };
00173
00174 enum LookupOpts
00175 {
00176 AddIfNotFound
00177 , FailIfNotFound
00178 };
00179
00180 enum CharDataOpts
00181 {
00182 NoCharData
00183 , SpacesOk
00184 , AllCharData
00185 };
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202 static const unsigned int fgInvalidElemId;
00203 static const unsigned int fgPCDataElemId;
00204 static const XMLCh fgPCDataElemName[];
00205
00206
00207
00208
00209
00210
00213
00215
00216
00217
00218
00219
00220
00223
00252 virtual XMLAttDef* findAttr
00253 (
00254 const XMLCh* const qName
00255 , const unsigned int uriId
00256 , const XMLCh* const baseName
00257 , const XMLCh* const prefix
00258 , const LookupOpts options
00259 , bool& wasAdded
00260 ) const = 0;
00261
00273 virtual XMLAttDefList& getAttDefList() const = 0;
00274
00282 virtual CharDataOpts getCharDataOpts() const = 0;
00283
00290 virtual bool hasAttDefs() const = 0;
00291
00299 virtual bool resetDefs() = 0;
00300
00308 virtual const ContentSpecNode* getContentSpec() const = 0;
00309
00315 virtual ContentSpecNode* getContentSpec() = 0;
00316
00326 virtual void setContentSpec(ContentSpecNode* toAdopt) = 0;
00327
00339 virtual XMLContentModel* getContentModel() = 0;
00340
00352 virtual void setContentModel(XMLContentModel* const newModelToAdopt) = 0;
00353
00366 virtual const XMLCh* getFormattedContentModel () const = 0;
00367
00369
00370
00371
00372
00373
00374
00377
00385 const XMLCh* getBaseName() const;
00386 XMLCh* getBaseName();
00387
00394 const unsigned int getURI() const;
00395
00403 const QName* getElementName() const;
00404 QName* getElementName();
00405
00414 const XMLCh* getFullName() const;
00415
00426
00427 CreateReasons getCreateReason() const;
00428
00438 unsigned int getId() const;
00439
00449 bool isDeclared() const;
00450
00458
00459 bool isExternal() const;
00460
00462
00463
00464
00465
00466
00467
00470
00481 void setElementName(const XMLCh* const prefix
00482 , const XMLCh* const localPart
00483 , const int uriId );
00484
00494 void setElementName(const XMLCh* const rawName
00495 , const int uriId );
00496
00505 void setElementName(const QName* const elementName);
00506
00517 void setCreateReason(const CreateReasons newReason);
00518
00525 void setId(const unsigned int newId);
00526
00527
00531 void setExternalElemDeclaration(const bool aValue);
00532
00534
00535
00536
00537
00538
00539
00542
00544
00545
00546 protected :
00547
00548
00549
00550 XMLElementDecl();
00551
00552 private :
00553
00554
00555
00556 XMLElementDecl(const XMLElementDecl&);
00557 void operator=(const XMLElementDecl&);
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583 QName* fElementName;
00584 CreateReasons fCreateReason;
00585 unsigned int fId;
00586 bool fExternalElement;
00587 };
00588
00589
00590
00591
00592
00593 inline const XMLCh* XMLElementDecl::getBaseName() const
00594 {
00595 return fElementName->getLocalPart();
00596 }
00597
00598 inline XMLCh* XMLElementDecl::getBaseName()
00599 {
00600 return fElementName->getLocalPart();
00601 }
00602
00603 inline const unsigned int XMLElementDecl::getURI() const
00604 {
00605 return fElementName->getURI();
00606 }
00607
00608 inline const QName* XMLElementDecl::getElementName() const
00609 {
00610 return fElementName;
00611 }
00612
00613 inline QName* XMLElementDecl::getElementName()
00614 {
00615 return fElementName;
00616 }
00617
00618 inline const XMLCh* XMLElementDecl::getFullName() const
00619 {
00620 return fElementName->getRawName();
00621 }
00622
00623 inline XMLElementDecl::CreateReasons XMLElementDecl::getCreateReason() const
00624 {
00625 return fCreateReason;
00626 }
00627
00628 inline unsigned int XMLElementDecl::getId() const
00629 {
00630 return fId;
00631 }
00632
00633 inline bool XMLElementDecl::isDeclared() const
00634 {
00635 return (fCreateReason == Declared);
00636 }
00637
00638
00639 inline bool XMLElementDecl::isExternal() const
00640 {
00641 return fExternalElement;
00642 }
00643
00644
00645
00646
00647
00648 inline void
00649 XMLElementDecl::setCreateReason(const XMLElementDecl::CreateReasons newReason)
00650 {
00651 fCreateReason = newReason;
00652 }
00653
00654 inline void XMLElementDecl::setId(const unsigned int newId)
00655 {
00656 fId = newId;
00657 }
00658
00659
00660 inline void XMLElementDecl::setExternalElemDeclaration(const bool aValue)
00661 {
00662 fExternalElement = aValue;
00663 }
00664
00665 #endif