text: /**
  	* \file PnlWznmCtpKParKey.cpp
  	* API code for job PnlWznmCtpKParKey (implementation)
  	* \copyright (C) 2016-2020 MPSI Technologies GmbH
  	* \author Alexander Wirthmueller (auto-generation)
  	* \date created: 5 Dec 2020
  	*/
  // IP header --- ABOVE
  
  #include "PnlWznmCtpKParKey.h"
  
  using namespace std;
  using namespace Sbecore;
  using namespace Xmlio;
  
  /******************************************************************************
   class PnlWznmCtpKParKey::VecVDo
   ******************************************************************************/
  
  uint PnlWznmCtpKParKey::VecVDo::getIx(
  			const string& sref
  		) {
  	string s = StrMod::lc(sref);
  
  	if (s == "butupclick") return BUTUPCLICK;
  	if (s == "butdownclick") return BUTDOWNCLICK;
  	if (s == "butnewclick") return BUTNEWCLICK;
  	if (s == "butduplicateclick") return BUTDUPLICATECLICK;
  	if (s == "butdeleteclick") return BUTDELETECLICK;
  	if (s == "butrefreshclick") return BUTREFRESHCLICK;
  
  	return(0);
  };
  
  string PnlWznmCtpKParKey::VecVDo::getSref(
  			const uint ix
  		) {
  	if (ix == BUTUPCLICK) return("ButUpClick");
  	if (ix == BUTDOWNCLICK) return("ButDownClick");
  	if (ix == BUTNEWCLICK) return("ButNewClick");
  	if (ix == BUTDUPLICATECLICK) return("ButDuplicateClick");
  	if (ix == BUTDELETECLICK) return("ButDeleteClick");
  	if (ix == BUTREFRESHCLICK) return("ButRefreshClick");
  
  	return("");
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::ContInf
   ******************************************************************************/
  
  PnlWznmCtpKParKey::ContInf::ContInf(
  			const uint numFCsiQst
  		) :
  			Block()
  		{
  	this->numFCsiQst = numFCsiQst;
  
  	mask = {NUMFCSIQST};
  };
  
  bool PnlWznmCtpKParKey::ContInf::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContInfWznmCtpKParKey");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "ContitemInfWznmCtpKParKey";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFCsiQst", numFCsiQst)) add(NUMFCSIQST);
  	};
  
  	return basefound;
  };
  
  set<uint> PnlWznmCtpKParKey::ContInf::comm(
  			const ContInf* comp
  		) {
  	set<uint> items;
  
  	if (numFCsiQst == comp->numFCsiQst) insert(items, NUMFCSIQST);
  
  	return(items);
  };
  
  set<uint> PnlWznmCtpKParKey::ContInf::diff(
  			const ContInf* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {NUMFCSIQST};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::StatApp
   ******************************************************************************/
  
  PnlWznmCtpKParKey::StatApp::StatApp(
  			const uint ixWznmVExpstate
  		) :
  			Block()
  		{
  	this->ixWznmVExpstate = ixWznmVExpstate;
  
  	mask = {IXWZNMVEXPSTATE};
  };
  
  bool PnlWznmCtpKParKey::StatApp::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	string srefIxWznmVExpstate;
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatAppWznmCtpKParKey");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemAppWznmCtpKParKey";
  
  	if (basefound) {
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "srefIxWznmVExpstate", srefIxWznmVExpstate)) {
  			ixWznmVExpstate = VecWznmVExpstate::getIx(srefIxWznmVExpstate);
  			add(IXWZNMVEXPSTATE);
  		};
  	};
  
  	return basefound;
  };
  
  set<uint> PnlWznmCtpKParKey::StatApp::comm(
  			const StatApp* comp
  		) {
  	set<uint> items;
  
  	if (ixWznmVExpstate == comp->ixWznmVExpstate) insert(items, IXWZNMVEXPSTATE);
  
  	return(items);
  };
  
  set<uint> PnlWznmCtpKParKey::StatApp::diff(
  			const StatApp* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {IXWZNMVEXPSTATE};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::StatShr
   ******************************************************************************/
  
  PnlWznmCtpKParKey::StatShr::StatShr(
  			const bool ButUpActive
  			, const bool ButDownActive
  			, const bool ButDuplicateActive
  			, const bool ButDeleteActive
  		) :
  			Block()
  		{
  	this->ButUpActive = ButUpActive;
  	this->ButDownActive = ButDownActive;
  	this->ButDuplicateActive = ButDuplicateActive;
  	this->ButDeleteActive = ButDeleteActive;
  
  	mask = {BUTUPACTIVE, BUTDOWNACTIVE, BUTDUPLICATEACTIVE, BUTDELETEACTIVE};
  };
  
  bool PnlWznmCtpKParKey::StatShr::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StatShrWznmCtpKParKey");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StatitemShrWznmCtpKParKey";
  
  	if (basefound) {
  		if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButUpActive", ButUpActive)) add(BUTUPACTIVE);
  		if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButDownActive", ButDownActive)) add(BUTDOWNACTIVE);
  		if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButDuplicateActive", ButDuplicateActive)) add(BUTDUPLICATEACTIVE);
  		if (extractBoolAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "ButDeleteActive", ButDeleteActive)) add(BUTDELETEACTIVE);
  	};
  
  	return basefound;
  };
  
  set<uint> PnlWznmCtpKParKey::StatShr::comm(
  			const StatShr* comp
  		) {
  	set<uint> items;
  
  	if (ButUpActive == comp->ButUpActive) insert(items, BUTUPACTIVE);
  	if (ButDownActive == comp->ButDownActive) insert(items, BUTDOWNACTIVE);
  	if (ButDuplicateActive == comp->ButDuplicateActive) insert(items, BUTDUPLICATEACTIVE);
  	if (ButDeleteActive == comp->ButDeleteActive) insert(items, BUTDELETEACTIVE);
  
  	return(items);
  };
  
  set<uint> PnlWznmCtpKParKey::StatShr::diff(
  			const StatShr* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {BUTUPACTIVE, BUTDOWNACTIVE, BUTDUPLICATEACTIVE, BUTDELETEACTIVE};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::StgIac
   ******************************************************************************/
  
  PnlWznmCtpKParKey::StgIac::StgIac(
  			const uint TcoFixWidth
  			, const uint TcoSrfWidth
  			, const uint TcoAvlWidth
  			, const uint TcoImpWidth
  			, const uint TcoTitWidth
  			, const uint TcoCmtWidth
  		) :
  			Block()
  		{
  	this->TcoFixWidth = TcoFixWidth;
  	this->TcoSrfWidth = TcoSrfWidth;
  	this->TcoAvlWidth = TcoAvlWidth;
  	this->TcoImpWidth = TcoImpWidth;
  	this->TcoTitWidth = TcoTitWidth;
  	this->TcoCmtWidth = TcoCmtWidth;
  
  	mask = {TCOFIXWIDTH, TCOSRFWIDTH, TCOAVLWIDTH, TCOIMPWIDTH, TCOTITWIDTH, TCOCMTWIDTH};
  };
  
  bool PnlWznmCtpKParKey::StgIac::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "StgIacWznmCtpKParKey");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "StgitemIacWznmCtpKParKey";
  
  	if (basefound) {
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoFixWidth", TcoFixWidth)) add(TCOFIXWIDTH);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoSrfWidth", TcoSrfWidth)) add(TCOSRFWIDTH);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoAvlWidth", TcoAvlWidth)) add(TCOAVLWIDTH);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoImpWidth", TcoImpWidth)) add(TCOIMPWIDTH);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoTitWidth", TcoTitWidth)) add(TCOTITWIDTH);
  		if (extractUintAttrUclc(docctx, basexpath, itemtag, "Si", "sref", "TcoCmtWidth", TcoCmtWidth)) add(TCOCMTWIDTH);
  	};
  
  	return basefound;
  };
  
  void PnlWznmCtpKParKey::StgIac::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "StgIacWznmCtpKParKey";
  
  	string itemtag;
  	if (shorttags) itemtag = "Si";
  	else itemtag = "StgitemIacWznmCtpKParKey";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		writeUintAttr(wr, itemtag, "sref", "TcoFixWidth", TcoFixWidth);
  		writeUintAttr(wr, itemtag, "sref", "TcoSrfWidth", TcoSrfWidth);
  		writeUintAttr(wr, itemtag, "sref", "TcoAvlWidth", TcoAvlWidth);
  		writeUintAttr(wr, itemtag, "sref", "TcoImpWidth", TcoImpWidth);
  		writeUintAttr(wr, itemtag, "sref", "TcoTitWidth", TcoTitWidth);
  		writeUintAttr(wr, itemtag, "sref", "TcoCmtWidth", TcoCmtWidth);
  	xmlTextWriterEndElement(wr);
  };
  
  set<uint> PnlWznmCtpKParKey::StgIac::comm(
  			const StgIac* comp
  		) {
  	set<uint> items;
  
  	if (TcoFixWidth == comp->TcoFixWidth) insert(items, TCOFIXWIDTH);
  	if (TcoSrfWidth == comp->TcoSrfWidth) insert(items, TCOSRFWIDTH);
  	if (TcoAvlWidth == comp->TcoAvlWidth) insert(items, TCOAVLWIDTH);
  	if (TcoImpWidth == comp->TcoImpWidth) insert(items, TCOIMPWIDTH);
  	if (TcoTitWidth == comp->TcoTitWidth) insert(items, TCOTITWIDTH);
  	if (TcoCmtWidth == comp->TcoCmtWidth) insert(items, TCOCMTWIDTH);
  
  	return(items);
  };
  
  set<uint> PnlWznmCtpKParKey::StgIac::diff(
  			const StgIac* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {TCOFIXWIDTH, TCOSRFWIDTH, TCOAVLWIDTH, TCOIMPWIDTH, TCOTITWIDTH, TCOCMTWIDTH};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::Tag
   ******************************************************************************/
  
  PnlWznmCtpKParKey::Tag::Tag(
  			const string& Cpt
  			, const string& TxtRecord1
  			, const string& TxtRecord2
  			, const string& Trs
  			, const string& TxtShowing1
  			, const string& TxtShowing2
  			, const string& TcoFix
  			, const string& TcoSrf
  			, const string& TcoAvl
  			, const string& TcoImp
  			, const string& TcoTit
  			, const string& TcoCmt
  		) :
  			Block()
  		{
  	this->Cpt = Cpt;
  	this->TxtRecord1 = TxtRecord1;
  	this->TxtRecord2 = TxtRecord2;
  	this->Trs = Trs;
  	this->TxtShowing1 = TxtShowing1;
  	this->TxtShowing2 = TxtShowing2;
  	this->TcoFix = TcoFix;
  	this->TcoSrf = TcoSrf;
  	this->TcoAvl = TcoAvl;
  	this->TcoImp = TcoImp;
  	this->TcoTit = TcoTit;
  	this->TcoCmt = TcoCmt;
  
  	mask = {CPT, TXTRECORD1, TXTRECORD2, TRS, TXTSHOWING1, TXTSHOWING2, TCOFIX, TCOSRF, TCOAVL, TCOIMP, TCOTIT, TCOCMT};
  };
  
  bool PnlWznmCtpKParKey::Tag::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "TagWznmCtpKParKey");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	string itemtag = "TagitemWznmCtpKParKey";
  
  	if (basefound) {
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "Cpt", Cpt)) add(CPT);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtRecord1", TxtRecord1)) add(TXTRECORD1);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtRecord2", TxtRecord2)) add(TXTRECORD2);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "Trs", Trs)) add(TRS);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtShowing1", TxtShowing1)) add(TXTSHOWING1);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TxtShowing2", TxtShowing2)) add(TXTSHOWING2);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoFix", TcoFix)) add(TCOFIX);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoSrf", TcoSrf)) add(TCOSRF);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoAvl", TcoAvl)) add(TCOAVL);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoImp", TcoImp)) add(TCOIMP);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoTit", TcoTit)) add(TCOTIT);
  		if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ti", "sref", "TcoCmt", TcoCmt)) add(TCOCMT);
  	};
  
  	return basefound;
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::DpchAppData
   ******************************************************************************/
  
  PnlWznmCtpKParKey::DpchAppData::DpchAppData(
  			const string& scrJref
  			, StgIac* stgiac
  			, QryWznmCtpKParKey::StgIac* stgiacqry
  			, const set<uint>& mask
  		) :
  			DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMCTPKPARKEYDATA, scrJref)
  		{
  	if (find(mask, ALL)) this->mask = {SCRJREF, STGIAC, STGIACQRY};
  	else this->mask = mask;
  
  		if (find(this->mask, STGIAC) && stgiac) this->stgiac = *stgiac;
  		if (find(this->mask, STGIACQRY) && stgiacqry) this->stgiacqry = *stgiacqry;
  };
  
  string PnlWznmCtpKParKey::DpchAppData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(STGIAC)) ss.push_back("stgiac");
  	if (has(STGIACQRY)) ss.push_back("stgiacqry");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void PnlWznmCtpKParKey::DpchAppData::writeXML(
  			xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchAppWznmCtpKParKeyData");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm");
  		if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
  		if (has(STGIAC)) stgiac.writeXML(wr);
  		if (has(STGIACQRY)) stgiacqry.writeXML(wr);
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::DpchAppDo
   ******************************************************************************/
  
  PnlWznmCtpKParKey::DpchAppDo::DpchAppDo(
  			const string& scrJref
  			, const uint ixVDo
  			, const set<uint>& mask
  		) :
  			DpchAppWznm(VecWznmVDpch::DPCHAPPWZNMCTPKPARKEYDO, scrJref)
  		{
  	if (find(mask, ALL)) this->mask = {SCRJREF, IXVDO};
  	else this->mask = mask;
  
  	this->ixVDo = ixVDo;
  };
  
  string PnlWznmCtpKParKey::DpchAppDo::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(IXVDO)) ss.push_back("ixVDo");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void PnlWznmCtpKParKey::DpchAppDo::writeXML(
  			xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchAppWznmCtpKParKeyDo");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm");
  		if (has(SCRJREF)) writeString(wr, "scrJref", scrJref);
  		if (has(IXVDO)) writeString(wr, "srefIxVDo", VecVDo::getSref(ixVDo));
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class PnlWznmCtpKParKey::DpchEngData
   ******************************************************************************/
  
  PnlWznmCtpKParKey::DpchEngData::DpchEngData() :
  			DpchEngWznm(VecWznmVDpch::DPCHENGWZNMCTPKPARKEYDATA)
  		{
  	feedFCsiQst.tag = "FeedFCsiQst";
  };
  
  string PnlWznmCtpKParKey::DpchEngData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(SCRJREF)) ss.push_back("scrJref");
  	if (has(CONTINF)) ss.push_back("continf");
  	if (has(FEEDFCSIQST)) ss.push_back("feedFCsiQst");
  	if (has(STATAPP)) ss.push_back("statapp");
  	if (has(STATSHR)) ss.push_back("statshr");
  	if (has(STGIAC)) ss.push_back("stgiac");
  	if (has(TAG)) ss.push_back("tag");
  	if (has(RST)) ss.push_back("rst");
  	if (has(STATAPPQRY)) ss.push_back("statappqry");
  	if (has(STATSHRQRY)) ss.push_back("statshrqry");
  	if (has(STGIACQRY)) ss.push_back("stgiacqry");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void PnlWznmCtpKParKey::DpchEngData::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchEngWznmCtpKParKeyData");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	if (basefound) {
  		if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) add(SCRJREF);
  		if (continf.readXML(docctx, basexpath, true)) add(CONTINF);
  		if (feedFCsiQst.readXML(docctx, basexpath, true)) add(FEEDFCSIQST);
  		if (statapp.readXML(docctx, basexpath, true)) add(STATAPP);
  		if (statshr.readXML(docctx, basexpath, true)) add(STATSHR);
  		if (stgiac.readXML(docctx, basexpath, true)) add(STGIAC);
  		if (tag.readXML(docctx, basexpath, true)) add(TAG);
  		if (rst.readXML(docctx, basexpath, true)) add(RST);
  		if (statappqry.readXML(docctx, basexpath, true)) add(STATAPPQRY);
  		if (statshrqry.readXML(docctx, basexpath, true)) add(STATSHRQRY);
  		if (stgiacqry.readXML(docctx, basexpath, true)) add(STGIACQRY);
  	} else {
  		continf = ContInf();
  		feedFCsiQst.clear();
  		statapp = StatApp();
  		statshr = StatShr();
  		stgiac = StgIac();
  		tag = Tag();
  		rst.clear();
  		statappqry = QryWznmCtpKParKey::StatApp();
  		statshrqry = QryWznmCtpKParKey::StatShr();
  		stgiacqry = QryWznmCtpKParKey::StgIac();
  	};
  };
  