eui.d.ts 462 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035
  1. declare namespace eui.sys {
  2. /**
  3. * @private
  4. * 失效验证管理器
  5. */
  6. class Validator extends egret.EventDispatcher {
  7. /**
  8. * @private
  9. * 创建一个Validator对象
  10. */
  11. constructor();
  12. /**
  13. * @private
  14. */
  15. private targetLevel;
  16. /**
  17. * @private
  18. */
  19. private invalidatePropertiesFlag;
  20. /**
  21. * @private
  22. */
  23. private invalidateClientPropertiesFlag;
  24. /**
  25. * @private
  26. */
  27. private invalidatePropertiesQueue;
  28. /**
  29. * @private
  30. * 标记组件属性失效
  31. */
  32. invalidateProperties(client: UIComponent): void;
  33. /**
  34. * @private
  35. * 验证失效的属性
  36. */
  37. private validateProperties();
  38. /**
  39. * @private
  40. */
  41. private invalidateSizeFlag;
  42. /**
  43. * @private
  44. */
  45. private invalidateClientSizeFlag;
  46. /**
  47. * @private
  48. */
  49. private invalidateSizeQueue;
  50. /**
  51. * @private
  52. * 标记需要重新测量尺寸
  53. */
  54. invalidateSize(client: UIComponent): void;
  55. /**
  56. * @private
  57. * 测量尺寸
  58. */
  59. private validateSize();
  60. /**
  61. * @private
  62. */
  63. private invalidateDisplayListFlag;
  64. /**
  65. * @private
  66. */
  67. private invalidateDisplayListQueue;
  68. /**
  69. * @private
  70. * 标记需要重新布局
  71. */
  72. invalidateDisplayList(client: UIComponent): void;
  73. /**
  74. * @private
  75. * 重新布局
  76. */
  77. private validateDisplayList();
  78. /**
  79. * @private
  80. */
  81. private eventDisplay;
  82. /**
  83. * @private
  84. * 是否已经添加了事件监听
  85. */
  86. private listenersAttached;
  87. /**
  88. * @private
  89. * 添加事件监听
  90. */
  91. private attachListeners();
  92. /**
  93. * @private
  94. * 执行属性应用
  95. */
  96. private doPhasedInstantiationCallBack(event?);
  97. /**
  98. * @private
  99. *
  100. */
  101. private doPhasedInstantiation();
  102. /**
  103. * @private
  104. * 使大于等于指定组件层级的元素立即应用属性
  105. * @param target 要立即应用属性的组件
  106. */
  107. validateClient(target: UIComponent): void;
  108. }
  109. }
  110. declare namespace eui {
  111. /**
  112. * Register a property for a class definition in running,
  113. * so that the EUI can get type of property accurate when parsing a EXML.
  114. * This need not be called directly in most of time. Only when you have a custom UI
  115. * component need to be described in EXML, you may invoke this method explicitly.
  116. *
  117. * Contains no following:
  118. * When the property is the basic data type(boolean, number, string or Array), you only need set a correct initial value
  119. * for he custom property then the EXML parser can get the correct property type in running.
  120. *
  121. * If you can not set the correct initial value (such as <code>null</code>), the EXML parser will treat this property as
  122. * <code>string</code>. If there is no inital value, EUI will throw an error. But you can invoked this method to register
  123. * a property in this case.
  124. *
  125. *
  126. * @param classDefinition The class definition need to be registered.
  127. * @param property The property need to be registered. Note that the property
  128. * name cannot start with "_" or "$".
  129. * @param type The type need to be registered,
  130. * such as “boolean","number","string","Array","egret.Rectangle" and so on.
  131. * @param asDefault Whether register this property as a default property of component.
  132. * One component can register only on default property. And the default property can be spare in an EXML.
  133. *
  134. * @example:
  135. * <pre>
  136. * <s:Scroller>
  137. * <s:viewport>
  138. * <s:Group/>
  139. * </e:viewport>
  140. * </e:Scroller>
  141. * </pre>
  142. * Cuz <code>viewport</code> is the default property of Scroller. So you can write as follow:
  143. * <pre>
  144. * <s:Scroller>
  145. * <s:Group/>
  146. * </e:Scroller>
  147. * </pre>
  148. * @version Egret 2.4
  149. * @version eui 1.0
  150. * @platform Web,Native
  151. * @language en_US
  152. */
  153. /**
  154. * 为一个类定义注册运行时属性类型,以便运行时的EXML文件解析过程能获取准确的属性类型。大多数情况下,您都不需要手动调用此方法显式注册属性类型。
  155. * 仅当您有一个自定义的 UI 组件,需要在EXML中用标签描述时可能需要显式注册,但以下情况除外:
  156. * 当属性类型为基本数据类型:boolean,number,string,Array这四种其中之一时,您只需要为自定义的属性赋值上正确的初始值,
  157. * 运行时EXML解析器就能通过初始值自动分析出正确的属性类型。
  158. * 若您无法为属性赋值上正确的初始值时(有初始值,比如null),运行时EXML解析器会把此属性当做string来处理,若完全没有初始值,将会报错找不到节点属性,
  159. * 这种情况下可以手动调用此方法显式注册属性类型。
  160. *
  161. * @param classDefinition 要注册的类定义。
  162. * @param property 要注册的属性,注意属性名不能以 _ 或 $ 符开头。
  163. * @param type 要注册的类型,例如:“boolean","number","string","Array","egret.Rectangle"
  164. * @param asDefault 是否将此属性注册为组件的默认属性,一个组件只可以设置一个默认属性。注册了组件默认属性后,在EXML中可以使用省略属性节点的写法,
  165. * @example:
  166. * <pre>
  167. * <s:Scroller>
  168. * <s:viewport>
  169. * <s:Group/>
  170. * </e:viewport>
  171. * </e:Scroller>
  172. * </pre>
  173. * 因为 viewport 已经注册为 Scroller 的默认属性,上面的例子可以等效为:
  174. * <pre>
  175. * <s:Scroller>
  176. * <s:Group/>
  177. * </e:Scroller>
  178. * </pre>
  179. * @version Egret 2.4
  180. * @version eui 1.0
  181. * @platform Web,Native
  182. * @language zh_CN
  183. */
  184. function registerProperty(classDefinition: any, property: string, type: string, asDefault?: boolean): void;
  185. }
  186. declare namespace eui {
  187. /**
  188. * The State class defines a view state, a particular view of a component.
  189. *
  190. * For example, a product thumbnail could have two view states;
  191. * a base view state with minimal information, and a rich view state with
  192. * additional information.
  193. *
  194. * @version Egret 2.4
  195. * @version eui 1.0
  196. * @platform Web,Native
  197. * @language en_US
  198. */
  199. /**
  200. * State 类定义视图状态,即组件的特定视图。
  201. *
  202. * 例如,产品缩略图可以有两个视图状态,包含最少信息的基本视图状态和包含附加信息的丰富视图状态。
  203. *
  204. * @version Egret 2.4
  205. * @version eui 1.0
  206. * @platform Web,Native
  207. * @language zh_CN
  208. */
  209. class State extends egret.HashObject {
  210. /**
  211. * Constructor.
  212. *
  213. * @param name The name of the view state.
  214. * State names must be unique for a given component.
  215. * This property must be set.
  216. * @param overrides The overrides for this view state, as an Array of objects that implement
  217. * the IOverride interface. These overrides are applied in order when the
  218. * state is entered, and removed in reverse order when the state is exited.
  219. *
  220. * @version Egret 2.4
  221. * @version eui 1.0
  222. * @platform Web,Native
  223. * @language en_US
  224. */
  225. /**
  226. * 创建一个State实例。
  227. *
  228. * @param name 视图状态的名称。给定组件的状态名称必须唯一。必须设置此属性。
  229. * @param overrides 该视图状态的覆盖,表现为实现 IOverride 接口的对象的数组。
  230. * 这些覆盖在进入状态时按顺序应用,在退出状态时按相反的顺序删除。
  231. *
  232. * @version Egret 2.4
  233. * @version eui 1.0
  234. * @platform Web,Native
  235. * @language zh_CN
  236. */
  237. constructor(name: string, overrides?: IOverride[]);
  238. /**
  239. * The name of the view state.
  240. * State names must be unique for a given component.
  241. * This property must be set.
  242. *
  243. * @version Egret 2.4
  244. * @version eui 1.0
  245. * @platform Web,Native
  246. * @language en_US
  247. */
  248. /**
  249. * 视图状态的名称。给定组件的状态名称必须唯一。必须设置此属性。
  250. *
  251. * @version Egret 2.4
  252. * @version eui 1.0
  253. * @platform Web,Native
  254. * @language zh_CN
  255. */
  256. name: string;
  257. /**
  258. * The overrides for this view state, as an Array of objects that implement
  259. * the IOverride interface. These overrides are applied in order when the
  260. * state is entered, and removed in reverse order when the state is exited.
  261. *
  262. * @version Egret 2.4
  263. * @version eui 1.0
  264. * @platform Web,Native
  265. * @language en_US
  266. */
  267. /**
  268. * 该视图状态的覆盖,表现为实现 IOverride 接口的对象的数组。
  269. * 这些覆盖在进入状态时按顺序应用,在退出状态时按相反的顺序删除。
  270. * @version Egret 2.4
  271. * @version eui 1.0
  272. * @platform Web,Native
  273. * @language zh_CN
  274. */
  275. overrides: IOverride[];
  276. /**
  277. * The state groups that this view state belongs to as an array of String.
  278. * @version Egret 2.4
  279. * @version eui 1.0
  280. * @platform Web,Native
  281. * @language en_US
  282. */
  283. /**
  284. * 此视图状态作为 string 数组所属的状态组。
  285. * @version Egret 2.4
  286. * @version eui 1.0
  287. * @platform Web,Native
  288. * @language zh_CN
  289. */
  290. stateGroups: string[];
  291. /**
  292. * Initialize this state and all of its overrides.
  293. * @version Egret 2.4
  294. * @version eui 1.0
  295. * @platform Web,Native
  296. * @language en_US
  297. */
  298. /**
  299. * 初始化视图状态
  300. * @version Egret 2.4
  301. * @version eui 1.0
  302. * @platform Web,Native
  303. * @language zh_CN
  304. */
  305. initialize(host: any, stage: egret.Stage): void;
  306. }
  307. }
  308. declare namespace eui.sys {
  309. /**
  310. * @private
  311. */
  312. class StateClient {
  313. /**
  314. * @private
  315. */
  316. $stateValues: StateValues;
  317. /**
  318. * @private
  319. * 为此组件定义的视图状态。
  320. */
  321. states: eui.State[];
  322. /**
  323. * @private
  324. * 组件的当前视图状态。将其设置为 "" 或 null 可将组件重置回其基本状态。
  325. */
  326. currentState: string;
  327. /**
  328. * @private
  329. * 应用当前的视图状态。子类覆盖此方法在视图状态发生改变时执行相应更新操作。
  330. */
  331. private commitCurrentState();
  332. /**
  333. * @private
  334. * 返回是否含有指定名称的视图状态
  335. * @param stateName 要检查的视图状态名称
  336. */
  337. hasState(stateName: string): boolean;
  338. /**
  339. * @private
  340. * 初始化所有视图状态
  341. */
  342. private initializeStates(stage);
  343. }
  344. /**
  345. * @private
  346. */
  347. class StateValues {
  348. /**
  349. * @private
  350. */
  351. intialized: boolean;
  352. /**
  353. * @private
  354. */
  355. statesMap: any;
  356. /**
  357. * @private
  358. */
  359. states: eui.State[];
  360. /**
  361. * @private
  362. */
  363. oldState: string;
  364. /**
  365. * @private
  366. */
  367. explicitState: string;
  368. /**
  369. * @private
  370. */
  371. currentState: string;
  372. /**
  373. * @private
  374. */
  375. parent: egret.DisplayObjectContainer;
  376. /**
  377. * @private
  378. */
  379. stateIsDirty: boolean;
  380. }
  381. }
  382. declare namespace eui {
  383. function getAssets(source: string, callback: (content: any) => void, thisObject: any): void;
  384. function getTheme(source: string, callback: (content: any) => void): void;
  385. /**
  386. * The UIComponent class is the base class for all visual components, both skinnable and nonskinnable.
  387. *
  388. * @event egret.Event.RESIZE Dispatch when the component is resized.
  389. * @event eui.UIEvent.MOVE Dispatch when the object has moved.
  390. * @event eui.UIEvent.CREATION_COMPLETE Dispatch when the component has finished its construction,
  391. * property processing, measuring, layout, and drawing.
  392. *
  393. * @version Egret 2.4
  394. * @version eui 1.0
  395. * @platform Web,Native
  396. * @language en_US
  397. */
  398. /**
  399. * UIComponent 类是所有可视组件(可定制皮肤和不可定制皮肤)的基类。
  400. *
  401. * @event egret.Event.RESIZE 当UI组件的尺寸发生改变时调度
  402. * @event eui.UIEvent.MOVE 当UI组件在父级容器中的位置发生改变时调度
  403. * @event eui.UIEvent.CREATION_COMPLETE 当UI组件第一次被添加到舞台并完成初始化后调度
  404. *
  405. * @version Egret 2.4
  406. * @version eui 1.0
  407. * @platform Web,Native
  408. * @language zh_CN
  409. */
  410. interface UIComponent extends egret.DisplayObject {
  411. /**
  412. * @private
  413. */
  414. $UIComponent: Object;
  415. /**
  416. * @private
  417. */
  418. $includeInLayout: boolean;
  419. /**
  420. * Specifies whether this component is included in the layout of the
  421. * parent container.
  422. * If <code>false</code>, the object size and position are not affected by its parent container's
  423. * layout.
  424. * This value is different with <code>visible</code>. the object size and position is still affected by its parent
  425. * container's layout when the <code>visible</code> is false.
  426. * @default true
  427. *
  428. * @version Egret 2.4
  429. * @version eui 1.0
  430. * @platform Web,Native
  431. * @language en_US
  432. */
  433. /**
  434. * 指定此组件是否包含在父容器的布局中。若为false,则父级容器在测量和布局阶段都忽略此组件。
  435. * 注意,visible属性与此属性不同,设置visible为false,父级容器仍会对其布局。
  436. *
  437. * @default true
  438. *
  439. * @version Egret 2.4
  440. * @version eui 1.0
  441. * @platform Web,Native
  442. * @language zh_CN
  443. */
  444. includeInLayout: boolean;
  445. /**
  446. * The horizontal distance in pixels from the left edge of the component to the
  447. * anchor target's left edge.
  448. *
  449. * @default NaN
  450. *
  451. * @version Egret 2.4
  452. * @version eui 1.0
  453. * @platform Web,Native
  454. * @language en_US
  455. */
  456. /**
  457. * 距父级容器离左边距离。
  458. *
  459. * @default NaN
  460. *
  461. * @version Egret 2.4
  462. * @version eui 1.0
  463. * @platform Web,Native
  464. * @language zh_CN
  465. */
  466. left: any;
  467. /**
  468. * The horizontal distance in pixels from the right edge of the component to the
  469. * anchor target's right edge.
  470. *
  471. * @default NaN
  472. *
  473. * @version Egret 2.4
  474. * @version eui 1.0
  475. * @platform Web,Native
  476. * @language en_US
  477. */
  478. /**
  479. * 距父级容器右边距离。
  480. *
  481. * @default NaN
  482. *
  483. * @version Egret 2.4
  484. * @version eui 1.0
  485. * @platform Web,Native
  486. * @language zh_CN
  487. */
  488. right: any;
  489. /**
  490. * The vertical distance in pixels from the top edge of the component to the
  491. * anchor target's top edge.
  492. *
  493. * @default NaN
  494. *
  495. * @version Egret 2.4
  496. * @version eui 1.0
  497. * @platform Web,Native
  498. * @language en_US
  499. */
  500. /**
  501. * 距父级容器顶部距离。
  502. *
  503. * @default NaN
  504. *
  505. * @version Egret 2.4
  506. * @version eui 1.0
  507. * @platform Web,Native
  508. * @language zh_CN
  509. */
  510. top: any;
  511. /**
  512. * The vertical distance in pixels from the bottom edge of the component to the
  513. * anchor target's bottom edge.
  514. *
  515. * @default NaN
  516. *
  517. * @version Egret 2.4
  518. * @version eui 1.0
  519. * @platform Web,Native
  520. * @language en_US
  521. */
  522. /**
  523. * 距父级容器底部距离。
  524. *
  525. * @default NaN
  526. *
  527. * @version Egret 2.4
  528. * @version eui 1.0
  529. * @platform Web,Native
  530. * @language zh_CN
  531. */
  532. bottom: any;
  533. /**
  534. * The horizontal distance in pixels from the center of the component to the
  535. * center of the anchor target's content area.
  536. *
  537. * @default NaN
  538. *
  539. * @version Egret 2.4
  540. * @version eui 1.0
  541. * @platform Web,Native
  542. * @language en_US
  543. */
  544. /**
  545. * 在父级容器中距水平中心位置的距离。
  546. *
  547. * @default NaN
  548. *
  549. * @version Egret 2.4
  550. * @version eui 1.0
  551. * @platform Web,Native
  552. * @language zh_CN
  553. */
  554. horizontalCenter: any;
  555. /**
  556. * The vertical distance in pixels from the center of the component to the
  557. * center of the anchor target's content area.
  558. *
  559. * @default NaN
  560. *
  561. * @version Egret 2.4
  562. * @version eui 1.0
  563. * @platform Web,Native
  564. * @language en_US
  565. */
  566. /**
  567. * 在父级容器中距竖直中心位置的距离。
  568. *
  569. * @default NaN
  570. *
  571. * @version Egret 2.4
  572. * @version eui 1.0
  573. * @platform Web,Native
  574. * @language zh_CN
  575. */
  576. verticalCenter: any;
  577. /**
  578. * Specifies the width of a component as a percentage
  579. * of its parent's size. Allowed values are 0-100.
  580. * Setting the <code>width</code> or <code>explicitWidth</code> properties
  581. * resets this property to NaN.
  582. *
  583. * @default NaN
  584. *
  585. * @version Egret 2.4
  586. * @version eui 1.0
  587. * @platform Web,Native
  588. * @language en_US
  589. */
  590. /**
  591. * 相对父级容器宽度的百分比。
  592. *
  593. * @default NaN
  594. *
  595. * @version Egret 2.4
  596. * @version eui 1.0
  597. * @platform Web,Native
  598. * @language zh_CN
  599. */
  600. percentWidth: number;
  601. /**
  602. * Specifies the height of a component as a percentage
  603. * of its parent's size. Allowed values are 0-100.
  604. * Setting the <code>height</code> or <code>explicitHeight</code> properties
  605. * resets this property to NaN.
  606. *
  607. * @default NaN
  608. *
  609. * @version Egret 2.4
  610. * @version eui 1.0
  611. * @platform Web,Native
  612. * @language en_US
  613. */
  614. /**
  615. * 相对父级容器高度的百分比。
  616. *
  617. * @default NaN
  618. *
  619. * @version Egret 2.4
  620. * @version eui 1.0
  621. * @platform Web,Native
  622. * @language zh_CN
  623. */
  624. percentHeight: number;
  625. /**
  626. * Number that specifies the explicit width of the component,
  627. * in pixels, in the component's coordinates.
  628. * @readOnly
  629. * @version Egret 2.4
  630. * @version eui 1.0
  631. * @platform Web,Native
  632. * @language en_US
  633. */
  634. /**
  635. * 外部显式指定的宽度。
  636. * @readOnly
  637. * @version Egret 2.4
  638. * @version eui 1.0
  639. * @platform Web,Native
  640. * @language zh_CN
  641. */
  642. readonly explicitWidth: number;
  643. /**
  644. * Number that specifies the explicit height of the component,
  645. * in pixels, in the component's coordinates.
  646. * @readOnly
  647. * @version Egret 2.4
  648. * @version eui 1.0
  649. * @platform Web,Native
  650. * @language en_US
  651. */
  652. /**
  653. * 外部显式指定的高度。
  654. * @readOnly
  655. * @version Egret 2.4
  656. * @version eui 1.0
  657. * @platform Web,Native
  658. * @language zh_CN
  659. */
  660. readonly explicitHeight: number;
  661. /**
  662. * The minimum recommended width of the component to be considered
  663. * by the parent during layout. This value is in the
  664. * component's coordinates, in pixels. The default value depends on
  665. * the component's implementation.
  666. * @readOnly
  667. * @version Egret 2.4
  668. * @version eui 1.0
  669. * @platform Web,Native
  670. * @language en_US
  671. */
  672. /**
  673. * 组件的最小宽度,此属性设置为大于maxWidth的值时无效。同时影响测量和自动布局的尺寸。
  674. * @readOnly
  675. * @version Egret 2.4
  676. * @version eui 1.0
  677. * @platform Web,Native
  678. * @language zh_CN
  679. */
  680. minWidth: number;
  681. /**
  682. * The maximum recommended width of the component to be considered
  683. * by the parent during layout. This value is in the
  684. * component's coordinates, in pixels. The default value of this property is
  685. * set by the component developer.
  686. * @version Egret 2.4
  687. * @version eui 1.0
  688. * @platform Web,Native
  689. * @language en_US
  690. */
  691. /**
  692. * 组件的最大高度。同时影响测量和自动布局的尺寸。
  693. * @version Egret 2.4
  694. * @version eui 1.0
  695. * @platform Web,Native
  696. * @language zh_CN
  697. */
  698. maxWidth: number;
  699. /**
  700. * The minimum recommended height of the component to be considered
  701. * by the parent during layout. This value is in the
  702. * component's coordinates, in pixels. The default value depends on
  703. * the component's implementation.
  704. * @version Egret 2.4
  705. * @version eui 1.0
  706. * @platform Web,Native
  707. * @language en_US
  708. */
  709. /**
  710. * 组件的最小高度,此属性设置为大于maxHeight的值时无效。同时影响测量和自动布局的尺寸。
  711. * @version Egret 2.4
  712. * @version eui 1.0
  713. * @platform Web,Native
  714. * @language zh_CN
  715. */
  716. minHeight: number;
  717. /**
  718. * The maximum recommended height of the component to be considered
  719. * by the parent during layout. This value is in the
  720. * component's coordinates, in pixels. The default value of this property is
  721. * set by the component developer.
  722. * @version Egret 2.4
  723. * @version eui 1.0
  724. * @platform Web,Native
  725. * @language en_US
  726. */
  727. /**
  728. * 组件的最大高度,同时影响测量和自动布局的尺寸。
  729. * @version Egret 2.4
  730. * @version eui 1.0
  731. * @platform Web,Native
  732. * @language zh_CN
  733. */
  734. maxHeight: number;
  735. /**
  736. * Set the result of measuring.
  737. * @param width measured width
  738. * @param height measured height
  739. * @version Egret 2.4
  740. * @version eui 1.0
  741. * @platform Web,Native
  742. * @language en_US
  743. */
  744. /**
  745. * 设置测量结果。
  746. * @param width 测量宽度
  747. * @param height 测量高度
  748. * @version Egret 2.4
  749. * @version eui 1.0
  750. * @platform Web,Native
  751. * @language zh_CN
  752. */
  753. setMeasuredSize(width: number, height: number): void;
  754. /**
  755. * Marks a component so that its <code>commitProperties()</code>
  756. * method gets called during a later screen update.<p/>
  757. *
  758. * Invalidation is a useful mechanism for eliminating duplicate
  759. * work by delaying processing of changes to a component until a
  760. * later screen update.<p/>
  761. *
  762. * For example, if you want to change the text color and size,
  763. * it would be wasteful to update the color immediately after you
  764. * change it and then update the size when it gets set.
  765. * It is more efficient to change both properties and then render
  766. * the text with its new size and color once.<p/>
  767. *
  768. * Invalidation methods rarely get called.
  769. * In general, setting a property on a component automatically
  770. * calls the appropriate invalidation method.
  771. *
  772. * @version Egret 2.4
  773. * @version eui 1.0
  774. * @platform Web,Native
  775. * @language en_US
  776. */
  777. /**
  778. * 标记提交过需要延迟应用的属性,以便在稍后屏幕更新期间调用该组件的 commitProperties() 方法。<p/>
  779. *
  780. * 这是一个很有用的机制,可将组件更改延迟到稍后屏幕更新时进行处理,从而消除了重复的工作。<p/>
  781. *
  782. * 例如,要更改文本颜色和大小,如果在更改颜色后立即进行更新,然后在设置大小后再更新大小,就有些浪费。
  783. * 同时更改两个属性后再使用新的大小和颜色一次性呈示文本,效率会更高。<p/>
  784. *
  785. * 很少调用 Invalidation 方法。通常,在组件上设置属性会自动调用合适的 invalidation 方法。
  786. * @version Egret 2.4
  787. * @version eui 1.0
  788. * @platform Web,Native
  789. * @language zh_CN
  790. */
  791. invalidateProperties(): void;
  792. /**
  793. * Used by layout logic to validate the properties of a component
  794. * by calling the <code>commitProperties()</code> method.
  795. * In general, subclassers should
  796. * override the <code>commitProperties()</code> method and not this method.
  797. * @version Egret 2.4
  798. * @version eui 1.0
  799. * @platform Web,Native
  800. * @language en_US
  801. */
  802. /**
  803. * 由布局逻辑用于通过调用 commitProperties() 方法来验证组件的属性。
  804. * 通常,子类应覆盖 commitProperties() 方法,而不是覆盖此方法。
  805. * @version Egret 2.4
  806. * @version eui 1.0
  807. * @platform Web,Native
  808. * @language zh_CN
  809. */
  810. validateProperties(): void;
  811. /**
  812. * Marks a component so that its <code>measure()</code>
  813. * method gets called during a later screen update.<p/>
  814. *
  815. * Invalidation is a useful mechanism for eliminating duplicate
  816. * work by delaying processing of changes to a component until a
  817. * later screen update.<p/>
  818. *
  819. * For example, if you want to change the text and font size,
  820. * it would be wasteful to update the text immediately after you
  821. * change it and then update the size when it gets set.
  822. * It is more efficient to change both properties and then render
  823. * the text with its new size once.<p/>
  824. *
  825. * Invalidation methods rarely get called.
  826. * In general, setting a property on a component automatically
  827. * calls the appropriate invalidation method.
  828. *
  829. * @version Egret 2.4
  830. * @version eui 1.0
  831. * @platform Web,Native
  832. * @language en_US
  833. */
  834. /**
  835. * 标记提交过需要验证组件尺寸,以便在稍后屏幕更新期间调用该组件的 measure() 方法。<p/>
  836. *
  837. * Invalidation 是一个很有用的机制,可将组件更改延迟到稍后屏幕更新时进行处理,从而消除了重复的工作。<p/>
  838. *
  839. * 例如,要更改文本和字体大小,如果在更改文本后立即进行更新,然后在设置大小后再更新大小,就有些浪费。
  840. * 更改两个属性后再使用新的大小一次性呈示文本,效率会更高。<p/>
  841. *
  842. * 很少调用 Invalidation 方法。通常,在组件上设置属性会自动调用合适的 invalidation 方法。
  843. *
  844. * @version Egret 2.4
  845. * @version eui 1.0
  846. * @platform Web,Native
  847. * @language zh_CN
  848. */
  849. invalidateSize(): void;
  850. /**
  851. * Validates the measured size of the component.
  852. * @param recursive If <code>true</code>, call this method
  853. * on the objects children.
  854. * @version Egret 2.4
  855. * @version eui 1.0
  856. * @platform Web,Native
  857. * @language en_US
  858. */
  859. /**
  860. * 验证组件的尺寸。
  861. * @param recursive 如果为 true,则调用对象子项的此方法。
  862. * @version Egret 2.4
  863. * @version eui 1.0
  864. * @platform Web,Native
  865. * @language zh_CN
  866. */
  867. validateSize(recursive?: boolean): void;
  868. /**
  869. * Marks a component so that its <code>updateDisplayList()</code>
  870. * method gets called during a later screen update.<p/>
  871. *
  872. * Invalidation is a useful mechanism for eliminating duplicate
  873. * work by delaying processing of changes to a component until a
  874. * later screen update.<p/>
  875. *
  876. * For example, if you want to change the width and height,
  877. * it would be wasteful to update the component immediately after you
  878. * change the width and then update again with the new height.
  879. * It is more efficient to change both properties and then render
  880. * the component with its new size once.<p/>
  881. *
  882. * Invalidation methods rarely get called.
  883. * In general, setting a property on a component automatically
  884. * calls the appropriate invalidation method.
  885. *
  886. * @version Egret 2.4
  887. * @version eui 1.0
  888. * @platform Web,Native
  889. * @language en_US
  890. */
  891. /**
  892. * 标记需要验证显示列表,以便在稍后屏幕更新期间调用该组件的 updateDisplayList() 方法。<p/>
  893. *
  894. * Invalidation 是一个很有用的机制,可将组件更改延迟到稍后屏幕更新时进行处理,从而消除了重复的工作。<p/>
  895. *
  896. * 例如,要更改宽度和高度,如果在更改宽度后立即更新组件,然后在设置新高度后再次更新组件,就有些浪费。
  897. * 更改两个属性后再使用新的大小一次性呈示组件,效率会更高。<p/>
  898. *
  899. * 很少调用 Invalidation 方法。通常,在组件上设置属性会自动调用合适的 invalidation 方法。
  900. *
  901. * @version Egret 2.4
  902. * @version eui 1.0
  903. * @platform Web,Native
  904. * @language zh_CN
  905. */
  906. invalidateDisplayList(): void;
  907. /**
  908. * Validates the position and size of children and draws other
  909. * visuals.
  910. * @version Egret 2.4
  911. * @version eui 1.0
  912. * @platform Web,Native
  913. * @language en_US
  914. */
  915. /**
  916. * 验证子项的位置和大小,并绘制其他可视内容。
  917. * @version Egret 2.4
  918. * @version eui 1.0
  919. * @platform Web,Native
  920. * @language zh_CN
  921. */
  922. validateDisplayList(): void;
  923. /**
  924. * Validate and update the properties and layout of this object
  925. * and redraw it, if necessary.<p/>
  926. *
  927. * Processing properties that require substantial computation are normally
  928. * not processed until the script finishes executing.<p/>
  929. *
  930. * For example setting the <code>width</code> property is delayed, because it can
  931. * require recalculating the widths of the objects children or its parent.
  932. * Delaying the processing prevents it from being repeated
  933. * multiple times if the script sets the <code>width</code> property more than once.
  934. * This method lets you manually override this behavior.
  935. * @version Egret 2.4
  936. * @version eui 1.0
  937. * @platform Web,Native
  938. * @language en_US
  939. */
  940. /**
  941. * 验证并更新此对象的属性和布局,如果需要的话重绘对象。<p/>
  942. *
  943. * 通常只有当脚本执行完毕后,才会处理要求进行大量计算的处理属性。<p/>
  944. *
  945. * 例如,对 width 属性的设置可能会延迟,因为此设置需要重新计算这些对象的子项或父项的宽度。
  946. * 如果脚本多次设置了 width 属性,则延迟处理可防止进行多次处理。此方法允许您手动覆盖此行为。
  947. *
  948. * @version Egret 2.4
  949. * @version eui 1.0
  950. * @platform Web,Native
  951. * @language zh_CN
  952. */
  953. validateNow(): void;
  954. /**
  955. * Sets the layout size of the element.
  956. * This is the size that the element uses to draw on screen.<p/>
  957. *
  958. * If the <code>width</code> and/or <code>height</code> parameters are left unspecified (NaN),
  959. * EUI sets the element's layout size to its preferred width and/or preferred height.<p/>
  960. *
  961. * Note that calls to the <code>setLayoutBoundSize()</code> method can affect the layout position, so
  962. * call <code>setLayoutBoundPosition()</code> after calling <code>setLayoutBoundSize()</code>.<p/>
  963. *
  964. * @param layoutWidth The element's layout width.
  965. * @param layoutHeight The element's layout height.
  966. *
  967. * @version Egret 2.4
  968. * @version eui 1.0
  969. * @platform Web,Native
  970. * @language en_US
  971. */
  972. /**
  973. * 设置元素的布局大小。这是元素在屏幕上进行绘制时所用的大小。<p/>
  974. *
  975. * 如果 width 和/或 height 参数尚未指定 (NaN)),则 EUI 会将该元素的布局大小设置为首选宽度和/或首选高度。<p/>
  976. *
  977. * 请注意,调用 setLayoutBoundSize() 方法会影响布局位置,因此请在调用 setLayoutBoundSize()
  978. * 之后再调用 setLayoutBoundPosition()。
  979. *
  980. * @param layoutWidth 元素的布局宽度。
  981. * @param layoutHeight 元素的布局高度。
  982. *
  983. * @version Egret 2.4
  984. * @version eui 1.0
  985. * @platform Web,Native
  986. * @language zh_CN
  987. */
  988. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  989. /**
  990. * Sets the coordinates that the element uses to draw on screen.<p/>
  991. *
  992. * Note that calls to the <code>setLayoutBoundSize()</code> method can affect the layout position, so
  993. * call <code>setLayoutBoundPosition()</code> after calling <code>setLayoutBoundSize()</code>.<p/>
  994. *
  995. * @param x The x-coordinate of the top-left corner of the bounding box.
  996. * @param y The y-coordinate of the top-left corner of the bounding box.
  997. *
  998. * @version Egret 2.4
  999. * @version eui 1.0
  1000. * @platform Web,Native
  1001. * @language en_US
  1002. */
  1003. /**
  1004. * 设置元素在屏幕上进行绘制时所用的布局坐标。<p/>
  1005. *
  1006. * 请注意,调用 setLayoutBoundSize() 方法会影响布局位置,因此请在调用 setLayoutBoundSize()
  1007. * 之后再调用 setLayoutBoundPosition()。
  1008. *
  1009. * @param x 边框左上角的 X 坐标。
  1010. * @param y 边框左上角的 Y 坐标。
  1011. *
  1012. * @version Egret 2.4
  1013. * @version eui 1.0
  1014. * @platform Web,Native
  1015. * @language zh_CN
  1016. */
  1017. setLayoutBoundsPosition(x: number, y: number): void;
  1018. /**
  1019. * Get the layout bounds that the element uses to draw on screen.
  1020. * Commonly used in the <code>updateDisplayList()</code> method in parent container.<p/>
  1021. * Priority: layout > explicit > measure.<p/>
  1022. * The result of this method is contains <code>scale</code> and <code>rotation</code>.
  1023. *
  1024. * @param bounds the instance of <code>egret.Rectangle</code> can set result.
  1025. *
  1026. * @version Egret 2.4
  1027. * @version eui 1.0
  1028. * @platform Web,Native
  1029. * @language en_US
  1030. */
  1031. /**
  1032. * 组件的布局尺寸,常用于父级的<code>updateDisplayList()</code>方法中。<p/>
  1033. * 按照:布局尺寸>外部显式设置尺寸>测量尺寸 的优先级顺序返回尺寸。<p/>
  1034. * 注意此方法返回值已经包含scale和rotation。
  1035. *
  1036. * @param bounds 可以放置结果的<code>egret.Rectangle</code>实例。
  1037. *
  1038. * @version Egret 2.4
  1039. * @version eui 1.0
  1040. * @platform Web,Native
  1041. * @language zh_CN
  1042. */
  1043. getLayoutBounds(bounds: egret.Rectangle): void;
  1044. /**
  1045. * Get the element's preferred bounds。
  1046. * Commonly used in the <code>measure()</code> method in parent container.<p/>
  1047. * Priority: explicit > measure.<p/>
  1048. * The result of this method is contains <code>scale</code> and <code>rotation</code>.
  1049. *
  1050. * @param bounds the instance of <code>egret.Rectangle</code> can set result.
  1051. *
  1052. * @version Egret 2.4
  1053. * @version eui 1.0
  1054. * @platform Web,Native
  1055. * @language en_US
  1056. */
  1057. /**
  1058. * 获取组件的首选尺寸,常用于父级的<code>measure()</code>方法中。<p/>
  1059. * 按照:外部显式设置尺寸>测量尺寸 的优先级顺序返回尺寸。<p/>
  1060. * 注意此方法返回值已经包含scale和rotation。
  1061. *
  1062. * @param bounds 可以放置结果的<code>egret.Rectangle</code>实例。
  1063. *
  1064. * @version Egret 2.4
  1065. * @version eui 1.0
  1066. * @platform Web,Native
  1067. * @language zh_CN
  1068. */
  1069. getPreferredBounds(bounds: egret.Rectangle): void;
  1070. }
  1071. }
  1072. declare namespace eui.sys {
  1073. /**
  1074. * @private
  1075. */
  1076. const enum UIKeys {
  1077. left = 0,
  1078. right = 1,
  1079. top = 2,
  1080. bottom = 3,
  1081. horizontalCenter = 4,
  1082. verticalCenter = 5,
  1083. percentWidth = 6,
  1084. percentHeight = 7,
  1085. explicitWidth = 8,
  1086. explicitHeight = 9,
  1087. width = 10,
  1088. height = 11,
  1089. minWidth = 12,
  1090. maxWidth = 13,
  1091. minHeight = 14,
  1092. maxHeight = 15,
  1093. measuredWidth = 16,
  1094. measuredHeight = 17,
  1095. oldPreferWidth = 18,
  1096. oldPreferHeight = 19,
  1097. oldX = 20,
  1098. oldY = 21,
  1099. oldWidth = 22,
  1100. oldHeight = 23,
  1101. invalidatePropertiesFlag = 24,
  1102. invalidateSizeFlag = 25,
  1103. invalidateDisplayListFlag = 26,
  1104. layoutWidthExplicitlySet = 27,
  1105. layoutHeightExplicitlySet = 28,
  1106. initialized = 29,
  1107. }
  1108. /**
  1109. * @private
  1110. * EUI 显示对象基类模板。仅作为 UIComponent 的默认实现,为egret.sys.implemenetUIComponenet()方法提供代码模板。
  1111. * 注意:在此类里不允许直接使用super关键字访问父类方法。一律使用this.$super属性访问。
  1112. */
  1113. class UIComponentImpl extends egret.DisplayObject implements eui.UIComponent {
  1114. /**
  1115. * @private
  1116. * 构造函数
  1117. */
  1118. constructor();
  1119. /**
  1120. * @private
  1121. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  1122. */
  1123. private initializeUIValues();
  1124. /**
  1125. * @private
  1126. * 子类覆盖此方法可以执行一些初始化子项操作。此方法仅在组件第一次添加到舞台时回调一次。
  1127. * 请务必调用super.createChildren()以完成父类组件的初始化
  1128. */
  1129. protected createChildren(): void;
  1130. /**
  1131. * @private
  1132. * 子项创建完成,此方法在createChildren()之后执行。
  1133. */
  1134. protected childrenCreated(): void;
  1135. /**
  1136. * @private
  1137. * 提交属性,子类在调用完invalidateProperties()方法后,应覆盖此方法以应用属性
  1138. */
  1139. protected commitProperties(): void;
  1140. /**
  1141. * @private
  1142. * 测量组件尺寸
  1143. */
  1144. protected measure(): void;
  1145. /**
  1146. * @private
  1147. * 更新显示列表
  1148. */
  1149. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  1150. $super: any;
  1151. $UIComponent: Object;
  1152. $includeInLayout: boolean;
  1153. /**
  1154. * @private
  1155. * 指定此组件是否包含在父容器的布局中。若为false,则父级容器在测量和布局阶段都忽略此组件。默认值为true。
  1156. * 注意,visible属性与此属性不同,设置visible为false,父级容器仍会对其布局。
  1157. */
  1158. includeInLayout: boolean;
  1159. /**
  1160. * @private
  1161. *
  1162. * @param stage
  1163. * @param nestLevel
  1164. */
  1165. $onAddToStage(stage: egret.Stage, nestLevel: number): void;
  1166. /**
  1167. * @private
  1168. * 检查属性失效标记并应用
  1169. */
  1170. private checkInvalidateFlag(event?);
  1171. /**
  1172. * @private
  1173. * 距父级容器离左边距离
  1174. */
  1175. left: any;
  1176. /**
  1177. * @private
  1178. * 距父级容器右边距离
  1179. */
  1180. right: any;
  1181. /**
  1182. * @private
  1183. * 距父级容器顶部距离
  1184. */
  1185. top: any;
  1186. /**
  1187. * @private
  1188. * 距父级容器底部距离
  1189. */
  1190. bottom: any;
  1191. /**
  1192. * @private
  1193. * 在父级容器中距水平中心位置的距离
  1194. */
  1195. horizontalCenter: any;
  1196. /**
  1197. * @private
  1198. * 在父级容器中距竖直中心位置的距离
  1199. */
  1200. verticalCenter: any;
  1201. /**
  1202. * @private
  1203. * 相对父级容器宽度的百分比
  1204. */
  1205. percentWidth: number;
  1206. /**
  1207. * @private
  1208. * 相对父级容器高度的百分比
  1209. */
  1210. percentHeight: number;
  1211. /**
  1212. * @private
  1213. * 外部显式指定的宽度
  1214. */
  1215. readonly explicitWidth: number;
  1216. /**
  1217. * @private
  1218. * 外部显式指定的高度
  1219. */
  1220. readonly explicitHeight: number;
  1221. /**
  1222. * @private
  1223. * 组件宽度,默认值为egret.NaN,设置为NaN将使用组件的measure()方法自动计算尺寸
  1224. */
  1225. $getWidth(): number;
  1226. /**
  1227. * @private
  1228. *
  1229. * @param value
  1230. */
  1231. $setWidth(value: number): boolean;
  1232. /**
  1233. * @private
  1234. * 立即验证自身的尺寸。
  1235. */
  1236. private validateSizeNow();
  1237. /**
  1238. * @private
  1239. * 组件高度,默认值为NaN,设置为NaN将使用组件的measure()方法自动计算尺寸
  1240. */
  1241. $getHeight(): number;
  1242. /**
  1243. * @private
  1244. *
  1245. * @param value
  1246. */
  1247. $setHeight(value: number): boolean;
  1248. /**
  1249. * @private
  1250. * 组件的最小宽度,此属性设置为大于maxWidth的值时无效。同时影响测量和自动布局的尺寸。
  1251. */
  1252. minWidth: number;
  1253. /**
  1254. * @private
  1255. * 组件的最大高度。同时影响测量和自动布局的尺寸。
  1256. */
  1257. maxWidth: number;
  1258. /**
  1259. * @private
  1260. * 组件的最小高度,此属性设置为大于maxHeight的值时无效。同时影响测量和自动布局的尺寸。
  1261. */
  1262. minHeight: number;
  1263. /**
  1264. * @private
  1265. * 组件的最大高度,同时影响测量和自动布局的尺寸。
  1266. */
  1267. maxHeight: number;
  1268. /**
  1269. * @private
  1270. * 设置测量结果。
  1271. * @param width 测量宽度
  1272. * @param height 测量高度
  1273. */
  1274. setMeasuredSize(width: number, height: number): void;
  1275. /**
  1276. * @private
  1277. * 设置组件的宽高。此方法不同于直接设置width,height属性,
  1278. * 不会影响显式标记尺寸属性
  1279. */
  1280. private setActualSize(w, h);
  1281. /**
  1282. * @private
  1283. */
  1284. protected $updateUseTransform(): void;
  1285. /**
  1286. * @private
  1287. */
  1288. $setMatrix(matrix: egret.Matrix, needUpdateProperties?: boolean): boolean;
  1289. /**
  1290. * @private
  1291. */
  1292. $setAnchorOffsetX(value: number): boolean;
  1293. /**
  1294. * @private
  1295. */
  1296. $setAnchorOffsetY(value: number): boolean;
  1297. /**
  1298. * @private
  1299. *
  1300. * @param value
  1301. * @returns
  1302. */
  1303. $setX(value: number): boolean;
  1304. /**
  1305. * @private
  1306. *
  1307. * @param value
  1308. * @returns
  1309. */
  1310. $setY(value: number): boolean;
  1311. /**
  1312. * @private
  1313. * 标记属性失效
  1314. */
  1315. invalidateProperties(): void;
  1316. /**
  1317. * @private
  1318. * 验证组件的属性
  1319. */
  1320. validateProperties(): void;
  1321. /**
  1322. * @private
  1323. * 标记提交过需要验证组件尺寸
  1324. */
  1325. invalidateSize(): void;
  1326. /**
  1327. * @private
  1328. * 验证组件的尺寸
  1329. */
  1330. validateSize(recursive?: boolean): void;
  1331. /**
  1332. * @private
  1333. * 测量组件尺寸,返回尺寸是否发生变化
  1334. */
  1335. private measureSizes();
  1336. /**
  1337. * @private
  1338. * 标记需要验证显示列表
  1339. */
  1340. invalidateDisplayList(): void;
  1341. /**
  1342. * @private
  1343. * 验证子项的位置和大小,并绘制其他可视内容
  1344. */
  1345. validateDisplayList(): void;
  1346. /**
  1347. * @private
  1348. * 更新最终的组件宽高
  1349. */
  1350. private updateFinalSize();
  1351. /**
  1352. * @private
  1353. * 立即应用组件及其子项的所有属性
  1354. */
  1355. validateNow(): void;
  1356. /**
  1357. * @private
  1358. * 标记父级容器的尺寸和显示列表为失效
  1359. */
  1360. protected invalidateParentLayout(): void;
  1361. /**
  1362. * @private
  1363. * 设置组件的布局宽高
  1364. */
  1365. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  1366. /**
  1367. * @private
  1368. * 设置组件的布局位置
  1369. */
  1370. setLayoutBoundsPosition(x: number, y: number): void;
  1371. /**
  1372. * @private
  1373. * 组件的布局尺寸,常用于父级的updateDisplayList()方法中
  1374. * 按照:布局尺寸>外部显式设置尺寸>测量尺寸 的优先级顺序返回尺寸,
  1375. * 注意此方法返回值已经包含scale和rotation。
  1376. */
  1377. getLayoutBounds(bounds: egret.Rectangle): void;
  1378. /**
  1379. * @private
  1380. *
  1381. * @returns
  1382. */
  1383. private getPreferredUWidth();
  1384. /**
  1385. * @private
  1386. *
  1387. * @returns
  1388. */
  1389. private getPreferredUHeight();
  1390. /**
  1391. * @private
  1392. * 获取组件的首选尺寸,常用于父级的measure()方法中
  1393. * 按照:外部显式设置尺寸>测量尺寸 的优先级顺序返回尺寸,
  1394. * 注意此方法返回值已经包含scale和rotation。
  1395. */
  1396. getPreferredBounds(bounds: egret.Rectangle): void;
  1397. /**
  1398. * @private
  1399. */
  1400. private applyMatrix(bounds, w, h);
  1401. /**
  1402. * @private
  1403. */
  1404. private getAnchorMatrix();
  1405. }
  1406. /**
  1407. * @private
  1408. * 拷贝模板类的方法体和属性到目标类上。
  1409. * @param target 目标类
  1410. * @param template 模板类
  1411. */
  1412. function mixin(target: any, template: any): void;
  1413. /**
  1414. * @private
  1415. * 自定义类实现UIComponent的步骤:
  1416. * 1.在自定义类的构造函数里调用:this.initializeUIValues();
  1417. * 2.拷贝UIComponent接口定义的所有内容(包括注释掉的protected函数)到自定义类,将所有子类需要覆盖的方法都声明为空方法体。
  1418. * 3.在定义类结尾的外部调用sys.implementUIComponent(),并传入自定义类。
  1419. * 4.若覆盖了某个UIComponent的方法,需要手动调用UIComponentImpl.prototype["方法名"].call(this);
  1420. * @param descendant 自定义的UIComponent子类
  1421. * @param base 自定义子类继承的父类
  1422. */
  1423. function implementUIComponent(descendant: any, base: any, isContainer?: boolean): void;
  1424. }
  1425. declare namespace eui {
  1426. /**
  1427. * The Group class is defines the base class for layout component.
  1428. * If the contents of the sub items are too large to scroll to show, you can wrap a Scroller component outside the
  1429. * group (Give the instance of Group to <code>viewport</code> property of Scroller component).
  1430. * The scroller component can adds a scrolling touch operation for the Group.
  1431. *
  1432. * @see http://edn.egret.com/cn/article/index/id/608 Simple container
  1433. * @defaultProperty elementsContent
  1434. * @includeExample extension/eui/components/GroupExample.ts
  1435. * @version Egret 2.4
  1436. * @version eui 1.0
  1437. * @platform Web,Native
  1438. * @language en_US
  1439. */
  1440. /**
  1441. * Group 是自动布局的容器基类。如果包含的子项内容太大需要滚动显示,可以在在 Group 外部包裹一层 Scroller 组件
  1442. * (将 Group 实例赋值给 Scroller 组件的 viewport 属性)。Scroller 会为 Group 添加滚动的触摸操作功能,并显示垂直或水平的滚动条。
  1443. *
  1444. * @see http://edn.egret.com/cn/article/index/id/608 简单容器
  1445. * @defaultProperty elementsContent
  1446. * @includeExample extension/eui/components/GroupExample.ts
  1447. * @version Egret 2.4
  1448. * @version eui 1.0
  1449. * @platform Web,Native
  1450. * @language zh_CN
  1451. */
  1452. class Group extends egret.DisplayObjectContainer implements IViewport {
  1453. /**
  1454. * Constructor.
  1455. *
  1456. * @version Egret 2.4
  1457. * @version eui 1.0
  1458. * @platform Web,Native
  1459. * @language en_US
  1460. */
  1461. /**
  1462. * 构造函数。
  1463. *
  1464. * @version Egret 2.4
  1465. * @version eui 1.0
  1466. * @platform Web,Native
  1467. * @language zh_CN
  1468. */
  1469. constructor();
  1470. $Group: Object;
  1471. /**
  1472. * This property is Usually invoked in resolving an EXML for adding multiple children quickly.
  1473. *
  1474. * @version Egret 2.4
  1475. * @version eui 1.0
  1476. * @platform Web,Native
  1477. * @language en_US
  1478. */
  1479. /**
  1480. * 此属性通常在 EXML 的解析器中调用,便于快速添加多个子项。
  1481. * @version Egret 2.4
  1482. * @version eui 1.0
  1483. * @platform Web,Native
  1484. * @language zh_CN
  1485. */
  1486. elementsContent: egret.DisplayObject[];
  1487. /**
  1488. * @private
  1489. */
  1490. $layout: LayoutBase;
  1491. /**
  1492. * The layout object for this container.
  1493. * This object is responsible for the measurement and layout of
  1494. * the UIcomponent in the container.
  1495. *
  1496. * @default eui.BasicLayout
  1497. *
  1498. * @version Egret 2.4
  1499. * @version eui 1.0
  1500. * @platform Web,Native
  1501. * @language en_US
  1502. */
  1503. /**
  1504. * 此容器的布局对象。
  1505. *
  1506. * s@default eui.BasicLayout
  1507. *
  1508. * @version Egret 2.4
  1509. * @version eui 1.0
  1510. * @platform Web,Native
  1511. * @language zh_CN
  1512. */
  1513. layout: LayoutBase;
  1514. /**
  1515. * @private
  1516. *
  1517. * @param value
  1518. */
  1519. $setLayout(value: LayoutBase): boolean;
  1520. /**
  1521. * @copy eui.IViewport#contentWidth
  1522. * @version Egret 2.4
  1523. * @version eui 1.0
  1524. * @platform Web,Native
  1525. */
  1526. readonly contentWidth: number;
  1527. /**
  1528. * @copy eui.IViewport#contentHeight
  1529. * @version Egret 2.4
  1530. * @version eui 1.0
  1531. * @platform Web,Native
  1532. */
  1533. readonly contentHeight: number;
  1534. /**
  1535. *
  1536. * Sets the <code>contentWidth</code> and <code>contentHeight</code>
  1537. * properties.
  1538. *
  1539. * This method is intended for layout class developers who should
  1540. * call it from <code>updateDisplayList()</code> methods.
  1541. *
  1542. * @param width The new value of <code>contentWidth</code>.
  1543. * @param height The new value of <code>contentHeight</code>.
  1544. *
  1545. * @version Egret 2.4
  1546. * @version eui 1.0
  1547. * @platform Web,Native
  1548. * @language en_US
  1549. */
  1550. /**
  1551. *
  1552. * 设置 <code>contentWidth</code> 和 <code>contentHeight</code> 属性。
  1553. * 此方法由布局来调用,开发者应该在布局类的 <code>updateDisplayList()</code> 方法中对其进行调用。
  1554. *
  1555. * @param width <code>contentWidth</code> 的新值。
  1556. * @param height <code>contentHeight</code> 的新值。
  1557. *
  1558. * @version Egret 2.4
  1559. * @version eui 1.0
  1560. * @platform Web,Native
  1561. * @language zh_CN
  1562. */
  1563. setContentSize(width: number, height: number): void;
  1564. /**
  1565. * @copy eui.IViewport#scrollEnabled
  1566. *
  1567. * @version Egret 2.4
  1568. * @version eui 1.0
  1569. * @platform Web,Native
  1570. */
  1571. scrollEnabled: boolean;
  1572. /**
  1573. * @copy eui.IViewport#scrollH
  1574. *
  1575. * @version Egret 2.4
  1576. * @version eui 1.0
  1577. * @platform Web,Native
  1578. */
  1579. scrollH: number;
  1580. /**
  1581. * @copy eui.IViewport#scrollV
  1582. *
  1583. * @version Egret 2.4
  1584. * @version eui 1.0
  1585. * @platform Web,Native
  1586. */
  1587. scrollV: number;
  1588. /**
  1589. * @private
  1590. *
  1591. * @returns
  1592. */
  1593. private updateScrollRect();
  1594. /**
  1595. * The number of layout element in this container.
  1596. *
  1597. * @version Egret 2.4
  1598. * @version eui 1.0
  1599. * @platform Web,Native
  1600. * @language en_US
  1601. */
  1602. /**
  1603. * 布局元素子项的数量。
  1604. *
  1605. * @version Egret 2.4
  1606. * @version eui 1.0
  1607. * @platform Web,Native
  1608. * @language zh_CN
  1609. */
  1610. readonly numElements: number;
  1611. /**
  1612. * Returns the layout element at the specified index.
  1613. *
  1614. * @version Egret 2.4
  1615. * @version eui 1.0
  1616. * @platform Web,Native
  1617. * @language en_US
  1618. */
  1619. /**
  1620. * 获取一个布局元素子项。
  1621. *
  1622. * @version Egret 2.4
  1623. * @version eui 1.0
  1624. * @platform Web,Native
  1625. * @language zh_CN
  1626. */
  1627. getElementAt(index: number): egret.DisplayObject;
  1628. getVirtualElementAt(index: number): egret.DisplayObject;
  1629. /**
  1630. * Set the index range of the sub Visual element in container which support virtual layout.
  1631. * This method is invalid in container which do not support virtual layout.
  1632. * This method is usually invoked before layout. Override this method to release the invisible elements.
  1633. *
  1634. * @param startIndex the start index of sub visual elements(include)
  1635. * @param endIndex the end index of sub visual elements(include)
  1636. *
  1637. * @version Egret 2.4
  1638. * @version eui 1.0
  1639. * @platform Web,Native
  1640. * @language en_US
  1641. */
  1642. /**
  1643. * 在支持虚拟布局的容器中,设置容器内可见的子元素索引范围。此方法在不支持虚拟布局的容器中无效。
  1644. * 通常在即将重新布局子项之前会被调用一次,容器覆盖此方法提前释放已经不可见的子元素。
  1645. *
  1646. * @param startIndex 可视元素起始索引(包括)
  1647. * @param endIndex 可视元素结束索引(包括)
  1648. *
  1649. * @version Egret 2.4
  1650. * @version eui 1.0
  1651. * @platform Web,Native
  1652. * @language zh_CN
  1653. */
  1654. setVirtualElementIndicesInView(startIndex: number, endIndex: number): void;
  1655. /**
  1656. * When <code>true</code>, this property
  1657. * ensures that the entire bounds of the Group respond to
  1658. * touch events such as begin.
  1659. *
  1660. * @version Egret 2.4
  1661. * @version eui 1.0
  1662. * @platform Web,Native
  1663. * @language en_US
  1664. */
  1665. /**
  1666. * 触摸组件的背景透明区域是否可以穿透。设置为true表示可以穿透,反之透明区域也会响应触摸事件。默认 false。
  1667. *
  1668. * @version Egret 2.4
  1669. * @version eui 1.0
  1670. * @platform Web,Native
  1671. * @language zh_CN
  1672. */
  1673. touchThrough: boolean;
  1674. /**
  1675. * @private
  1676. */
  1677. $hitTest(stageX: number, stageY: number): egret.DisplayObject;
  1678. /**
  1679. * @private
  1680. */
  1681. $stateValues: sys.StateValues;
  1682. /**
  1683. * The list of state for this component.
  1684. *
  1685. * @version Egret 2.4
  1686. * @version eui 1.0
  1687. * @platform Web,Native
  1688. * @language en_US
  1689. */
  1690. /**
  1691. * 为此组件定义的视图状态。
  1692. *
  1693. * @version Egret 2.4
  1694. * @version eui 1.0
  1695. * @platform Web,Native
  1696. * @language zh_CN
  1697. */
  1698. states: State[];
  1699. /**
  1700. * @copy eui.Component#currentState
  1701. *
  1702. * @version Egret 2.4
  1703. * @version eui 1.0
  1704. * @platform Web,Native
  1705. */
  1706. currentState: string;
  1707. /**
  1708. * @copy eui.Skin#hasState()
  1709. *
  1710. * @version Egret 2.4
  1711. * @version eui 1.0
  1712. * @platform Web,Native
  1713. */
  1714. hasState: (stateName: string) => boolean;
  1715. /**
  1716. * @private
  1717. * 初始化所有视图状态
  1718. */
  1719. private initializeStates;
  1720. /**
  1721. * @private
  1722. * 应用当前的视图状态。子类覆盖此方法在视图状态发生改变时执行相应更新操作。
  1723. */
  1724. private commitCurrentState;
  1725. /**
  1726. * @copy eui.Component#invalidateState()
  1727. *
  1728. * @version Egret 2.4
  1729. * @version eui 1.0
  1730. * @platform Web,Native
  1731. */
  1732. invalidateState(): void;
  1733. /**
  1734. * @copy eui.Component#getCurrentState()
  1735. *
  1736. * @version Egret 2.4
  1737. * @version eui 1.0
  1738. * @platform Web,Native
  1739. */
  1740. protected getCurrentState(): string;
  1741. /**
  1742. * @private
  1743. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  1744. */
  1745. private initializeUIValues;
  1746. /**
  1747. * @copy eui.Component#createChildren()
  1748. *
  1749. * @version Egret 2.4
  1750. * @version eui 1.0
  1751. * @platform Web,Native
  1752. */
  1753. protected createChildren(): void;
  1754. /**
  1755. * @copy eui.Component#childrenCreated()
  1756. *
  1757. * @version Egret 2.4
  1758. * @version eui 1.0
  1759. * @platform Web,Native
  1760. */
  1761. protected childrenCreated(): void;
  1762. /**
  1763. * @copy eui.Component#commitProperties()
  1764. *
  1765. * @version Egret 2.4
  1766. * @version eui 1.0
  1767. * @platform Web,Native
  1768. */
  1769. protected commitProperties(): void;
  1770. /**
  1771. * @copy eui.Component#measure()
  1772. *
  1773. * @version Egret 2.4
  1774. * @version eui 1.0
  1775. * @platform Web,Native
  1776. */
  1777. protected measure(): void;
  1778. /**
  1779. * @copy eui.Component#updateDisplayList()
  1780. *
  1781. * @version Egret 2.4
  1782. * @version eui 1.0
  1783. * @platform Web,Native
  1784. */
  1785. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  1786. /**
  1787. * @copy eui.Component#invalidateParentLayout()
  1788. *
  1789. * @version Egret 2.4
  1790. * @version eui 1.0
  1791. * @platform Web,Native
  1792. */
  1793. protected invalidateParentLayout(): void;
  1794. /**
  1795. * @private
  1796. */
  1797. $UIComponent: Object;
  1798. /**
  1799. * @private
  1800. */
  1801. $includeInLayout: boolean;
  1802. /**
  1803. * @inheritDoc
  1804. *
  1805. * @version Egret 2.4
  1806. * @version eui 1.0
  1807. * @platform Web,Native
  1808. */
  1809. includeInLayout: boolean;
  1810. /**
  1811. * @inheritDoc
  1812. *
  1813. * @version Egret 2.4
  1814. * @version eui 1.0
  1815. * @platform Web,Native
  1816. */
  1817. left: any;
  1818. /**
  1819. * @inheritDoc
  1820. *
  1821. * @version Egret 2.4
  1822. * @version eui 1.0
  1823. * @platform Web,Native
  1824. */
  1825. right: any;
  1826. /**
  1827. * @inheritDoc
  1828. *
  1829. * @version Egret 2.4
  1830. * @version eui 1.0
  1831. * @platform Web,Native
  1832. */
  1833. top: any;
  1834. /**
  1835. * @inheritDoc
  1836. *
  1837. * @version Egret 2.4
  1838. * @version eui 1.0
  1839. * @platform Web,Native
  1840. */
  1841. bottom: any;
  1842. /**
  1843. * @inheritDoc
  1844. *
  1845. * @version Egret 2.4
  1846. * @version eui 1.0
  1847. * @platform Web,Native
  1848. */
  1849. horizontalCenter: any;
  1850. /**
  1851. * @inheritDoc
  1852. *
  1853. * @version Egret 2.4
  1854. * @version eui 1.0
  1855. * @platform Web,Native
  1856. */
  1857. verticalCenter: any;
  1858. /**
  1859. * @inheritDoc
  1860. *
  1861. * @version Egret 2.4
  1862. * @version eui 1.0
  1863. * @platform Web,Native
  1864. */
  1865. percentWidth: number;
  1866. /**
  1867. * @inheritDoc
  1868. *
  1869. * @version Egret 2.4
  1870. * @version eui 1.0
  1871. * @platform Web,Native
  1872. */
  1873. percentHeight: number;
  1874. /**
  1875. * @inheritDoc
  1876. *
  1877. * @version Egret 2.4
  1878. * @version eui 1.0
  1879. * @platform Web,Native
  1880. */
  1881. explicitWidth: number;
  1882. /**
  1883. * @inheritDoc
  1884. *
  1885. * @version Egret 2.4
  1886. * @version eui 1.0
  1887. * @platform Web,Native
  1888. */
  1889. explicitHeight: number;
  1890. /**
  1891. * @inheritDoc
  1892. *
  1893. * @version Egret 2.4
  1894. * @version eui 1.0
  1895. * @platform Web,Native
  1896. */
  1897. minWidth: number;
  1898. /**
  1899. * @inheritDoc
  1900. *
  1901. * @version Egret 2.4
  1902. * @version eui 1.0
  1903. * @platform Web,Native
  1904. */
  1905. maxWidth: number;
  1906. /**
  1907. * @inheritDoc
  1908. *
  1909. * @version Egret 2.4
  1910. * @version eui 1.0
  1911. * @platform Web,Native
  1912. */
  1913. minHeight: number;
  1914. /**
  1915. * @inheritDoc
  1916. *
  1917. * @version Egret 2.4
  1918. * @version eui 1.0
  1919. * @platform Web,Native
  1920. */
  1921. maxHeight: number;
  1922. /**
  1923. * @inheritDoc
  1924. *
  1925. * @version Egret 2.4
  1926. * @version eui 1.0
  1927. * @platform Web,Native
  1928. */
  1929. setMeasuredSize(width: number, height: number): void;
  1930. /**
  1931. * @inheritDoc
  1932. *
  1933. * @version Egret 2.4
  1934. * @version eui 1.0
  1935. * @platform Web,Native
  1936. */
  1937. invalidateProperties(): void;
  1938. /**
  1939. * @inheritDoc
  1940. *
  1941. * @version Egret 2.4
  1942. * @version eui 1.0
  1943. * @platform Web,Native
  1944. */
  1945. validateProperties(): void;
  1946. /**
  1947. * @inheritDoc
  1948. *
  1949. * @version Egret 2.4
  1950. * @version eui 1.0
  1951. * @platform Web,Native
  1952. */
  1953. invalidateSize(): void;
  1954. /**
  1955. * @inheritDoc
  1956. *
  1957. * @version Egret 2.4
  1958. * @version eui 1.0
  1959. * @platform Web,Native
  1960. */
  1961. validateSize(recursive?: boolean): void;
  1962. /**
  1963. * @inheritDoc
  1964. *
  1965. * @version Egret 2.4
  1966. * @version eui 1.0
  1967. * @platform Web,Native
  1968. */
  1969. invalidateDisplayList(): void;
  1970. /**
  1971. * @inheritDoc
  1972. *
  1973. * @version Egret 2.4
  1974. * @version eui 1.0
  1975. * @platform Web,Native
  1976. */
  1977. validateDisplayList(): void;
  1978. /**
  1979. * @inheritDoc
  1980. *
  1981. * @version Egret 2.4
  1982. * @version eui 1.0
  1983. * @platform Web,Native
  1984. */
  1985. validateNow(): void;
  1986. /**
  1987. * @inheritDoc
  1988. *
  1989. * @version Egret 2.4
  1990. * @version eui 1.0
  1991. * @platform Web,Native
  1992. */
  1993. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  1994. /**
  1995. * @inheritDoc
  1996. *
  1997. * @version Egret 2.4
  1998. * @version eui 1.0
  1999. * @platform Web,Native
  2000. */
  2001. setLayoutBoundsPosition(x: number, y: number): void;
  2002. /**
  2003. * @inheritDoc
  2004. *
  2005. * @version Egret 2.4
  2006. * @version eui 1.0
  2007. * @platform Web,Native
  2008. */
  2009. getLayoutBounds(bounds: egret.Rectangle): void;
  2010. /**
  2011. * @inheritDoc
  2012. *
  2013. * @version Egret 2.4
  2014. * @version eui 1.0
  2015. * @platform Web,Native
  2016. */
  2017. getPreferredBounds(bounds: egret.Rectangle): void;
  2018. }
  2019. }
  2020. declare namespace eui {
  2021. /**
  2022. * Register a property of an instance is can be bound.
  2023. * This method is ususally invoked by Watcher class.
  2024. *
  2025. * @param instance the instance to be registered.
  2026. * @param property the property of specified instance to be registered.
  2027. *
  2028. * @version Egret 2.4
  2029. * @version eui 1.0
  2030. * @platform Web,Native
  2031. * @language en_US
  2032. */
  2033. /**
  2034. * 标记实例的一个属性是可绑定的,此方法通常由 Watcher 类调用。
  2035. *
  2036. * @param instance 要标记的实例
  2037. * @param property 可绑定的属性。
  2038. *
  2039. * @version Egret 2.4
  2040. * @version eui 1.0
  2041. * @platform Web,Native
  2042. * @language zh_CN
  2043. */
  2044. function registerBindable(instance: any, property: string): void;
  2045. }
  2046. declare namespace eui.sys {
  2047. /**
  2048. * @private
  2049. */
  2050. const enum ComponentKeys {
  2051. hostComponentKey = 0,
  2052. skinName = 1,
  2053. explicitState = 2,
  2054. enabled = 3,
  2055. stateIsDirty = 4,
  2056. skinNameExplicitlySet = 5,
  2057. explicitTouchChildren = 6,
  2058. explicitTouchEnabled = 7,
  2059. skin = 8,
  2060. }
  2061. }
  2062. declare namespace eui {
  2063. /**
  2064. * The Component class defines the base class for skinnable components.
  2065. * The skins used by a Component class are typically child classes of
  2066. * the Skin class.<p/>
  2067. *
  2068. * Associate a skin class with a component class by setting the <code>skinName</code> property of the
  2069. * component class.
  2070. * @event egret.Event.COMPLETE Dispatch when <code>skinName</code> property is set the path of external EXML file and the EXML file is resolved.
  2071. *
  2072. * @includeExample extension/eui/components/ComponentExample.ts
  2073. * @version Egret 2.4
  2074. * @version eui 1.0
  2075. * @platform Web,Native
  2076. * @language en_US
  2077. */
  2078. /**
  2079. * Component 类定义可设置外观的组件的基类。Component 类所使用的外观通常是 Skin 类的子类。<p/>
  2080. * 通过设置 component 类的 skinName 属性,将 skin 类与 component 类相关联。
  2081. * @event egret.Event.COMPLETE 当设置skinName为外部exml文件路径时,加载并完成EXML解析后调度。
  2082. *
  2083. * @includeExample extension/eui/components/ComponentExample.ts
  2084. * @version Egret 2.4
  2085. * @version eui 1.0
  2086. * @platform Web,Native
  2087. * @language zh_CN
  2088. */
  2089. class Component extends egret.DisplayObjectContainer implements UIComponent {
  2090. /**
  2091. * Constructor.
  2092. *
  2093. * @version Egret 2.4
  2094. * @version eui 1.0
  2095. * @platform Web,Native
  2096. * @language en_US
  2097. */
  2098. /**
  2099. * 构造函数。
  2100. *
  2101. * @version Egret 2.4
  2102. * @version eui 1.0
  2103. * @platform Web,Native
  2104. * @language zh_CN
  2105. */
  2106. constructor();
  2107. $Component: Object;
  2108. /**
  2109. * A identifier of host component which can determine only one component names.
  2110. * Usually used for quering a default skin name in theme.
  2111. * @default null
  2112. * @see eui.Theme#getSkinName()
  2113. * @version Egret 2.4
  2114. * @version eui 1.0
  2115. * @platform Web,Native
  2116. * @language en_US
  2117. */
  2118. /**
  2119. * 主机组件标识符。用于唯一确定一个组件的名称。通常用于在主题中查询默认皮肤名。
  2120. *
  2121. * @default null
  2122. * @see eui.Theme#getSkinName()
  2123. * @version Egret 2.4
  2124. * @version eui 1.0
  2125. * @platform Web,Native
  2126. * @language zh_CN
  2127. */
  2128. hostComponentKey: string;
  2129. /**
  2130. * Identifier of skin. Valid values: class definition of skin,
  2131. * class name of skin, instance of skin, EXML or external EXML file path.
  2132. * @version Egret 2.4
  2133. * @version eui 1.0
  2134. * @platform Web,Native
  2135. * @language en_US
  2136. */
  2137. /**
  2138. * 皮肤标识符。有效值可为:皮肤类定义,皮肤类名,皮肤实例,EXML文件内容,或外部EXML文件路径,
  2139. * @version Egret 2.4
  2140. * @version eui 1.0
  2141. * @platform Web,Native
  2142. * @language zh_CN
  2143. */
  2144. skinName: any;
  2145. /**
  2146. * @private
  2147. * 解析skinName
  2148. */
  2149. $parseSkinName(): void;
  2150. /**
  2151. * @private
  2152. * @param clazz
  2153. * @param url
  2154. */
  2155. private onExmlLoaded(clazz, url);
  2156. /**
  2157. * The instance of the skin class for this component instance.
  2158. * @version Egret 2.4
  2159. * @version eui 1.0
  2160. * @platform Web,Native
  2161. * @language en_US
  2162. */
  2163. /**
  2164. * 皮肤对象实例。
  2165. * @version Egret 2.4
  2166. * @version eui 1.0
  2167. * @platform Web,Native
  2168. * @language zh_CN
  2169. */
  2170. readonly skin: Skin;
  2171. /**
  2172. * Setter for the skin instance.
  2173. * @version Egret 2.4
  2174. * @version eui 1.0
  2175. * @platform Web,Native
  2176. * @language en_US
  2177. */
  2178. /**
  2179. * 设置皮肤实例
  2180. * @version Egret 2.4
  2181. * @version eui 1.0
  2182. * @platform Web,Native
  2183. * @language zh_CN
  2184. */
  2185. protected setSkin(skin: Skin): void;
  2186. /**
  2187. * Find the skin parts in the skin class and assign them to the properties of the component.
  2188. * You do not call this method directly. This method will be invoked automatically when using a EXML as skin.
  2189. * The ID for a tag in an EXML will be passed in as <code>partName</code>, and the instance of the tag will be
  2190. * passed in as <code>instance</code>.
  2191. * @param partName name of a skin part
  2192. * @param instance instance of a skin part
  2193. * @version Egret 2.4
  2194. * @version eui 1.0
  2195. * @platform Web,Native
  2196. * @language en_US
  2197. */
  2198. /**
  2199. * 关联一个对象到逻辑组件的指定皮肤部件上。通常您不需要手动调用此方法,当使用EXML文件作为组件皮肤,此方法将会被自动调用。
  2200. * 在运行时,EXML文件内声明的id名称将作为此方法的partName参数,而id所对应的节点对象,将作为此方法的instance参数被依次传入。
  2201. * @param partName 皮肤部件名称
  2202. * @param instance 皮肤部件实例
  2203. * @version Egret 2.4
  2204. * @version eui 1.0
  2205. * @platform Web,Native
  2206. * @language zh_CN
  2207. */
  2208. setSkinPart(partName: string, instance: any): void;
  2209. /**
  2210. * Called when a skin part is added.
  2211. * You do not call this method directly.
  2212. * EUI calls it automatically when it calls the <code>setSkinPart()</code> method.<p/>
  2213. *
  2214. * Override this function to attach behavior to the part, such as add event listener or
  2215. * assign property values cached.
  2216. * @param partName name of a skin part to add.
  2217. * @param instance instance of a skin part to add.
  2218. * @version Egret 2.4
  2219. * @version eui 1.0
  2220. * @platform Web,Native
  2221. * @language en_US
  2222. */
  2223. /**
  2224. * 添加皮肤部件时调用。
  2225. * 您无需直接调用此方法。
  2226. * EUI 会在调用 setSkinPart()方法时自动调用此方法。<p/>
  2227. *
  2228. * 子类覆盖此方法,以在皮肤部件第一次附加时对其执行一些初始化操作,例如添加事件监听,赋值缓存的属性值等。
  2229. * @param partName 要附加的皮肤部件名称。
  2230. * @param instance 要附加的皮肤部件实例。
  2231. * @version Egret 2.4
  2232. * @version eui 1.0
  2233. * @platform Web,Native
  2234. * @language zh_CN
  2235. */
  2236. protected partAdded(partName: string, instance: any): void;
  2237. /**
  2238. * Called when an instance of a skin part is being removed.
  2239. * You do not call this method directly.
  2240. * EUI calls it automatically when it calls the <code>setSkinPart()</code> method.<p/>
  2241. *
  2242. * Override this function to clean behavior of the part, such as remove event listener or
  2243. * disconnect the cache reference
  2244. * @param partName name of a skin part to remove.
  2245. * @param instance instance of a skin part to remove.
  2246. * @version Egret 2.4
  2247. * @version eui 1.0
  2248. * @platform Web,Native
  2249. * @language en_US
  2250. */
  2251. /**
  2252. * 正删除外观部件的实例时调用。
  2253. * 您无需直接调用此方法。
  2254. * EUI 会在调用 setSkinPart()方法时自动调用此方法。<p/>
  2255. *
  2256. * 子类覆盖此方法,以在皮肤部件从逻辑组件卸载时对其执行一些清理操作,例如移除事件监听,断开缓存的引用等。
  2257. * @param partName 要卸载的皮肤部件名称
  2258. * @param instance 要卸载的皮肤部件实例
  2259. * @version Egret 2.4
  2260. * @version eui 1.0
  2261. * @platform Web,Native
  2262. * @language zh_CN
  2263. */
  2264. protected partRemoved(partName: string, instance: any): void;
  2265. /**
  2266. * @private
  2267. *
  2268. * @param value
  2269. */
  2270. $setTouchChildren(value: boolean): boolean;
  2271. /**
  2272. * @private
  2273. *
  2274. * @param value
  2275. */
  2276. $setTouchEnabled(value: boolean): void;
  2277. /**
  2278. * Whether the component can accept user interaction.
  2279. * After setting the <code>enabled</code> property to <code>false</code>, components will disabled touch event
  2280. * (set <code>touchEnabled</code> and <code>touchChildren</code> to false) and set state of skin to "disabled".
  2281. *
  2282. * @default true
  2283. *
  2284. * @version Egret 2.4
  2285. * @version eui 1.0
  2286. * @platform Web,Native
  2287. * @language en_US
  2288. */
  2289. /**
  2290. * 组件是否可以接受用户交互。
  2291. * 将 enabled 属性设置为 false 后,
  2292. * 组件会自动禁用触摸事件(将 touchEnabled 和 touchChildren 同时设置为 false),
  2293. * 部分组件可能还会将皮肤的视图状态设置为"disabled",使其所有子项的颜色变暗。
  2294. *
  2295. * @default true
  2296. *
  2297. * @version Egret 2.4
  2298. * @version eui 1.0
  2299. * @platform Web,Native
  2300. * @language zh_CN
  2301. */
  2302. enabled: boolean;
  2303. /**
  2304. * @private
  2305. *
  2306. * @param value
  2307. */
  2308. $setEnabled(value: boolean): boolean;
  2309. /**
  2310. * The current view state of the component. When you use this property to set a component's state,
  2311. * EUI will explicit update state of skin and ignore the return of <code>getCurrentState()</code>.
  2312. *
  2313. * Set to <code>""</code> or <code>null</code> to reset the component back to its base state.
  2314. * @version Egret 2.4
  2315. * @version eui 1.0
  2316. * @platform Web,Native
  2317. * @language en_US
  2318. */
  2319. /**
  2320. * 组件的当前视图状态。显式设置此属性,
  2321. * 将采用显式设置的值去更新皮肤状态,而忽略组件内部 getCurrentState() 方法返回的值。
  2322. *
  2323. * 将其设置为 "" 或 null 可将取消组件外部显式设置的视图状态名称,从而采用内部 getCurrentState() 方法返回的状态。
  2324. * @version Egret 2.4
  2325. * @version eui 1.0
  2326. * @platform Web,Native
  2327. * @language zh_CN
  2328. */
  2329. currentState: string;
  2330. /**
  2331. * Marks the component so that the new state of the skin is set during a later screen update.
  2332. * A subclass of SkinnableComponent must override <code>getCurrentState()</code> to return a value.
  2333. * @version Egret 2.4
  2334. * @version eui 1.0
  2335. * @platform Web,Native
  2336. * @language en_US
  2337. */
  2338. /**
  2339. * 标记组件当前的视图状态失效,调用此方法后,子类应该覆盖 <code>getCurrentState()</code> 方法来返回当前的视图状态名称。
  2340. * @version Egret 2.4
  2341. * @version eui 1.0
  2342. * @platform Web,Native
  2343. * @language zh_CN
  2344. */
  2345. invalidateState(): void;
  2346. /**
  2347. * Returns the name of the state to be applied to the skin.<p/>
  2348. * A subclass of SkinnableComponent must override this method to return a value.
  2349. * @version Egret 2.4
  2350. * @version eui 1.0
  2351. * @platform Web,Native
  2352. * @language en_US
  2353. */
  2354. /**
  2355. * 返回组件当前的皮肤状态名称,子类覆盖此方法定义各种状态名
  2356. * @version Egret 2.4
  2357. * @version eui 1.0
  2358. * @platform Web,Native
  2359. * @language zh_CN
  2360. */
  2361. protected getCurrentState(): string;
  2362. /**
  2363. * @private
  2364. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  2365. */
  2366. private initializeUIValues;
  2367. /**
  2368. * Create child objects of the component. This is an advanced method that you might override
  2369. * when creating a subclass of Component. This method will be called once it be added to stage.
  2370. * You must invoke <code>super.createChildren()</code> to complete initialization of the parent class
  2371. * @version Egret 2.4
  2372. * @version eui 1.0
  2373. * @platform Web,Native
  2374. * @language en_US
  2375. */
  2376. /**
  2377. * 子类覆盖此方法可以执行一些初始化子项操作。此方法仅在组件第一次添加到舞台时回调一次。
  2378. * 请务必调用super.createChildren()以完成父类组件的初始化
  2379. * @version Egret 2.4
  2380. * @version eui 1.0
  2381. * @platform Web,Native
  2382. * @language zh_CN
  2383. */
  2384. protected createChildren(): void;
  2385. /**
  2386. * Performs any final processing after child objects are created.
  2387. * This is an advanced method that you might override
  2388. * when creating a subclass of Component.
  2389. * @version Egret 2.4
  2390. * @version eui 1.0
  2391. * @platform Web,Native
  2392. * @language en_US
  2393. */
  2394. /**
  2395. * 创建子对象后执行任何最终处理。此方法在创建 Component 的子类时覆盖。
  2396. * @version Egret 2.4
  2397. * @version eui 1.0
  2398. * @platform Web,Native
  2399. * @language zh_CN
  2400. */
  2401. protected childrenCreated(): void;
  2402. /**
  2403. * Processes the properties set on the component.
  2404. * You can override this method when creating a subclass of Component.
  2405. * @version Egret 2.4
  2406. * @version eui 1.0
  2407. * @platform Web,Native
  2408. * @language en_US
  2409. */
  2410. /**
  2411. * 提交属性,子类在调用完invalidateProperties()方法后,应覆盖此方法以应用属性
  2412. * @version Egret 2.4
  2413. * @version eui 1.0
  2414. * @platform Web,Native
  2415. * @language zh_CN
  2416. */
  2417. protected commitProperties(): void;
  2418. /**
  2419. * Calculates the default size.
  2420. * @version Egret 2.4
  2421. * @version eui 1.0
  2422. * @platform Web,Native
  2423. * @language en_US
  2424. */
  2425. /**
  2426. * 测量组件尺寸
  2427. * @version Egret 2.4
  2428. * @version eui 1.0
  2429. * @platform Web,Native
  2430. * @language zh_CN
  2431. */
  2432. protected measure(): void;
  2433. /**
  2434. * Draws the object and/or sizes and positions its children.
  2435. * @version Egret 2.4
  2436. * @version eui 1.0
  2437. * @platform Web,Native
  2438. * @language en_US
  2439. */
  2440. /**
  2441. * 更新显示列表
  2442. * @version Egret 2.4
  2443. * @version eui 1.0
  2444. * @platform Web,Native
  2445. * @language zh_CN
  2446. */
  2447. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  2448. /**
  2449. * Method to invalidate parent size and display list if
  2450. * this object affects its layout (includeInLayout is true).
  2451. * @version Egret 2.4
  2452. * @version eui 1.0
  2453. * @platform Web,Native
  2454. * @language en_US
  2455. */
  2456. /**
  2457. * 此对象影响其布局时(includeInLayout 为 true),使父代大小和显示列表失效的方法。
  2458. * @version Egret 2.4
  2459. * @version eui 1.0
  2460. * @platform Web,Native
  2461. * @language zh_CN
  2462. */
  2463. protected invalidateParentLayout(): void;
  2464. /**
  2465. * @private
  2466. */
  2467. $UIComponent: Object;
  2468. /**
  2469. * @private
  2470. */
  2471. $includeInLayout: boolean;
  2472. /**
  2473. * @inheritDoc
  2474. *
  2475. * @version Egret 2.4
  2476. * @version eui 1.0
  2477. * @platform Web,Native
  2478. */
  2479. includeInLayout: boolean;
  2480. /**
  2481. * @inheritDoc
  2482. *
  2483. * @version Egret 2.4
  2484. * @version eui 1.0
  2485. * @platform Web,Native
  2486. */
  2487. left: any;
  2488. /**
  2489. * @inheritDoc
  2490. *
  2491. * @version Egret 2.4
  2492. * @version eui 1.0
  2493. * @platform Web,Native
  2494. */
  2495. right: any;
  2496. /**
  2497. * @inheritDoc
  2498. *
  2499. * @version Egret 2.4
  2500. * @version eui 1.0
  2501. * @platform Web,Native
  2502. */
  2503. top: any;
  2504. /**
  2505. * @inheritDoc
  2506. *
  2507. * @version Egret 2.4
  2508. * @version eui 1.0
  2509. * @platform Web,Native
  2510. */
  2511. bottom: any;
  2512. /**
  2513. * @inheritDoc
  2514. *
  2515. * @version Egret 2.4
  2516. * @version eui 1.0
  2517. * @platform Web,Native
  2518. */
  2519. horizontalCenter: any;
  2520. /**
  2521. * @inheritDoc
  2522. *
  2523. * @version Egret 2.4
  2524. * @version eui 1.0
  2525. * @platform Web,Native
  2526. */
  2527. verticalCenter: any;
  2528. /**
  2529. * @inheritDoc
  2530. *
  2531. * @version Egret 2.4
  2532. * @version eui 1.0
  2533. * @platform Web,Native
  2534. */
  2535. percentWidth: number;
  2536. /**
  2537. * @inheritDoc
  2538. *
  2539. * @version Egret 2.4
  2540. * @version eui 1.0
  2541. * @platform Web,Native
  2542. */
  2543. percentHeight: number;
  2544. /**
  2545. * @inheritDoc
  2546. *
  2547. * @version Egret 2.4
  2548. * @version eui 1.0
  2549. * @platform Web,Native
  2550. */
  2551. explicitWidth: number;
  2552. /**
  2553. * @inheritDoc
  2554. *
  2555. * @version Egret 2.4
  2556. * @version eui 1.0
  2557. * @platform Web,Native
  2558. */
  2559. explicitHeight: number;
  2560. /**
  2561. * @inheritDoc
  2562. *
  2563. * @version Egret 2.4
  2564. * @version eui 1.0
  2565. * @platform Web,Native
  2566. */
  2567. minWidth: number;
  2568. /**
  2569. * @inheritDoc
  2570. *
  2571. * @version Egret 2.4
  2572. * @version eui 1.0
  2573. * @platform Web,Native
  2574. */
  2575. maxWidth: number;
  2576. /**
  2577. * @inheritDoc
  2578. *
  2579. * @version Egret 2.4
  2580. * @version eui 1.0
  2581. * @platform Web,Native
  2582. */
  2583. minHeight: number;
  2584. /**
  2585. * @inheritDoc
  2586. *
  2587. * @version Egret 2.4
  2588. * @version eui 1.0
  2589. * @platform Web,Native
  2590. */
  2591. maxHeight: number;
  2592. /**
  2593. * @inheritDoc
  2594. *
  2595. * @version Egret 2.4
  2596. * @version eui 1.0
  2597. * @platform Web,Native
  2598. */
  2599. setMeasuredSize(width: number, height: number): void;
  2600. /**
  2601. * @inheritDoc
  2602. *
  2603. * @version Egret 2.4
  2604. * @version eui 1.0
  2605. * @platform Web,Native
  2606. */
  2607. invalidateProperties(): void;
  2608. /**
  2609. * @inheritDoc
  2610. *
  2611. * @version Egret 2.4
  2612. * @version eui 1.0
  2613. * @platform Web,Native
  2614. */
  2615. validateProperties(): void;
  2616. /**
  2617. * @inheritDoc
  2618. *
  2619. * @version Egret 2.4
  2620. * @version eui 1.0
  2621. * @platform Web,Native
  2622. */
  2623. invalidateSize(): void;
  2624. /**
  2625. * @inheritDoc
  2626. *
  2627. * @version Egret 2.4
  2628. * @version eui 1.0
  2629. * @platform Web,Native
  2630. */
  2631. validateSize(recursive?: boolean): void;
  2632. /**
  2633. * @inheritDoc
  2634. *
  2635. * @version Egret 2.4
  2636. * @version eui 1.0
  2637. * @platform Web,Native
  2638. */
  2639. invalidateDisplayList(): void;
  2640. /**
  2641. * @inheritDoc
  2642. *
  2643. * @version Egret 2.4
  2644. * @version eui 1.0
  2645. * @platform Web,Native
  2646. */
  2647. validateDisplayList(): void;
  2648. /**
  2649. * @inheritDoc
  2650. *
  2651. * @version Egret 2.4
  2652. * @version eui 1.0
  2653. * @platform Web,Native
  2654. */
  2655. validateNow(): void;
  2656. /**
  2657. * @inheritDoc
  2658. *
  2659. * @version Egret 2.4
  2660. * @version eui 1.0
  2661. * @platform Web,Native
  2662. */
  2663. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  2664. /**
  2665. * @inheritDoc
  2666. *
  2667. * @version Egret 2.4
  2668. * @version eui 1.0
  2669. * @platform Web,Native
  2670. */
  2671. setLayoutBoundsPosition(x: number, y: number): void;
  2672. /**
  2673. * @inheritDoc
  2674. *
  2675. * @version Egret 2.4
  2676. * @version eui 1.0
  2677. * @platform Web,Native
  2678. */
  2679. getLayoutBounds(bounds: egret.Rectangle): void;
  2680. /**
  2681. * @inheritDoc
  2682. *
  2683. * @version Egret 2.4
  2684. * @version eui 1.0
  2685. * @platform Web,Native
  2686. */
  2687. getPreferredBounds(bounds: egret.Rectangle): void;
  2688. }
  2689. }
  2690. declare namespace eui {
  2691. /**
  2692. * The DataGroup class is the base container class for data items.
  2693. * The DataGroup class converts data items to visual elements for display.
  2694. * While this container can hold visual elements, it is often used only
  2695. * to hold data items as children.
  2696. *
  2697. * @see eui.Group
  2698. * @see http://edn.egret.com/cn/article/index/id/527 Data container
  2699. * @see http://edn.egret.com/cn/article/index/id/528 Array collection
  2700. * @defaultProperty dataProvider
  2701. * @includeExample extension/eui/components/DataGroupExample.ts
  2702. * @version Egret 2.4
  2703. * @version eui 1.0
  2704. * @platform Web,Native
  2705. * @language en_US
  2706. */
  2707. /**
  2708. * DataGroup 类将数据项目转换为可视元素以进行显示。
  2709. * 尽管此容器可以包含可视元素,但它通常仅用于包含作为子项的数据项目。
  2710. *
  2711. * @see eui.Group
  2712. * @see http://edn.egret.com/cn/article/index/id/527 数据容器
  2713. * @see http://edn.egret.com/cn/article/index/id/528 数组集合
  2714. * @defaultProperty dataProvider
  2715. * @includeExample extension/eui/components/DataGroupExample.ts
  2716. * @version Egret 2.4
  2717. * @version eui 1.0
  2718. * @platform Web,Native
  2719. * @language zh_CN
  2720. */
  2721. class DataGroup extends Group {
  2722. /**
  2723. * Constructor.
  2724. *
  2725. * @version Egret 2.4
  2726. * @version eui 1.0
  2727. * @platform Web,Native
  2728. * @language en_US
  2729. */
  2730. /**
  2731. * 构造函数。
  2732. *
  2733. * @version Egret 2.4
  2734. * @version eui 1.0
  2735. * @platform Web,Native
  2736. * @language zh_CN
  2737. */
  2738. constructor();
  2739. $DataGroup: Object;
  2740. /**
  2741. * @copy eui.LayoutBase#useVirtualLayout
  2742. *
  2743. * @version Egret 2.4
  2744. * @version eui 1.0
  2745. * @platform Web,Native
  2746. */
  2747. useVirtualLayout: boolean;
  2748. /**
  2749. * @private
  2750. *
  2751. * @param value
  2752. */
  2753. $setLayout(value: LayoutBase): boolean;
  2754. /**
  2755. * @private
  2756. * 是否使用虚拟布局标记改变
  2757. */
  2758. private onUseVirtualLayoutChanged(event?);
  2759. /**
  2760. * @inheritDoc
  2761. *
  2762. * @version Egret 2.4
  2763. * @version eui 1.0
  2764. * @platform Web,Native
  2765. */
  2766. setVirtualElementIndicesInView(startIndex: number, endIndex: number): void;
  2767. /**
  2768. * @inheritDoc
  2769. *
  2770. * @version Egret 2.4
  2771. * @version eui 1.0
  2772. * @platform Web,Native
  2773. */
  2774. getElementAt(index: number): egret.DisplayObject;
  2775. /**
  2776. * @inheritDoc
  2777. *
  2778. * @version Egret 2.5.2
  2779. * @version eui 1.0
  2780. * @platform Web,Native
  2781. */
  2782. getVirtualElementAt(index: number): UIComponent;
  2783. /**
  2784. * @private
  2785. * 释放指定索引处的项呈示器
  2786. */
  2787. private freeRendererByIndex(index);
  2788. /**
  2789. * @private
  2790. *
  2791. * @param renderer
  2792. */
  2793. private doFreeRenderer(renderer);
  2794. /**
  2795. * @inheritDoc
  2796. *
  2797. * @version Egret 2.4
  2798. * @version eui 1.0
  2799. * @platform Web,Native
  2800. */
  2801. invalidateSize(): void;
  2802. /**
  2803. * @private
  2804. * 为指定索引创建虚拟的项呈示器
  2805. */
  2806. private createVirtualRenderer(item);
  2807. /**
  2808. * @private
  2809. * 根据rendererClass创建一个Renderer,并添加到显示列表
  2810. */
  2811. private createOneRenderer(rendererClass);
  2812. /**
  2813. * @private
  2814. * 设置项呈示器的默认皮肤
  2815. */
  2816. private setItemRenderSkinName(renderer, skinName);
  2817. /**
  2818. * @private
  2819. */
  2820. $dataProviderChanged: boolean;
  2821. /**
  2822. * @private
  2823. */
  2824. $dataProvider: ICollection;
  2825. /**
  2826. * The data provider for this DataGroup.
  2827. * It must be an ICollection, such as ArrayCollection
  2828. *
  2829. * @see eui.ICollection
  2830. * @see eui.ArrayCollection
  2831. *
  2832. * @version Egret 2.4
  2833. * @version eui 1.0
  2834. * @platform Web,Native
  2835. * @language en_US
  2836. */
  2837. /**
  2838. * 列表数据源,请使用实现了ICollection接口的数据类型,例如 ArrayCollection
  2839. *
  2840. * @see eui.ICollection
  2841. * @see eui.ArrayCollection
  2842. *
  2843. * @version Egret 2.4
  2844. * @version eui 1.0
  2845. * @platform Web,Native
  2846. * @language zh_CN
  2847. */
  2848. dataProvider: ICollection;
  2849. /**
  2850. * @private
  2851. *
  2852. * @param value
  2853. */
  2854. $setDataProvider(value: ICollection): boolean;
  2855. /**
  2856. * @private
  2857. * 移除数据源监听
  2858. */
  2859. private removeDataProviderListener();
  2860. /**
  2861. * Called when contents within the dataProvider changes. We will catch certain
  2862. * events and update our children based on that.
  2863. *
  2864. * @param event 事件<code>eui.CollectionEvent</code>的对象。
  2865. *
  2866. * @version Egret 2.4
  2867. * @version eui 1.0
  2868. * @platform Web,Native
  2869. * @language en_US
  2870. */
  2871. /**
  2872. * 数据源改变事件处理。
  2873. *
  2874. * @param event 事件<code>eui.CollectionEvent</code>的对象。
  2875. *
  2876. * @version Egret 2.4
  2877. * @version eui 1.0
  2878. * @platform Web,Native
  2879. * @language zh_CN
  2880. */
  2881. protected onCollectionChange(event: CollectionEvent): void;
  2882. /**
  2883. * @private
  2884. * 数据源添加项目事件处理
  2885. */
  2886. private itemAddedHandler(items, index);
  2887. /**
  2888. * @private
  2889. * 数据源移除项目事件处理
  2890. */
  2891. private itemRemovedHandler(items, location);
  2892. /**
  2893. * Adds the item for the specified dataProvider item to this DataGroup.
  2894. *
  2895. * This method is called as needed by the DataGroup implementation,
  2896. * it should not be called directly.
  2897. *
  2898. * @param item The item that was added, the value of dataProvider[index].
  2899. * @param index The index where the dataProvider item was added.
  2900. *
  2901. * @version Egret 2.4
  2902. * @version eui 1.0
  2903. * @platform Web,Native
  2904. * @language en_US
  2905. */
  2906. /**
  2907. * 添加一个指定的数据到数据源。
  2908. *
  2909. * 这个方法不应该由开发者直接调用,而用于本类自动内调用。
  2910. *
  2911. * @param item 添加的数据项。
  2912. * @param index 被添加到的索引。
  2913. *
  2914. * @version Egret 2.4
  2915. * @version eui 1.0
  2916. * @platform Web,Native
  2917. * @language zh_CN
  2918. */
  2919. protected itemAdded(item: any, index: number): void;
  2920. /**
  2921. * Removes the itemRenderer for the specified dataProvider item from this DataGroup.
  2922. *
  2923. * This method is called as needed by the DataGroup implementation,
  2924. * it should not be called directly.
  2925. *
  2926. * @param item The item that is being removed.
  2927. * @param index The index of the item that is being removed.
  2928. *
  2929. * @version Egret 2.4
  2930. * @version eui 1.0
  2931. * @platform Web,Native
  2932. * @language en_US
  2933. */
  2934. /**
  2935. * 删除数据源中指定的项。
  2936. *
  2937. * 这个方法不应该由开发者直接调用,而用于本类自动内调用。
  2938. *
  2939. * @param item 移除的数据项。
  2940. * @param index 被移除的索引。
  2941. *
  2942. * @version Egret 2.4
  2943. * @version eui 1.0
  2944. * @platform Web,Native
  2945. * @language zh_CN
  2946. */
  2947. protected itemRemoved(item: any, index: number): void;
  2948. /**
  2949. * @private
  2950. * 更新当前所有项的索引
  2951. */
  2952. private resetRenderersIndices();
  2953. /**
  2954. * @private
  2955. * 数据源更新或替换项目事件处理
  2956. */
  2957. private itemUpdatedHandler(item, location);
  2958. /**
  2959. * @private
  2960. * 调整指定项呈示器的索引值
  2961. */
  2962. private resetRendererItemIndex(index);
  2963. /**
  2964. * The item renderer to use for data items.
  2965. * The class must implement the IItemRenderer interface.
  2966. * If defined, the <code>itemRendererFunction</code> property
  2967. * takes precedence over this property.
  2968. *
  2969. * @version Egret 2.4
  2970. * @version eui 1.0
  2971. * @platform Web,Native
  2972. * @language en_US
  2973. */
  2974. /**
  2975. * 用于数据项目的项呈示器。您应该直接为此属性赋值自定义类的类定义,而不是一个实例。注意:该类必须实现 IItemRenderer 接口。<br/>
  2976. * rendererClass获取顺序:itemRendererFunction > itemRenderer > 默认ItemRenerer。
  2977. *
  2978. * @version Egret 2.4
  2979. * @version eui 1.0
  2980. * @platform Web,Native
  2981. * @language zh_CN
  2982. */
  2983. itemRenderer: any;
  2984. /**
  2985. * The skinName property of the itemRenderer.This property will be passed to itemRenderer.skinName as default value,if you
  2986. * did not set it explicitly.<br>
  2987. * Note: This property is invalid if the itemRenderer is not a subclass of the Component class.
  2988. * @version Egret 2.4
  2989. * @version eui 1.0
  2990. * @platform Web,Native
  2991. * @language en_US
  2992. */
  2993. /**
  2994. * 条目渲染器的可选皮肤标识符。在实例化itemRenderer时,若其内部没有设置过skinName,则将此属性的值赋值给它的skinName。
  2995. * 注意:若 itemRenderer 不是 Component 的子类,则此属性无效。
  2996. * @version Egret 2.4
  2997. * @version eui 1.0
  2998. * @platform Web,Native
  2999. * @language zh_CN
  3000. */
  3001. itemRendererSkinName: any;
  3002. /**
  3003. * Function that returns an item renderer for a
  3004. * specific item.
  3005. *
  3006. * If defined, this property
  3007. * takes precedence over the <code>itemRenderer</code> property.
  3008. *
  3009. * @version Egret 2.4
  3010. * @version eui 1.0
  3011. * @platform Web,Native
  3012. * @language en_US
  3013. */
  3014. /**
  3015. * 为某个特定数据项返回一个项呈示器类定义的函数。
  3016. * rendererClass获取顺序:itemRendererFunction > itemRenderer > 默认ItemRenerer。
  3017. * @version Egret 2.4
  3018. * @version eui 1.0
  3019. * @platform Web,Native
  3020. * @language zh_CN
  3021. */
  3022. itemRendererFunction: (item: any) => any;
  3023. /**
  3024. * @private
  3025. * 为特定的数据项返回项呈示器的工厂实例
  3026. */
  3027. private itemToRendererClass(item);
  3028. /**
  3029. * @inheritDoc
  3030. *
  3031. * @version Egret 2.4
  3032. * @version eui 1.0
  3033. * @platform Web,Native
  3034. */
  3035. protected createChildren(): void;
  3036. /**
  3037. * @inheritDoc
  3038. *
  3039. * @version Egret 2.4
  3040. * @version eui 1.0
  3041. * @platform Web,Native
  3042. */
  3043. protected commitProperties(): void;
  3044. /**
  3045. * @inheritDoc
  3046. *
  3047. * @version Egret 2.4
  3048. * @version eui 1.0
  3049. * @platform Web,Native
  3050. */
  3051. protected measure(): void;
  3052. /**
  3053. * @inheritDoc
  3054. *
  3055. * @version Egret 2.4
  3056. * @version eui 1.0
  3057. * @platform Web,Native
  3058. */
  3059. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  3060. /**
  3061. * @private
  3062. * 确保测量过默认条目大小。
  3063. */
  3064. private ensureTypicalLayoutElement();
  3065. /**
  3066. * @private
  3067. * 测量项呈示器默认尺寸
  3068. */
  3069. private measureRendererSize();
  3070. /**
  3071. * @private
  3072. * 设置项目默认大小
  3073. */
  3074. private setTypicalLayoutRect(rect);
  3075. /**
  3076. * @private
  3077. * 索引到项呈示器的转换数组
  3078. */
  3079. $indexToRenderer: IItemRenderer[];
  3080. /**
  3081. * @private
  3082. * 移除所有项呈示器
  3083. */
  3084. private removeAllRenderers();
  3085. /**
  3086. * @private
  3087. * 为数据项创建项呈示器
  3088. */
  3089. private createRenderers();
  3090. /**
  3091. * Updates the renderer for reuse.
  3092. * This method first prepares the item
  3093. * renderer for reuse by cleaning out any stale properties
  3094. * as well as updating it with new properties.<p/>
  3095. *
  3096. * The last thing this method should do is set the <code>data</code> property
  3097. * of the item renderer.
  3098. *
  3099. * @param renderer The item renderer.
  3100. * @param itemIndex The index of the data in the data provider.
  3101. * @param data The data object this item renderer is representing.
  3102. *
  3103. * @version Egret 2.4
  3104. * @version eui 1.0
  3105. * @platform Web,Native
  3106. * @language en_US
  3107. */
  3108. /**
  3109. * 此方法首先会准备项呈示器以重用,方法是清除任何旧属性,同时使用新属性进行更新。<p/>
  3110. *
  3111. * 最后,此方法应对项呈示器设置 data 属性。
  3112. *
  3113. * @param renderer 项呈示器。
  3114. * @param itemIndex 数据提供程序中的数据索引。
  3115. * @param data 此项呈示器正在表示的数据对象。
  3116. *
  3117. * @version Egret 2.4
  3118. * @version eui 1.0
  3119. * @platform Web,Native
  3120. * @language zh_CN
  3121. */
  3122. updateRenderer(renderer: IItemRenderer, itemIndex: number, data: any): IItemRenderer;
  3123. /**
  3124. * @inheritDoc
  3125. *
  3126. * @version Egret 2.4
  3127. * @version eui 1.0
  3128. * @platform Web,Native
  3129. */
  3130. readonly numElements: number;
  3131. /**
  3132. * Adds the itemRenderer for the specified dataProvider item to this DataGroup.
  3133. *
  3134. * This method is called as needed by the DataGroup implementation,
  3135. * it should not be called directly.
  3136. *
  3137. * @param renderer The renderer that was added.
  3138. * @param index The index where the dataProvider item was added.
  3139. * @param item The item that was added, the value of dataProvider[index].
  3140. *
  3141. * @version Egret 2.4
  3142. * @version eui 1.0
  3143. * @platform Web,Native
  3144. * @language en_US
  3145. */
  3146. /**
  3147. * 项呈示器被添加.
  3148. *
  3149. * 这个方法不能直接调用,它是由该类自身自动调用的。
  3150. *
  3151. * @param renderer 添加的项呈示器
  3152. * @param index 项呈示器的索引
  3153. * @param item 项呈示器对应的数据
  3154. *
  3155. * @version Egret 2.4
  3156. * @version eui 1.0
  3157. * @platform Web,Native
  3158. * @language zh_CN
  3159. */
  3160. protected rendererAdded(renderer: IItemRenderer, index: number, item: any): void;
  3161. /**
  3162. * Removes the itemRenderer for the specified dataProvider item from this DataGroup.
  3163. *
  3164. * This method is called as needed by the DataGroup implementation,
  3165. * it should not be called directly.
  3166. *
  3167. * @param renderer The renderer that is being removed.
  3168. * @param index The index of the item that is being removed.
  3169. * @param item The item that is being removed.
  3170. *
  3171. * @version Egret 2.4
  3172. * @version eui 1.0
  3173. * @platform Web,Native
  3174. * @language en_US
  3175. */
  3176. /**
  3177. * 项呈示器被移除。
  3178. * 这个方法不能直接调用,它是由该类自身自动调用的。
  3179. *
  3180. * @param renderer 移除的项呈示器
  3181. * @param index 项呈示器的索引
  3182. * @param item 项呈示器对应的数据
  3183. *
  3184. * @version Egret 2.4
  3185. * @version eui 1.0
  3186. * @platform Web,Native
  3187. * @language zh_CN
  3188. */
  3189. protected rendererRemoved(renderer: IItemRenderer, index: number, item: any): void;
  3190. }
  3191. }
  3192. declare namespace eui {
  3193. /**
  3194. * The Button component is a commonly used rectangular button.
  3195. * The Button component looks like it can be pressed.
  3196. * The default skin has a text label and a icon display object.
  3197. *
  3198. * @event egret.TouchEvent.TOUCH_CANCEL canceled the touch
  3199. *
  3200. * @state up Button up state
  3201. * @state down Button down state
  3202. * @state disabled Button disabled state
  3203. * @version Egret 2.4
  3204. * @version eui 1.0
  3205. * @platform Web,Native
  3206. * @includeExample extension/eui/components/ButtonExample.ts
  3207. * @language en_US
  3208. */
  3209. /**
  3210. * Button 组件是常用的矩形按钮。Button 组件看起来可以按压。默认外观具有一个文本标签和图标显示对象。
  3211. *
  3212. * @event egret.TouchEvent.TOUCH_CANCEL 取消触摸事件
  3213. *
  3214. * @state up 按钮弹起状态
  3215. * @state down 按钮按下状态
  3216. * @state disabled 按钮禁用状态
  3217. * @version Egret 2.4
  3218. * @version eui 1.0
  3219. * @platform Web,Native
  3220. * @includeExample extension/eui/components/ButtonExample.ts
  3221. * @language zh_CN
  3222. */
  3223. class Button extends Component {
  3224. /**
  3225. * Constructor.
  3226. * @version Egret 2.4
  3227. * @version eui 1.0
  3228. * @platform Web,Native
  3229. * @language en_US
  3230. */
  3231. /**
  3232. * 创建一个按钮实例
  3233. * @version Egret 2.4
  3234. * @version eui 1.0
  3235. * @platform Web,Native
  3236. * @language zh_CN
  3237. */
  3238. constructor();
  3239. /**
  3240. * [SkinPart] A skin part that defines the label of the button.
  3241. * @skinPart
  3242. * @version Egret 2.4
  3243. * @version eui 1.0
  3244. * @platform Web,Native
  3245. * @language en_US
  3246. */
  3247. /**
  3248. * [SkinPart] 按钮上的文本标签。
  3249. * @skinPart
  3250. * @version Egret 2.4
  3251. * @version eui 1.0
  3252. * @platform Web,Native
  3253. * @language zh_CN
  3254. */
  3255. labelDisplay: IDisplayText;
  3256. /**
  3257. * @private
  3258. */
  3259. private _label;
  3260. /**
  3261. * Text to appear on the Button control.
  3262. * @version Egret 2.4
  3263. * @version eui 1.0
  3264. * @platform Web,Native
  3265. * @language en_US
  3266. */
  3267. /**
  3268. * 要在按钮上显示的文本。
  3269. * @version Egret 2.4
  3270. * @version eui 1.0
  3271. * @platform Web,Native
  3272. * @language zh_CN
  3273. */
  3274. label: string;
  3275. /**
  3276. * [SkinPart] A skin part that defines an optional icon for the button.
  3277. * @skinPart
  3278. * @version Egret 2.4
  3279. * @version eui 1.0
  3280. * @platform Web,Native
  3281. * @language en_US
  3282. */
  3283. /**
  3284. * [SkinPart] 按钮上的图标显示对象。
  3285. * @skinPart
  3286. * @version Egret 2.4
  3287. * @version eui 1.0
  3288. * @platform Web,Native
  3289. * @language zh_CN
  3290. */
  3291. iconDisplay: Image;
  3292. /**
  3293. * @private
  3294. */
  3295. private _icon;
  3296. /**
  3297. * Icon to appear on the Button control.
  3298. * @version Egret 2.4
  3299. * @version eui 1.0
  3300. * @platform Web,Native
  3301. * @language en_US
  3302. */
  3303. /**
  3304. * 要在按钮上显示的图标数据
  3305. * @version Egret 2.4
  3306. * @version eui 1.0
  3307. * @platform Web,Native
  3308. * @language zh_CN
  3309. */
  3310. icon: string | egret.Texture;
  3311. /**
  3312. * @private
  3313. * 指示第一次分派 TouchEvent.TOUCH_BEGIN 时,触摸点是否在按钮上。
  3314. */
  3315. private touchCaptured;
  3316. /**
  3317. * This method handles the touchCancle events
  3318. * @param The <code>egret.TouchEvent</code> object.
  3319. * @version Egret 3.0.1
  3320. * @version eui 1.0
  3321. * @platform Web,Native
  3322. * @language en_US
  3323. */
  3324. /**
  3325. * 解除触碰事件处理。
  3326. * @param event 事件 <code>egret.TouchEvent</code> 的对象。
  3327. * @version Egret 3.0.1
  3328. * @version eui 1.0
  3329. * @platform Web,Native
  3330. * @language zh_CN
  3331. */
  3332. protected onTouchCancle(event: egret.TouchEvent): void;
  3333. /**
  3334. * This method handles the touch events
  3335. * @param The <code>egret.TouchEvent</code> object.
  3336. * @version Egret 2.4
  3337. * @version eui 1.0
  3338. * @platform Web,Native
  3339. * @language en_US
  3340. */
  3341. /**
  3342. * 触碰事件处理。
  3343. * @param event 事件 <code>egret.TouchEvent</code> 的对象。
  3344. * @version Egret 2.4
  3345. * @version eui 1.0
  3346. * @platform Web,Native
  3347. * @language zh_CN
  3348. */
  3349. protected onTouchBegin(event: egret.TouchEvent): void;
  3350. /**
  3351. * @private
  3352. * 舞台上触摸弹起事件
  3353. */
  3354. private onStageTouchEnd(event);
  3355. /**
  3356. * @inheritDoc
  3357. *
  3358. * @version Egret 2.4
  3359. * @version eui 1.0
  3360. * @platform Web,Native
  3361. */
  3362. protected getCurrentState(): string;
  3363. /**
  3364. * @inheritDoc
  3365. *
  3366. * @version Egret 2.4
  3367. * @version eui 1.0
  3368. * @platform Web,Native
  3369. */
  3370. protected partAdded(partName: string, instance: any): void;
  3371. /**
  3372. * This method is called when handling a <code>egret.TouchEvent.TOUCH_END</code> event
  3373. * when the user touches on the button. It is only called when the button
  3374. * is the target and when <code>touchCaptured</code> is <code>true</code>.
  3375. * @version Egret 2.4
  3376. * @version eui 1.0
  3377. * @platform Web,Native
  3378. * @language en_US
  3379. */
  3380. /**
  3381. * 当在用户单击按钮之后处理 <code>egret.TouchEvent.TOUCH_END</code> 事件时,将调用此方法。
  3382. * 仅当以按钮为目标,并且 <code>touchCaptured</code> 为 <code>true</code> 时,才会调用此方法。
  3383. * @version Egret 2.4
  3384. * @version eui 1.0
  3385. * @platform Web,Native
  3386. * @language zh_CN
  3387. */
  3388. protected buttonReleased(): void;
  3389. }
  3390. }
  3391. declare namespace eui.sys {
  3392. /**
  3393. * @private
  3394. */
  3395. const enum RangeKeys {
  3396. maximum = 0,
  3397. maxChanged = 1,
  3398. minimum = 2,
  3399. minChanged = 3,
  3400. value = 4,
  3401. changedValue = 5,
  3402. valueChanged = 6,
  3403. snapInterval = 7,
  3404. snapIntervalChanged = 8,
  3405. explicitSnapInterval = 9,
  3406. }
  3407. }
  3408. declare namespace eui {
  3409. /**
  3410. * The Range class holds a value and an allowed range for that
  3411. * value, defined by <code>minimum</code> and <code>maximum</code> properties.
  3412. *
  3413. * The <code>value</code> property
  3414. * is always constrained to be between the current <code>minimum</code> and
  3415. * <code>maximum</code>, and the <code>minimum</code>,
  3416. * and <code>maximum</code> are always constrained
  3417. * to be in the proper numerical order, such that
  3418. * <code>(minimum <= value <= maximum)</code> is <code>true</code>.
  3419. *
  3420. * If the value of the <code>snapInterval</code> property is not 0,
  3421. * then the <code>value</code> property is also constrained to be a multiple of
  3422. * <code>snapInterval</code>.
  3423. *
  3424. * @version Egret 2.4
  3425. * @version eui 1.0
  3426. * @platform Web,Native
  3427. * @includeExample extension/eui/components/supportClasses/RangeExample.ts
  3428. * @language en_US
  3429. */
  3430. /**
  3431. * 范围选取组件,该组件包含一个值和这个值所允许的最大最小约束范围。
  3432. *
  3433. * <code>value</code>属性的值永远被限制于当前的<code>minimum</code>和
  3434. * <code>maximum</code>之间,并且<code>minimum</code>和 <code>maximum</code>永远按照固定的顺序排列,
  3435. * 即<code>(minimum <= value <= maximum)</code> 为真。
  3436. *
  3437. * 如果<code>snapInterval</code>属性的值不是0,那么<code>value</code>的值也会被<code>snapInterval</code>所约束。
  3438. * @version Egret 2.4
  3439. * @version eui 1.0
  3440. * @platform Web,Native
  3441. * @includeExample extension/eui/components/supportClasses/RangeExample.ts
  3442. * @language zh_CN
  3443. */
  3444. class Range extends Component {
  3445. /**
  3446. * Constructor.
  3447. * @version Egret 2.4
  3448. * @version eui 1.0
  3449. * @platform Web,Native
  3450. * @language en_US
  3451. */
  3452. /**
  3453. * 创建一个 Range 实例。
  3454. * @version Egret 2.4
  3455. * @version eui 1.0
  3456. * @platform Web,Native
  3457. * @language zh_CN
  3458. */
  3459. constructor();
  3460. /**
  3461. * @private
  3462. */
  3463. $Range: Object;
  3464. /**
  3465. * The maximum valid <code>value</code>.<p/>
  3466. *
  3467. * Changes to the value property are constrained
  3468. * by <code>commitProperties()</code> to be less than or equal to
  3469. * maximum with the <code>nearestValidValue()</code> method.
  3470. *
  3471. * @default 100
  3472. *
  3473. * @version Egret 2.4
  3474. * @version eui 1.0
  3475. * @platform Web,Native
  3476. * @language en_US
  3477. */
  3478. /**
  3479. * 最大有效值。<p/>
  3480. *
  3481. * 规定<code>value</code>属性的值不能够超过的最大值。该修正过程
  3482. * 将在<code>nearestValidValue()</code>方法中进行。
  3483. *
  3484. * @default 100
  3485. *
  3486. * @version Egret 2.4
  3487. * @version eui 1.0
  3488. * @platform Web,Native
  3489. * @language zh_CN
  3490. */
  3491. maximum: number;
  3492. /**
  3493. * The minimum valid <code>value</code>.<p/>
  3494. *
  3495. * Changes to the value property are constrained
  3496. * by <code>commitProperties()</code> to be greater than or equal to
  3497. * minimum with the <code>nearestValidValue()</code> method.
  3498. *
  3499. * @default 0
  3500. *
  3501. * @version Egret 2.4
  3502. * @version eui 1.0
  3503. * @platform Web,Native
  3504. * @language en_US
  3505. */
  3506. /**
  3507. * 最小有效值<p/>
  3508. *
  3509. * 规定<code>value</code>属性的值不能够低于的最小值。该修正过程
  3510. * 将在<code>nearestValidValue()</code>方法中进行。
  3511. *
  3512. * @default 0
  3513. *
  3514. * @version Egret 2.4
  3515. * @version eui 1.0
  3516. * @platform Web,Native
  3517. * @language zh_CN
  3518. */
  3519. minimum: number;
  3520. /**
  3521. * The current value for this range.<p/>
  3522. *
  3523. * Changes to the value property are constrained
  3524. * by <code>commitProperties()</code> to be greater than or equal to
  3525. * the <code>minimum</code> property, less than or equal to the <code>maximum</code> property, and a
  3526. * multiple of <code>snapInterval</code> with the <code>nearestValidValue()</code>
  3527. * method.
  3528. *
  3529. * @default 0
  3530. *
  3531. * @version Egret 2.4
  3532. * @version eui 1.0
  3533. * @platform Web,Native
  3534. * @language en_US
  3535. */
  3536. /**
  3537. * 此范围的当前值。<p/>
  3538. *
  3539. * 改变的<code>value</code>属性将在<code>commitProperties()</code>方法中被<code>minimum</code>属性
  3540. * 和<code>minimum</code>属性所限制。此修正过程将在<code>nearestValidValue()</code>方法中进行。
  3541. *
  3542. * @default 0
  3543. *
  3544. * @version Egret 2.4
  3545. * @version eui 1.0
  3546. * @platform Web,Native
  3547. * @language zh_CN
  3548. */
  3549. value: number;
  3550. /**
  3551. * @private
  3552. *
  3553. * @param newValue
  3554. */
  3555. $setValue(newValue: number): boolean;
  3556. /**
  3557. * The snapInterval property controls the valid values of the <code>value</code> property.
  3558. *
  3559. * If nonzero, valid values are the sum of the <code>minimum</code> and integer multiples
  3560. * of this property, for all sums that are less than or equal to the <code>maximum</code>.<p/>
  3561. *
  3562. * For example, if <code>minimum</code> is 10, <code>maximum</code> is 20, and this property is 3, then the
  3563. * valid values of this Range are 10, 13, 16, 19, and 20.<p/>
  3564. *
  3565. * If the value of this property is zero, then valid values are only constrained
  3566. * to be between minimum and maximum inclusive.
  3567. *
  3568. * @default 1
  3569. *
  3570. * @version Egret 2.4
  3571. * @version eui 1.0
  3572. * @platform Web,Native
  3573. * @language en_US
  3574. */
  3575. /**
  3576. * snapInterval 属性定义 value 属性的有效值。
  3577. * 如果为非零,则有效值为 minimum 与此属性的整数倍数之和,且小于或等于 maximum。</p>
  3578. *
  3579. * 例如,如果 minimum 为 10,maximum 为 20,而此属性为 3,则可能的有效值为 10、13、16、19 和 20.</p>
  3580. *
  3581. * 如果此属性的值为零,则仅会将有效值约束到介于 minimum 和 maximum 之间(包括两者)。
  3582. *
  3583. * @default 1
  3584. *
  3585. * @version Egret 2.4
  3586. * @version eui 1.0
  3587. * @platform Web,Native
  3588. * @language zh_CN
  3589. */
  3590. snapInterval: number;
  3591. /**
  3592. * Processes the properties set on the component.
  3593. * @version Egret 2.4
  3594. * @version eui 1.0
  3595. * @platform Web,Native
  3596. * @language en_US
  3597. */
  3598. /**
  3599. * 处理对组件设置的属性
  3600. * @version Egret 2.4
  3601. * @version eui 1.0
  3602. * @platform Web,Native
  3603. * @language zh_CN
  3604. */
  3605. protected commitProperties(): void;
  3606. /**
  3607. * @private
  3608. * 修正size到最接近snapInterval的整数倍
  3609. */
  3610. private nearestValidSize(size);
  3611. /**
  3612. * Returns the sum of the minimum with an integer multiple of <code>interval</code> that's
  3613. * closest to <code>value</code>, unless <code>value</code> is closer to the maximum limit,
  3614. * in which case the maximum is returned.<p/>
  3615. *
  3616. * If <code>interval</code> is equal to 0, the value is clipped to the minimum and maximum
  3617. * limits.<p/>
  3618. *
  3619. * The valid values for a range are defined by the sum of the <code>minimum</code> property
  3620. * with multiples of the <code>interval</code> and also defined to be less than or equal to the
  3621. * <code>maximum</code> property.
  3622. * The maximum need not be a multiple of <code>snapInterval</code>.<p/>
  3623. *
  3624. * For example, if <code>minimum</code> is equal to 1, <code>maximum</code> is equal to 6,
  3625. * and <code>snapInterval</code> is equal to 2, the valid
  3626. * values for the Range are 1, 3, 5, 6.
  3627. *
  3628. * Similarly, if <code>minimum</code> is equal to 2, <code>maximum</code> is equal to 9,
  3629. * and <code>snapInterval</code> is equal to 1.5, the valid
  3630. * values for the Range are 2, 3.5, 5, 6.5, 8, and 9.
  3631. *
  3632. * @param value The input value.
  3633. * @param interval The value of snapInterval or an integer multiple of snapInterval.
  3634. * @return The valid value that's closest to the input.
  3635. *
  3636. * @version Egret 2.4
  3637. * @version eui 1.0
  3638. * @platform Web,Native
  3639. * @language en_US
  3640. */
  3641. /**
  3642. * 返回 <code>minimum</code> 与最接近 <code>value</code> 的 <code>interval</code> 的整数倍数之和,
  3643. * 除非 <code>value</code> 接近最大值限制的时候会返回 maximum。<p/>
  3644. *
  3645. * 如果 <code>interval</code> 等于 0,则会将该值剪裁到限制的最小值和最大值。<p/>
  3646. *
  3647. * 范围的有效值由 <code>minimum</code> 属性与 <code>interval</code> 的倍数之和决定,
  3648. * 与此同时也要小于等于 <code>maximum</code> 属性。
  3649. * 最大值不能是 <code>snapInterval</code> 属性的倍数。<p/>
  3650. *
  3651. * 例如,如果 <code>minimum</code> 等于 1,<code>maximum</code> 等于 6,且 <code>snapInterval</code> 等于 3,
  3652. * 则 Range 的有效值有 1、2、5、6。
  3653. *
  3654. * 类似地,如果 <code>minimum</code> 等于 2,<code>maximum</code> 等于 9,
  3655. * 且 <code>snapInterval</code> 等于 1.5,则 Range 的有效值有 2、3.5、5、6.5、8 和 9。
  3656. *
  3657. *
  3658. * @param value 输入值。
  3659. * @param interval snapInterval 的值,或 snapInterval 的整数倍数。
  3660. * @return 最近接输入值的有效值。
  3661. *
  3662. * @version Egret 2.4
  3663. * @version eui 1.0
  3664. * @platform Web,Native
  3665. * @language zh_CN
  3666. */
  3667. protected nearestValidValue(value: number, interval: number): number;
  3668. /**
  3669. * Sets the current value for the <code>value</code> property.<p/>
  3670. *
  3671. * This method assumes that the caller has already used the <code>nearestValidValue()</code> method
  3672. * to constrain the value parameter
  3673. *
  3674. * @param value The new value of the <code>value</code> property.
  3675. *
  3676. * @version Egret 2.4
  3677. * @version eui 1.0
  3678. * @platform Web,Native
  3679. * @language en_US
  3680. */
  3681. /**
  3682. * 设置当前值。<p/>
  3683. *
  3684. * 此方法假定调用者已经使用了 nearestValidValue() 方法来约束 value 参数。
  3685. *
  3686. * @param value value属性的新值
  3687. *
  3688. * @version Egret 2.4
  3689. * @version eui 1.0
  3690. * @platform Web,Native
  3691. * @language zh_CN
  3692. */
  3693. protected setValue(value: number): void;
  3694. /**
  3695. * Draws the object and/or sizes and positions its children.
  3696. * @version Egret 2.4
  3697. * @version eui 1.0
  3698. * @platform Web,Native
  3699. * @language en_US
  3700. */
  3701. /**
  3702. * 绘制对象和/或设置其子项的大小和位置
  3703. * @version Egret 2.4
  3704. * @version eui 1.0
  3705. * @platform Web,Native
  3706. * @language zh_CN
  3707. */
  3708. protected updateDisplayList(w: number, h: number): void;
  3709. /**
  3710. * Update size and visible of skin parts.<p/>
  3711. * Subclasses override this method to update skin parts display based on <code>minimum</code>, <code>maximum</code>
  3712. * and <code>value</code> properties.
  3713. * @version Egret 2.4
  3714. * @version eui 1.0
  3715. * @platform Web,Native
  3716. * @language en_US
  3717. */
  3718. /**
  3719. * 更新皮肤部件(通常为滑块)的大小和可见性。<p/>
  3720. * 子类覆盖此方法以基于 minimum、maximum 和 value 属性更新滑块的大小、位置和可见性。
  3721. * @version Egret 2.4
  3722. * @version eui 1.0
  3723. * @platform Web,Native
  3724. * @language zh_CN
  3725. */
  3726. protected updateSkinDisplayList(): void;
  3727. }
  3728. }
  3729. declare namespace eui {
  3730. /**
  3731. * The LayoutBase class defines the base class for all Spark layouts.
  3732. * To create a custom layout that works with the Spark containers,
  3733. * you must extend <code>LayoutBase</code> or one of its subclasses.
  3734. *
  3735. * <p>Subclasses must implement the <code>updateDisplayList()</code>
  3736. * method, which positions and sizes the <code>target</code> GroupBase's elements, and
  3737. * the <code>measure()</code> method, which calculates the default
  3738. * size of the <code>target</code>.</p>
  3739. *
  3740. * @version Egret 2.4
  3741. * @version eui 1.0
  3742. * @platform Web,Native
  3743. * @language en_US
  3744. */
  3745. /**
  3746. * 容器布局基类。若要创建使用 Group 容器的自定义布局,必须扩展 <code>LayoutBase</code> 或其子类之一。
  3747. *
  3748. * <p>子类必须实现 <code>updateDisplayList()</code> 方法
  3749. * (定位 <code>target</code> Group 的子项并调整这些子项的大小)和 <code>measure()</code> 方法
  3750. * (计算 <code>target</code> 的默认大小)。</p>
  3751. *
  3752. * @version Egret 2.4
  3753. * @version eui 1.0
  3754. * @platform Web,Native
  3755. * @language zh_CN
  3756. */
  3757. class LayoutBase extends egret.EventDispatcher {
  3758. /**
  3759. * Constructor.
  3760. * @version Egret 2.4
  3761. * @version eui 1.0
  3762. * @platform Web,Native
  3763. * @language en_US
  3764. */
  3765. /**
  3766. * 构造函数。
  3767. * @version Egret 2.4
  3768. * @version eui 1.0
  3769. * @platform Web,Native
  3770. * @language zh_CN
  3771. */
  3772. constructor();
  3773. /**
  3774. * @private
  3775. */
  3776. $target: Group;
  3777. /**
  3778. * The Group container whose elements are measured, sized and positioned
  3779. * by this layout.
  3780. *
  3781. * @version Egret 2.4
  3782. * @version eui 1.0
  3783. * @platform Web,Native
  3784. * @language en_US
  3785. */
  3786. /**
  3787. * 此布局将测量其元素、调整其元素的大小并定位其元素的 Group 容器。
  3788. *
  3789. * @version Egret 2.4
  3790. * @version eui 1.0
  3791. * @platform Web,Native
  3792. * @language zh_CN
  3793. */
  3794. target: Group;
  3795. /**
  3796. * @private
  3797. */
  3798. $useVirtualLayout: boolean;
  3799. /**
  3800. * To configure a container to use virtual layout, set the <code>useVirtualLayout</code> property
  3801. * to <code>true</code> for the layout associated with the container.
  3802. * Only DataGroup with layout set to VerticalLayout,
  3803. * HorizontalLayout, or TileLayout supports virtual layout.
  3804. * Layout subclasses that do not support virtualization must prevent changing
  3805. * this property.
  3806. *
  3807. * @default false
  3808. *
  3809. * @version Egret 2.4
  3810. * @version eui 1.0
  3811. * @platform Web,Native
  3812. * @language en_US
  3813. */
  3814. /**
  3815. * 若要配置容器使用虚拟布局,请为与容器关联的布局的 <code>useVirtualLayout</code> 属性设置为 <code>true</code>。
  3816. * 只有布局设置为 VerticalLayout、HorizontalLayout 或 TileLayout 的 DataGroup 才支持虚拟布局。
  3817. * 不支持虚拟化的布局子类必须禁止更改此属性。
  3818. *
  3819. * @default false
  3820. *
  3821. * @version Egret 2.4
  3822. * @version eui 1.0
  3823. * @platform Web,Native
  3824. * @language zh_CN
  3825. */
  3826. useVirtualLayout: boolean;
  3827. /**
  3828. * @private
  3829. */
  3830. $typicalWidth: number;
  3831. /**
  3832. * @private
  3833. */
  3834. $typicalHeight: number;
  3835. /**
  3836. * Set this size of a typical element
  3837. *
  3838. * @param width the height of element
  3839. * @param height the width of element
  3840. *
  3841. * @version Egret 2.4
  3842. * @version eui 1.0
  3843. * @platform Web,Native
  3844. * @language en_US
  3845. */
  3846. /**
  3847. * 设置一个典型元素的大小
  3848. *
  3849. * @param width 元素的宽
  3850. * @param height 元素的高
  3851. *
  3852. * @version Egret 2.4
  3853. * @version eui 1.0
  3854. * @platform Web,Native
  3855. * @language zh_CN
  3856. */
  3857. setTypicalSize(width: number, height: number): void;
  3858. /**
  3859. * Called when the <code>verticalScrollPosition</code> or
  3860. * <code>horizontalScrollPosition</code> properties change.
  3861. *
  3862. * @version Egret 2.4
  3863. * @version eui 1.0
  3864. * @platform Web,Native
  3865. * @language en_US
  3866. */
  3867. /**
  3868. * <code>verticalScrollPosition</code> 或 <code>horizontalScrollPosition</code>
  3869. * 属性更改时调用。
  3870. *
  3871. * @version Egret 2.4
  3872. * @version eui 1.0
  3873. * @platform Web,Native
  3874. * @language zh_CN
  3875. */
  3876. scrollPositionChanged(): void;
  3877. /**
  3878. * When <code>useVirtualLayout</code> is <code>true</code>,
  3879. * this method can be used by the layout target
  3880. * to clear cached layout information when the target changes.
  3881. *
  3882. * @version Egret 2.4
  3883. * @version eui 1.0
  3884. * @platform Web,Native
  3885. * @language en_US
  3886. */
  3887. /**
  3888. * 如果 <code>useVirtualLayout</code> 为 <code>true</code>,
  3889. * 则当布局目标改变时,布局目标可以使用此方法来清除已缓存布局信息。
  3890. *
  3891. * @version Egret 2.4
  3892. * @version eui 1.0
  3893. * @platform Web,Native
  3894. * @language zh_CN
  3895. */
  3896. clearVirtualLayoutCache(): void;
  3897. /**
  3898. * Called by the target after a layout element
  3899. * has been added and before the target's size and display list are
  3900. * validated.
  3901. * Layouts that cache per element state, like virtual layouts, can
  3902. * override this method to update their cache.
  3903. *
  3904. * @param index The index of the element that was added.
  3905. *
  3906. * @version Egret 2.4
  3907. * @version eui 1.0
  3908. * @platform Web,Native
  3909. * @language en_US
  3910. */
  3911. /**
  3912. * 在已添加布局元素之后且在验证目标的大小和显示列表之前,由目标调用。
  3913. * 按元素状态缓存的布局(比如虚拟布局)可以覆盖此方法以更新其缓存。
  3914. *
  3915. * @param index 发生改变的子项索引
  3916. *
  3917. * @version Egret 2.4
  3918. * @version eui 1.0
  3919. * @platform Web,Native
  3920. * @language zh_CN
  3921. */
  3922. elementAdded(index: number): void;
  3923. /**
  3924. * This method must is called by the target after a layout element
  3925. * has been removed and before the target's size and display list are
  3926. * validated.
  3927. * Layouts that cache per element state, like virtual layouts, can
  3928. * override this method to update their cache.
  3929. *
  3930. * @param index The index of the element that was added.
  3931. *
  3932. * @version Egret 2.4
  3933. * @version eui 1.0
  3934. * @platform Web,Native
  3935. * @language en_US
  3936. */
  3937. /**
  3938. *
  3939. * 必须在已删除布局元素之后且在验证目标的大小和显示列表之前,由目标调用此方法。
  3940. * 按元素状态缓存的布局(比如虚拟布局)可以覆盖此方法以更新其缓存。
  3941. *
  3942. * @param index 发生改变的子项索引
  3943. *
  3944. * @version Egret 2.4
  3945. * @version eui 1.0
  3946. * @platform Web,Native
  3947. * @language zh_CN
  3948. */
  3949. elementRemoved(index: number): void;
  3950. /**
  3951. * Return the indices of the element visible within this Group.
  3952. *
  3953. * @return The indices of the visible element.
  3954. *
  3955. * @version Egret 2.4
  3956. * @version eui 1.0
  3957. * @platform Web,Native
  3958. * @language en_US
  3959. */
  3960. /**
  3961. * 返回此 Group 中可见的元素的索引。
  3962. *
  3963. * @return 可见的元素的索引。
  3964. *
  3965. * @version Egret 2.4
  3966. * @version eui 1.0
  3967. * @platform Web,Native
  3968. * @language zh_CN
  3969. */
  3970. getElementIndicesInView(): number[];
  3971. /**
  3972. * Measures the target's default size based on its content.
  3973. *
  3974. * @version Egret 2.4
  3975. * @version eui 1.0
  3976. * @platform Web,Native
  3977. * @language en_US
  3978. */
  3979. /**
  3980. * 基于目标的内容测量其默认大小
  3981. *
  3982. * @version Egret 2.4
  3983. * @version eui 1.0
  3984. * @platform Web,Native
  3985. * @language zh_CN
  3986. */
  3987. measure(): void;
  3988. /**
  3989. * Sizes and positions the target's elements.
  3990. *
  3991. * @param unscaledWidth Specifies the width of the target, in pixels,
  3992. * in the targets's coordinates.
  3993. *
  3994. * @param unscaledHeight Specifies the height of the component, in pixels,
  3995. * in the target's coordinates.
  3996. *
  3997. * @version Egret 2.4
  3998. * @version eui 1.0
  3999. * @platform Web,Native
  4000. * @language en_US
  4001. */
  4002. /**
  4003. * 调整目标的元素的大小并定位这些元素。
  4004. *
  4005. * @param unscaledWidth 指定目标在目标坐标中的宽度(以像素为单位)。
  4006. * @param unscaledHeight 指定组件在目标坐标中的高度(以像素为单位)。
  4007. *
  4008. * @version Egret 2.4
  4009. * @version eui 1.0
  4010. * @platform Web,Native
  4011. * @language zh_CN
  4012. */
  4013. updateDisplayList(width: number, height: number): void;
  4014. }
  4015. }
  4016. declare namespace eui.sys {
  4017. /**
  4018. * @private
  4019. */
  4020. const enum ListBaseKeys {
  4021. /**
  4022. * @private
  4023. */
  4024. requireSelection = 0,
  4025. /**
  4026. * @private
  4027. */
  4028. requireSelectionChanged = 1,
  4029. /**
  4030. * @private
  4031. */
  4032. proposedSelectedIndex = 2,
  4033. /**
  4034. * @private
  4035. */
  4036. selectedIndex = 3,
  4037. /**
  4038. * @private
  4039. */
  4040. dispatchChangeAfterSelection = 4,
  4041. /**
  4042. * @private
  4043. */
  4044. pendingSelectedItem = 5,
  4045. /**
  4046. * @private
  4047. */
  4048. selectedIndexAdjusted = 6,
  4049. /**
  4050. * @private
  4051. */
  4052. touchDownItemRenderer = 7,
  4053. /**
  4054. * @private
  4055. */
  4056. touchCancle = 8,
  4057. }
  4058. }
  4059. declare namespace eui {
  4060. /**
  4061. * The ListBase class is the base class for list component.
  4062. * It can display items of list as vertical or horizontal such as SELECT of HTML.
  4063. * @event egret.Event.CHANGE Dispatched after the selection has changed.
  4064. * This event is dispatched when the user interacts with the control.
  4065. * @event egret.Event.CHANGING Dispatched when the selection is going to change.
  4066. * Calling the <code>preventDefault()</code> method
  4067. * on the event prevents the selection from changing.<p/>
  4068. * This event is dispatched when the user interacts with the control.
  4069. *
  4070. * @event eui.ItemTapEvent.ITEM_TAP dispatched when the user tap an item in the control.
  4071. * @event egret.TouchEvent.TOUCH_CANCEL canceled the touch
  4072. *
  4073. * @version Egret 2.4
  4074. * @version eui 1.0
  4075. * @platform Web,Native
  4076. * @language en_US
  4077. */
  4078. /**
  4079. * ListBase 是列表控件基类。可显示垂直或水平的项目列表。其功能与 HTML 中的 SELECT 表单元素的功能相似。
  4080. * @event egret.Event.CHANGE 选中的索引已经发生改变,注意:此事件仅在索引改变是由用户触摸操作引起时才抛出。
  4081. * @event egret.Event.CHANGING 选中的索引即将发生改变,可以通过调用事件对象的 preventDefault() 方法来阻止改变。<p/>
  4082. * 注意:此事件仅在索引改变是由用户触摸操作引起时才抛出。
  4083. *
  4084. * @event eui.ItemTapEvent.ITEM_TAP 项呈示器单击事件。
  4085. * @event egret.TouchEvent.TOUCH_CANCEL 取消触摸事件
  4086. *
  4087. * @version Egret 2.4
  4088. * @version eui 1.0
  4089. * @platform Web,Native
  4090. * @language zh_CN
  4091. */
  4092. class ListBase extends DataGroup {
  4093. /**
  4094. * Constructor.
  4095. * @version Egret 2.4
  4096. * @version eui 1.0
  4097. * @platform Web,Native
  4098. * @language en_US
  4099. */
  4100. /**
  4101. * 构造函数
  4102. * @version Egret 2.4
  4103. * @version eui 1.0
  4104. * @platform Web,Native
  4105. * @language zh_CN
  4106. */
  4107. constructor();
  4108. /**
  4109. * @private
  4110. */
  4111. $ListBase: Object;
  4112. /**
  4113. * Static constant representing the value "no selection".
  4114. * @version Egret 2.4
  4115. * @version eui 1.0
  4116. * @platform Web,Native
  4117. * @language en_US
  4118. */
  4119. /**
  4120. * 未选中任何项时的索引值
  4121. * @version Egret 2.4
  4122. * @version eui 1.0
  4123. * @platform Web,Native
  4124. * @language zh_CN
  4125. */
  4126. static NO_SELECTION: number;
  4127. /**
  4128. * Static constant representing no proposed selection.
  4129. * @version Egret 2.4
  4130. * @version eui 1.0
  4131. * @platform Web,Native
  4132. * @language en_US
  4133. */
  4134. /**
  4135. * 未设置缓存选中项的值
  4136. * @version Egret 2.4
  4137. * @version eui 1.0
  4138. * @platform Web,Native
  4139. * @language zh_CN
  4140. */
  4141. static NO_PROPOSED_SELECTION: number;
  4142. /**
  4143. * If <code>true</code>, a data item must always be selected in the control.
  4144. * If the value is <code>true</code>, the <code>selectedIndex</code> property
  4145. * is always set to a value between 0 and (<code>dataProvider.length</code> - 1).
  4146. * @version Egret 2.4
  4147. * @version eui 1.0
  4148. * @platform Web,Native
  4149. * @language en_US
  4150. */
  4151. /**
  4152. * 如果为 true,则控件中必须含有选中的数据项目。
  4153. * 如果该值为 true,则始终将 selectedIndex 属性设置为 0 和 (dataProvider.length - 1) 之间的一个值。
  4154. * @version Egret 2.4
  4155. * @version eui 1.0
  4156. * @platform Web,Native
  4157. * @language zh_CN
  4158. */
  4159. requireSelection: boolean;
  4160. /**
  4161. * he 0-based index of the selected item, or -1 if no item is selected.
  4162. * Setting the <code>selectedIndex</code> property deselects the currently selected
  4163. * item and selects the data item at the specified index.<p/>
  4164. *
  4165. * The value is always between -1 and (<code>dataProvider.length</code> - 1).
  4166. * If items at a lower index than <code>selectedIndex</code> are
  4167. * removed from the component, the selected index is adjusted downward
  4168. * accordingly. <p/>
  4169. *
  4170. * If the selected item is removed, the selected index is set to:<p/>
  4171. *
  4172. * <ul>
  4173. * <li>-1 if <code>requireSelection == false</code> or there are no remaining items.</li>
  4174. * <li>0 if <code>requireSelection == true</code> and there is at least one item.</li>
  4175. * </ul><p/>
  4176. *
  4177. * When the user changes the <code>selectedIndex</code> property by interacting with the control,
  4178. * the control dispatches the <code>change</code> and <code>changing</code> events.
  4179. * When you change the value of the <code>selectedIndex</code> property programmatically,
  4180. * it does not dispatches the <code>change</code> and <code>changing</code> events.</p>
  4181. *
  4182. * @default -1
  4183. * @version Egret 2.4
  4184. * @version eui 1.0
  4185. * @platform Web,Native
  4186. * @language en_US
  4187. */
  4188. /**
  4189. * 选中项目的基于 0 的索引。
  4190. * 或者如果未选中项目,则为-1。设置 selectedIndex 属性会取消选择当前选定的项目并选择指定索引位置的数据项目。<p/>
  4191. *
  4192. * 这个值会之中在-1到<code>(dataProvider.length - 1)</code>之间。如果从该组件中删除一个低于
  4193. * <code>selectedIndex</code>的值,则<code>selectedIndex</code>也会相应的调节选定的索引。<p/>
  4194. *
  4195. * 如果删除的项为当前选中项,则该值会变为:<p/>
  4196. *
  4197. * <ul>
  4198. * <li>-1: 如果 <code>requireSelection == false</code> 或者已经没有剩余项目。</li>
  4199. * <li> 0: 如果 <code>requireSelection == true</code> 并且当前至少还有一个剩余项目。</li>
  4200. * </ul><p/>
  4201. * 当用户通过与控件交互来更改 selectedIndex 属性时,此控件将分派 change 和 changing 事件。
  4202. * 当以编程方式更改 selectedIndex 属性的值时,此控件不分派 change 和 changing 事件。
  4203. *
  4204. * @default -1
  4205. * @version Egret 2.4
  4206. * @version eui 1.0
  4207. * @platform Web,Native
  4208. * @language zh_CN
  4209. */
  4210. selectedIndex: number;
  4211. /**
  4212. * @private
  4213. *
  4214. * @returns
  4215. */
  4216. $getSelectedIndex(): number;
  4217. /**
  4218. * Used internally to specify whether the selectedIndex changed programmatically or due to
  4219. * user interaction.
  4220. * @param value the new index need to select.
  4221. * @param dispatchChangeEvent if true, the component will dispatch a "change" event if the
  4222. * value has changed.
  4223. * @version Egret 2.4
  4224. * @version eui 1.0
  4225. * @platform Web,Native
  4226. * @language en_US
  4227. */
  4228. /**
  4229. * 由程序或者用户设置选中项。
  4230. * @param value 索引值。
  4231. * @param dispatchChangeEvent 当索引值发生改变,且该参数为true的时候,组件派发出一个“change”事件。
  4232. * @version Egret 2.4
  4233. * @version eui 1.0
  4234. * @platform Web,Native
  4235. * @language zh_CN
  4236. */
  4237. protected setSelectedIndex(value: number, dispatchChangeEvent?: boolean): void;
  4238. /**
  4239. * The item that is currently selected.
  4240. * Setting this property deselects the currently selected
  4241. * item and selects the newly specified item.<p/>
  4242. *
  4243. * Setting <code>selectedItem</code> to an item that is not
  4244. * in this component results in no selection,
  4245. * and <code>selectedItem</code> being set to <code>undefined</code>.<p/>
  4246. *
  4247. * If the selected item is removed, the selected item is set to:<p/>
  4248. * <ul>
  4249. * <li><code>undefined</code> if <code>requireSelection == false</code>
  4250. * or there are no remaining items.</li>
  4251. * <li>The first item if <code>requireSelection</code> = <code>true</code>
  4252. * and there is at least one item.</li>
  4253. * </ul><p/>
  4254. *
  4255. * When the user changes the <code>selectedItem</code> property by interacting with the control,
  4256. * the control dispatches the <code>change</code> and <code>changing</code> events.
  4257. * When you change the value of the <code>selectedIndex</code> property programmatically,
  4258. * it does not dispatches the <code>change</code> and <code>changing</code> events.</p>
  4259. *
  4260. * @default undefined
  4261. * @version Egret 2.4
  4262. * @version eui 1.0
  4263. * @platform Web,Native
  4264. * @language en_US
  4265. */
  4266. /**
  4267. * 当前已选中的项目。设置此属性会取消选中当前选定的项目并选择新指定的项目。<p/>
  4268. *
  4269. * 如果设置的<code>selectedItem</code>不在当前列表里那么<code>selectedItem</code>将被设置
  4270. * 为<code>undefined</code>。<p/>
  4271. *
  4272. * 如果选择项目被移除,那选择项会被设置为:<p/>
  4273. * <ul>
  4274. * <li><code>undefined</code>: 如果 <code>requireSelection == false</code>
  4275. * 或者已经没有剩余项。</li>
  4276. * <li>第一项: 当 <code>requireSelection == true</code>
  4277. * 并且列表中还至少存有一项.</li>
  4278. * </ul><p/>
  4279. *
  4280. * 当用户通过与控件交互来更改 selectedItem 属性时,此控件将分派 change 和 changing 事件。
  4281. * 当以编程方式更改 selectedItem 属性的值时,此控件不分派 change 和 changing 事件。<p/>
  4282. *
  4283. * @default undefined
  4284. * @version Egret 2.4
  4285. * @version eui 1.0
  4286. * @platform Web,Native
  4287. * @language zh_CN
  4288. */
  4289. selectedItem: any;
  4290. /**
  4291. * Used internally to specify whether the selectedItem changed programmatically or due to
  4292. * user interaction.
  4293. * @param value the new item need to select.
  4294. * @param dispatchChangeEvent if true, the component will dispatch a "change" event if the
  4295. * @version Egret 2.4
  4296. * @version eui 1.0
  4297. * @platform Web,Native
  4298. * @language en_US
  4299. */
  4300. /**
  4301. * 由程序或用户设置选中项数据源。
  4302. * @param value 要选中的项。
  4303. * @param dispatchChangeEvent 当索引值发生改变,且该参数为true的时候,组件派发出一个“change”事件。
  4304. * @version Egret 2.4
  4305. * @version eui 1.0
  4306. * @platform Web,Native
  4307. * @language zh_CN
  4308. */
  4309. protected setSelectedItem(value: any, dispatchChangeEvent?: boolean): void;
  4310. /**
  4311. * Processes the properties set on the component.
  4312. * @version Egret 2.4
  4313. * @version eui 1.0
  4314. * @platform Web,Native
  4315. * @language en_US
  4316. */
  4317. /**
  4318. * 处理对组件设置的属性
  4319. * @version Egret 2.4
  4320. * @version eui 1.0
  4321. * @platform Web,Native
  4322. * @language zh_CN
  4323. */
  4324. protected commitProperties(): void;
  4325. /**
  4326. * Updates an item renderer for use or reuse.
  4327. * @version Egret 2.4
  4328. * @version eui 1.0
  4329. * @platform Web,Native
  4330. * @language en_US
  4331. */
  4332. /**
  4333. * 更新项呈示器,以备使用或重用
  4334. * @version Egret 2.4
  4335. * @version eui 1.0
  4336. * @platform Web,Native
  4337. * @language zh_CN
  4338. */
  4339. updateRenderer(renderer: IItemRenderer, itemIndex: number, data: any): IItemRenderer;
  4340. /**
  4341. * Called when an item is selected or deselected.
  4342. * Subclasses must override this method to display the selection.
  4343. * @param index The item index that was selected.
  4344. * @param selected <code>true</code> if the item is selected,
  4345. * and <code>false</code> if it is deselected.
  4346. * @version Egret 2.4
  4347. * @version eui 1.0
  4348. * @platform Web,Native
  4349. * @language en_US
  4350. */
  4351. /**
  4352. * 选中或取消选中项目时调用。子类必须覆盖此方法才可设置选中项。
  4353. * @param index 已选中的项目索引。
  4354. * @param selected <code>true</code>为选中,<code>false</code>取消选中
  4355. * @version Egret 2.4
  4356. * @version eui 1.0
  4357. * @platform Web,Native
  4358. * @language zh_CN
  4359. */
  4360. protected itemSelected(index: number, selected: boolean): void;
  4361. /**
  4362. * @private
  4363. * 返回指定索引是否等于当前选中索引
  4364. */
  4365. $isItemIndexSelected(index: number): boolean;
  4366. /**
  4367. * The selection validation and commitment workhorse method.
  4368. * Called to commit the pending selected index. This method dispatches
  4369. * the "changing" event, and if the event is not cancelled,
  4370. * commits the selection change and then dispatches the "change"
  4371. * event.
  4372. * @param dispatchChangedEvents if dispatch a "changed" event.
  4373. * @return true if the selection was committed, or false if the selection
  4374. * was cancelled.
  4375. * @version Egret 2.4
  4376. * @version eui 1.0
  4377. * @platform Web,Native
  4378. * @language en_US
  4379. */
  4380. /**
  4381. * 提交选中项属性。该方法会派发一个“changing”事件,如果该事件没有被阻止,
  4382. * 该方法将会提交选择项病根据参数派发“change”事件。
  4383. * @param dispatchChangedEvents 是否派发一个“changed”事件。
  4384. * @return true 表示提交成功, false表示被取消
  4385. * @version Egret 2.4
  4386. * @version eui 1.0
  4387. * @platform Web,Native
  4388. * @language zh_CN
  4389. */
  4390. protected commitSelection(dispatchChangedEvents?: boolean): boolean;
  4391. /**
  4392. * Adjusts the selected index to account for items being added to or
  4393. * removed from this component.
  4394. * It does not dispatch a <code>change</code> event because the change did not
  4395. * occur as a direct result of user-interaction. Moreover,
  4396. * it does not dispatch a <code>changing</code> event
  4397. * or allow the cancellation of the selection.
  4398. * It also does not call the <code>itemSelected()</code> method,
  4399. * since the same item is selected;
  4400. * @param newIndex The new index.
  4401. * @param add <code>true</code> if an item was added to the component,
  4402. * and <code>false</code> if an item was removed.
  4403. * @version Egret 2.4
  4404. * @version eui 1.0
  4405. * @platform Web,Native
  4406. * @language en_US
  4407. */
  4408. /**
  4409. * 仅调整选中索引值而不更新选中项,即在提交属性阶段itemSelected方法不会被调用,也不会触发changing和change事件。
  4410. * @param newIndex 新索引。
  4411. * @param add 如果已将项目添加到组件,则为<code>true</code>;如果已删除项目,则为<code>false</code>。
  4412. * @version Egret 2.4
  4413. * @version eui 1.0
  4414. * @platform Web,Native
  4415. * @language zh_CN
  4416. */
  4417. protected adjustSelection(newIndex: number, add?: boolean): void;
  4418. /**
  4419. * Called when an item has been added to this component. Selection
  4420. * and caret related properties are adjusted accordingly.
  4421. * @param item The item being added.
  4422. * @param index The index of the item being added.
  4423. * @version Egret 2.4
  4424. * @version eui 1.0
  4425. * @platform Web,Native
  4426. * @language en_US
  4427. */
  4428. /**
  4429. * 数据项添加
  4430. * @param item 被添加的项。
  4431. * @param index 被添加的项的索引。
  4432. * @version Egret 2.4
  4433. * @version eui 1.0
  4434. * @platform Web,Native
  4435. * @language zh_CN
  4436. */
  4437. protected itemAdded(item: any, index: number): void;
  4438. /**
  4439. * Called when an item has been removed from this component.
  4440. * Selection and caret related properties are adjusted
  4441. * accordingly.
  4442. * @param item The item being removed.
  4443. * @param index The index of the item being removed.
  4444. * @version Egret 2.4
  4445. * @version eui 1.0
  4446. * @platform Web,Native
  4447. * @language en_US
  4448. */
  4449. /**
  4450. * 数据项移除
  4451. * @param item 被移除的项。
  4452. * @param index 被移除的项的索引。
  4453. * @version Egret 2.4
  4454. * @version eui 1.0
  4455. * @platform Web,Native
  4456. * @language zh_CN
  4457. */
  4458. protected itemRemoved(item: any, index: number): void;
  4459. /**
  4460. * Event Listener of source data changed.
  4461. * @param The <code>egret.gui.CollectionEvent</code> object.
  4462. * @version Egret 2.4
  4463. * @version eui 1.0
  4464. * @platform Web,Native
  4465. * @language en_US
  4466. */
  4467. /**
  4468. * 数据源改变事件处理。
  4469. * @param event 事件 <code>egret.gui.CollectionEvent</code> 的对象。
  4470. * @version Egret 2.4
  4471. * @version eui 1.0
  4472. * @platform Web,Native
  4473. * @language zh_CN
  4474. */
  4475. protected onCollectionChange(event: CollectionEvent): void;
  4476. /**
  4477. * Default response to dataProvider refresh events: clear the selection and caret.
  4478. * @version Egret 2.4
  4479. * @version eui 1.0
  4480. * @platform Web,Native
  4481. * @language en_US
  4482. */
  4483. /**
  4484. * 数据源刷新时触发。此方法不从组件外部调用,仅用于编写自定义组件时,子类覆盖父类的此方法,以便在数据源发生改变时,自动执行一些额外的根据数据刷新视图的操作。
  4485. * @version Egret 2.4
  4486. * @version eui 1.0
  4487. * @platform Web,Native
  4488. * @language zh_CN
  4489. */
  4490. protected dataProviderRefreshed(): void;
  4491. /**
  4492. * Called when an item has been added to this component.
  4493. * @param renderer the renderer being added.
  4494. * @param index the index of renderer
  4495. * @param item the data of renderer
  4496. * @version Egret 2.4
  4497. * @version eui 1.0
  4498. * @platform Web,Native
  4499. * @language en_US
  4500. */
  4501. /**
  4502. * 项呈示器被添加
  4503. * @param renderer 添加的项呈示器
  4504. * @param index 项呈示器的索引
  4505. * @param item 项呈示器对应的数据
  4506. * @version Egret 2.4
  4507. * @version eui 1.0
  4508. * @platform Web,Native
  4509. * @language zh_CN
  4510. */
  4511. protected rendererAdded(renderer: IItemRenderer, index: number, item: any): void;
  4512. /**
  4513. * Called when an item has been removed to this component.
  4514. * @param renderer the renderer being removed.
  4515. * @param index the index of renderer.
  4516. * @param item the data of renderer.
  4517. * @version Egret 2.4
  4518. * @version eui 1.0
  4519. * @platform Web,Native
  4520. * @language en_US
  4521. */
  4522. /**
  4523. * 项呈示器被移除
  4524. * @param renderer 移除的项呈示器
  4525. * @param index 项呈示器的索引
  4526. * @param item 项呈示器对应的数据
  4527. * @version Egret 2.4
  4528. * @version eui 1.0
  4529. * @platform Web,Native
  4530. * @language zh_CN
  4531. */
  4532. protected rendererRemoved(renderer: IItemRenderer, index: number, item: any): void;
  4533. /**
  4534. * Handles <code>egret.TouchEvent.TOUCH_BEGIN</code> events from any of the
  4535. * item renderers. This method handles <code>egret.TouchEvent.TOUCH_END</code>.
  4536. * @param event The <code>egret.TouchEvent</code> object.
  4537. * @version Egret 2.4
  4538. * @version eui 1.0
  4539. * @platform Web,Native
  4540. * @language en_US
  4541. */
  4542. /**
  4543. * 侦听项呈示器<code>egret.TouchEvent.TOUCH_BEGIN</code>事件的方法。同时会添加对舞台<code>egret.TouchEvent.TOUCH_END</code>
  4544. * 事件的侦听。
  4545. * @param event 事件<code>egret.TouchEvent</code>的对象。
  4546. * @version Egret 2.4
  4547. * @version eui 1.0
  4548. * @platform Web,Native
  4549. * @language zh_CN
  4550. */
  4551. protected onRendererTouchBegin(event: egret.TouchEvent): void;
  4552. /**
  4553. * Handles <code>egret.TouchEvent.TOUCH_CANCEL</code> events from any of the
  4554. * item renderers. This method will cancel the handles <code>egret.TouchEvent.TOUCH_END</code> and <code>egret.TouchEvent.TOUCH_TAP</code>.
  4555. * @param event The <code>egret.TouchEvent</code> object.
  4556. * @version Egret 3.0.1
  4557. * @version eui 1.0
  4558. * @platform Web,Native
  4559. * @language en_US
  4560. */
  4561. /**
  4562. * 侦听项呈示器<code>egret.TouchEvent.TOUCH_CANCEL</code>事件的方法。触发时会取消对舞台<code>egret.TouchEvent.TOUCH_END</code>
  4563. * 和<code>egret.TouchEvent.TOUCH_TAP</code>事件的侦听。
  4564. * @param event 事件<code>egret.TouchEvent</code>的对象。
  4565. * @version Egret 3.0.1
  4566. * @version eui 1.0
  4567. * @platform Web,Native
  4568. * @language zh_CN
  4569. */
  4570. protected onRendererTouchCancle(event: egret.TouchEvent): void;
  4571. /**
  4572. * Handles <code>egret.TouchEvent.TOUCH_END</code> events and dispatch <code>ItemTapEvent.ITEM_TAP</code> event.
  4573. * @param event The <code>egret.TouchEvent</code> object.
  4574. * @version Egret 2.4
  4575. * @version eui 1.0
  4576. * @platform Web,Native
  4577. * @language en_US
  4578. */
  4579. /**
  4580. * 触摸在项呈示器上结束,抛出<code>ItemTapEvent.ITEM_TAP</code>事件。
  4581. * @param event 事件<code>egret.TouchEvent</code>的对象。
  4582. * @version Egret 2.4
  4583. * @version eui 1.0
  4584. * @platform Web,Native
  4585. * @language zh_CN
  4586. */
  4587. protected onRendererTouchEnd(event: egret.TouchEvent): void;
  4588. /**
  4589. * @private
  4590. * 触摸在舞台上结束
  4591. */
  4592. private stage_touchEndHandler(event);
  4593. }
  4594. }
  4595. declare namespace eui {
  4596. /**
  4597. * The ScrollBarBase class helps to position
  4598. * the portion of data that is displayed when there is too much data
  4599. * to fit in a display area.
  4600. * The ScrollBarBase class displays a pair of viewport and a thumb.
  4601. * viewport is a instance that implements IViewport.
  4602. *
  4603. * @see eui.IViewport
  4604. *
  4605. * @version Egret 2.4
  4606. * @version eui 1.0
  4607. * @platform Web,Native
  4608. * @language en_US
  4609. */
  4610. /**
  4611. * <code>ScrollBarBase</code> 滚动条基类,该类帮助在因数据太多而不能在显示区域完全显示时定位显示的数据部分。
  4612. * ScrollBarBase 类显示视区的一部分和一个指示滑块。
  4613. * 视区是一个IViewport接口实现的实例。
  4614. *
  4615. * @see eui.IViewport
  4616. *
  4617. * @version Egret 2.4
  4618. * @version eui 1.0
  4619. * @platform Web,Native
  4620. * @language zh_CN
  4621. */
  4622. class ScrollBarBase extends Component {
  4623. /**
  4624. * Constructor.
  4625. * @version Egret 2.4
  4626. * @version eui 1.0
  4627. * @platform Web,Native
  4628. * @language en_US
  4629. */
  4630. /**
  4631. * 创建一个ScrollBarBase实例。
  4632. * @version Egret 2.4
  4633. * @version eui 1.0
  4634. * @platform Web,Native
  4635. * @language zh_CN
  4636. */
  4637. constructor();
  4638. /**
  4639. * [SkinPart] Thumb display object.
  4640. * @skinPart
  4641. * @version Egret 2.4
  4642. * @version eui 1.0
  4643. * @platform Web,Native
  4644. * @language en_US
  4645. */
  4646. /**
  4647. * [SkinPart]滑块显示对象。
  4648. * @skinPart
  4649. * @version Egret 2.4
  4650. * @version eui 1.0
  4651. * @platform Web,Native
  4652. * @language zh_CN
  4653. */
  4654. thumb: eui.UIComponent;
  4655. /**
  4656. * @private
  4657. */
  4658. $viewport: IViewport;
  4659. /**
  4660. * The viewport controlled by this scrollbar.
  4661. *
  4662. * If a viewport is specified, then changes to its actual size, content
  4663. * size, and scroll position cause the corresponding ScrollBarBase methods to
  4664. * run:
  4665. * <ul>
  4666. * <li><code>onViewportResize()</code></li>
  4667. * <li><code>onPropertyChanged()</code></li>
  4668. * </ul><p/>
  4669. *
  4670. * The VScrollBar and HScrollBar classes override these methods to keep their properties in
  4671. * sync with the viewport.
  4672. *
  4673. * @default null
  4674. * @see eui.VScrollBar
  4675. * @see eui.HScrollBar
  4676. *
  4677. * @version Egret 2.4
  4678. * @version eui 1.0
  4679. * @platform Web,Native
  4680. * @language en_US
  4681. */
  4682. /**
  4683. * 由该滚动条控制的视区。
  4684. *
  4685. * 如果指定了视区,则对其实际大小、内容大小和滚动位置的更改会导致运行相对应的 ScrollBarBase 方法:
  4686. * <ul>
  4687. * <li><code>onViewportResize()</code></li>
  4688. * <li><code>onPropertyChanged()</code></li>
  4689. * </ul><p/>
  4690. *
  4691. * VScrollBar 和 HScrollBar 类需要重写这些方法以保证属性与视区的同步。
  4692. *
  4693. * @default null
  4694. * @see eui.VScrollBar
  4695. * @see eui.HScrollBar
  4696. *
  4697. * @version Egret 2.4
  4698. * @version eui 1.0
  4699. * @platform Web,Native
  4700. * @language zh_CN
  4701. */
  4702. viewport: IViewport;
  4703. /**
  4704. * @private
  4705. *
  4706. * @param event
  4707. */
  4708. private onViewportResize(event?);
  4709. /**
  4710. * Properties of viewport changed.
  4711. * @param event
  4712. * @version Egret 2.4
  4713. * @version eui 1.0
  4714. * @platform Web,Native
  4715. * @language en_US
  4716. */
  4717. /**
  4718. * 视区属性发生改变。
  4719. * @param event
  4720. * @version Egret 2.4
  4721. * @version eui 1.0
  4722. * @platform Web,Native
  4723. * @language zh_CN
  4724. */
  4725. protected onPropertyChanged(event: eui.PropertyEvent): void;
  4726. /**
  4727. * Whether the scrollbar can be autohide.
  4728. * @version Egret 3.0.2
  4729. * @version eui 1.0
  4730. * @platform Web,Native
  4731. * @language en_US
  4732. */
  4733. /**
  4734. * 是否自动隐藏 scrollbar
  4735. * @version Egret 3.0.2
  4736. * @version eui 1.0
  4737. * @platform Web,Native
  4738. * @language zh_CN
  4739. */
  4740. autoVisibility: boolean;
  4741. }
  4742. }
  4743. declare namespace eui {
  4744. /**
  4745. * @private
  4746. */
  4747. const enum Keys {
  4748. clickOffsetX = 0,
  4749. clickOffsetY = 1,
  4750. moveStageX = 2,
  4751. moveStageY = 3,
  4752. touchDownTarget = 4,
  4753. animation = 5,
  4754. slideDuration = 6,
  4755. pendingValue = 7,
  4756. slideToValue = 8,
  4757. liveDragging = 9,
  4758. }
  4759. /**
  4760. * The SliderBase class lets users select a value by moving a slider thumb between
  4761. * the end points of the slider track.
  4762. * The current value of the slider is determined by the relative location of
  4763. * the thumb between the end points of the slider,
  4764. * corresponding to the slider's minimum and maximum values.
  4765. * The SliderBase class is a base class for HSlider and VSlider.
  4766. *
  4767. * @event eui.UIEvent.CHANGE_START Dispatched when the scroll position is going to change
  4768. * @event eui.UIEvent.CHANGE_END Dispatched when the scroll position changed complete
  4769. * @event egret.Event.CHANGE Dispatched when the scroll position is changing
  4770. *
  4771. * @see eui.HSlider
  4772. * @see eui.VSlider
  4773. *
  4774. * @version Egret 2.4
  4775. * @version eui 1.0
  4776. * @platform Web,Native
  4777. * @language en_US
  4778. */
  4779. /**
  4780. * 滑块控件基类,通过使用 SliderBase 类,用户可以在滑块轨道的端点之间移动滑块来选择值。
  4781. * 滑块的当前值由滑块端点(对应于滑块的最小值和最大值)之间滑块的相对位置确定。
  4782. * SliderBase 类是 HSlider 和 VSlider 的基类。
  4783. *
  4784. * @event eui.UIEvent.CHANGE_START 滚动位置改变开始
  4785. * @event eui.UIEvent.CHANGE_END 滚动位置改变结束
  4786. * @event egret.Event.CHANGE 滚动位置改变的时候
  4787. *
  4788. * @see eui.HSlider
  4789. * @see eui.VSlider
  4790. *
  4791. * @version Egret 2.4
  4792. * @version eui 1.0
  4793. * @platform Web,Native
  4794. * @language zh_CN
  4795. */
  4796. class SliderBase extends Range {
  4797. /**
  4798. * Constructor
  4799. * @version Egret 2.4
  4800. * @version eui 1.0
  4801. * @platform Web,Native
  4802. * @language en_US
  4803. */
  4804. /**
  4805. * 创建一个 SliderBase 实例
  4806. * @version Egret 2.4
  4807. * @version eui 1.0
  4808. * @platform Web,Native
  4809. * @language zh_CN
  4810. */
  4811. constructor();
  4812. /**
  4813. * @private
  4814. */
  4815. $SliderBase: Object;
  4816. /**
  4817. * [SkinPart] Highlight of track.
  4818. * @skinPart
  4819. * @version Egret 2.4
  4820. * @version eui 1.0
  4821. * @platform Web,Native
  4822. * @language en_US
  4823. */
  4824. /**
  4825. * [SkinPart] 轨道高亮显示对象。
  4826. * @skinPart
  4827. * @version Egret 2.4
  4828. * @version eui 1.0
  4829. * @platform Web,Native
  4830. * @language zh_CN
  4831. */
  4832. trackHighlight: egret.DisplayObject;
  4833. /**
  4834. * [SkinPart] Thumb display object.
  4835. * @skinPart
  4836. * @version Egret 2.4
  4837. * @version eui 1.0
  4838. * @platform Web,Native
  4839. * @language en_US
  4840. */
  4841. /**
  4842. * [SkinPart]滑块显示对象。
  4843. * @skinPart
  4844. * @version Egret 2.4
  4845. * @version eui 1.0
  4846. * @platform Web,Native
  4847. * @language zh_CN
  4848. */
  4849. thumb: eui.UIComponent;
  4850. /**
  4851. * [SkinPart] Track display object.
  4852. * @skinPart
  4853. * @version Egret 2.4
  4854. * @version eui 1.0
  4855. * @platform Web,Native
  4856. * @language en_US
  4857. */
  4858. /**
  4859. * [SkinPart]轨道显示对象。
  4860. * @skinPart
  4861. * @version Egret 2.4
  4862. * @version eui 1.0
  4863. * @platform Web,Native
  4864. * @language zh_CN
  4865. */
  4866. track: eui.UIComponent;
  4867. /**
  4868. * Duration in milliseconds for the sliding animation when you tap on the track to move a thumb.
  4869. *
  4870. * @default 300
  4871. *
  4872. * @version Egret 2.4
  4873. * @version eui 1.0
  4874. * @platform Web,Native
  4875. * @language en_US
  4876. */
  4877. /**
  4878. * 在轨道上单击以移动滑块时,滑动动画持续的时间(以毫秒为单位)。设置为0将不执行缓动。
  4879. *
  4880. * @default 300
  4881. *
  4882. * @version Egret 2.4
  4883. * @version eui 1.0
  4884. * @platform Web,Native
  4885. * @language zh_CN
  4886. */
  4887. slideDuration: number;
  4888. /**
  4889. * Converts a track-relative x,y pixel location into a value between
  4890. * the minimum and maximum, inclusive.
  4891. *
  4892. * @param x The x coordinate of the location relative to the track's origin.
  4893. * @param y The y coordinate of the location relative to the track's origin.
  4894. * @return A value between the minimum and maximum, inclusive.
  4895. *
  4896. * @version Egret 2.4
  4897. * @version eui 1.0
  4898. * @platform Web,Native
  4899. * @language en_US
  4900. */
  4901. /**
  4902. * 将相对于轨道的 x,y 像素位置转换为介于最小值和最大值(包括两者)之间的一个值。
  4903. *
  4904. * @param x 相对于轨道原点的位置的x坐标。
  4905. * @param y 相对于轨道原点的位置的y坐标。
  4906. * @return 介于最小值和最大值(包括两者)之间的一个值。
  4907. *
  4908. * @version Egret 2.4
  4909. * @version eui 1.0
  4910. * @platform Web,Native
  4911. * @language zh_CN
  4912. */
  4913. protected pointToValue(x: number, y: number): number;
  4914. /**
  4915. * Specifies whether live dragging is enabled for the slider. If true, sets the value
  4916. * and values properties and dispatches the change event continuously as
  4917. * the user moves the thumb.
  4918. *
  4919. * @default true
  4920. *
  4921. * @version Egret 2.4
  4922. * @version eui 1.0
  4923. * @platform Web,Native
  4924. * @language en_US
  4925. */
  4926. /**
  4927. * 如果为 true,则将在沿着轨道拖动滑块时,而不是在释放滑块按钮时,提交此滑块的值。
  4928. *
  4929. * @default true
  4930. *
  4931. * @version Egret 2.4
  4932. * @version eui 1.0
  4933. * @platform Web,Native
  4934. * @language zh_CN
  4935. */
  4936. liveDragging: boolean;
  4937. /**
  4938. * The value the slider will have when the touch is end.
  4939. * This property is updated when the slider thumb moves, even if <code>liveDragging</code> is false.<p/>
  4940. * If the <code>liveDragging</code> style is false, then the slider's value is only set
  4941. * when the touch is end.
  4942. *
  4943. * @default 0
  4944. *
  4945. * @version Egret 2.4
  4946. * @version eui 1.0
  4947. * @platform Web,Native
  4948. * @language en_US
  4949. */
  4950. /**
  4951. * 触摸结束时滑块将具有的值。
  4952. * 无论 liveDragging 是否为 true,在滑块拖动期间始终更新此属性。
  4953. * 而 value 属性在当 liveDragging 为 false 时,只在触摸释放时更新一次。
  4954. *
  4955. * @default 0
  4956. *
  4957. * @version Egret 2.4
  4958. * @version eui 1.0
  4959. * @platform Web,Native
  4960. * @language zh_CN
  4961. */
  4962. pendingValue: number;
  4963. /**
  4964. * @inheritDoc
  4965. *
  4966. * @version Egret 2.4
  4967. * @version eui 1.0
  4968. * @platform Web,Native
  4969. */
  4970. protected setValue(value: number): void;
  4971. /**
  4972. * @inheritDoc
  4973. *
  4974. * @version Egret 2.4
  4975. * @version eui 1.0
  4976. * @platform Web,Native
  4977. */
  4978. protected partAdded(partName: string, instance: any): void;
  4979. /**
  4980. * @inheritDoc
  4981. *
  4982. * @version Egret 2.4
  4983. * @version eui 1.0
  4984. * @platform Web,Native
  4985. */
  4986. protected partRemoved(partName: string, instance: any): void;
  4987. /**
  4988. * @private
  4989. * 滑块或轨道尺寸改变事件
  4990. */
  4991. private onTrackOrThumbResize(event);
  4992. /**
  4993. * Handle touch-begin events on the scroll thumb. Records the touch begin point in clickOffset.
  4994. *
  4995. * @param The <code>egret.TouchEvent</code> object.
  4996. *
  4997. * @version Egret 2.4
  4998. * @version eui 1.0
  4999. * @platform Web,Native
  5000. * @language en_US
  5001. */
  5002. /**
  5003. * 滑块触摸开始事件,记录触碰开始的坐标偏移量。
  5004. *
  5005. * @param event 事件 <code>egret.TouchEvent</code> 的对象.
  5006. *
  5007. * @version Egret 2.4
  5008. * @version eui 1.0
  5009. * @platform Web,Native
  5010. * @language zh_CN
  5011. */
  5012. protected onThumbTouchBegin(event: egret.TouchEvent): void;
  5013. /**
  5014. * @private
  5015. * 舞台上触摸移动事件
  5016. */
  5017. private onStageTouchMove(event);
  5018. /**
  5019. * Capture touch-move events anywhere on or off the stage.
  5020. * @param newValue new value
  5021. * @version Egret 2.4
  5022. * @version eui 1.0
  5023. * @platform Web,Native
  5024. * @language en_US
  5025. */
  5026. /**
  5027. * 监听舞台的触碰移动事件。
  5028. * @param newValue 新的值
  5029. * @version Egret 2.4
  5030. * @version eui 1.0
  5031. * @platform Web,Native
  5032. * @language zh_CN
  5033. */
  5034. protected updateWhenTouchMove(newValue: number): void;
  5035. /**
  5036. * Handle touch-end events anywhere on or off the stage.
  5037. *
  5038. * @param The <code>egret.Event</code> object.
  5039. *
  5040. * @version Egret 2.4
  5041. * @version eui 1.0
  5042. * @platform Web,Native
  5043. * @language en_US
  5044. */
  5045. /**
  5046. * 触摸结束事件
  5047. *
  5048. * @param event 事件 <code>egret.Event</code> 的对象。
  5049. *
  5050. * @version Egret 2.4
  5051. * @version eui 1.0
  5052. * @platform Web,Native
  5053. * @language zh_CN
  5054. */
  5055. protected onStageTouchEnd(event: egret.Event): void;
  5056. /**
  5057. * @private
  5058. * 当在组件上按下时记录被按下的子显示对象
  5059. */
  5060. private onTouchBegin(event);
  5061. /**
  5062. * @private
  5063. * 当结束时,若不是在 touchDownTarget 上弹起,而是另外的子显示对象上弹起时,额外抛出一个触摸单击事件。
  5064. */
  5065. private stageTouchEndHandler(event);
  5066. /**
  5067. * @private
  5068. * 动画播放更新数值
  5069. */
  5070. $animationUpdateHandler(animation: sys.Animation): void;
  5071. /**
  5072. * @private
  5073. * 动画播放完毕
  5074. */
  5075. private animationEndHandler(animation);
  5076. /**
  5077. * @private
  5078. * 停止播放动画
  5079. */
  5080. private stopAnimation();
  5081. /**
  5082. * Handle touch-begin events for the slider track. We
  5083. * calculate the value based on the new position and then
  5084. * move the thumb to the correct location as well as
  5085. * commit the value.
  5086. * @param The <code>egret.TouchEvent</code> object.
  5087. * @version Egret 2.4
  5088. * @version eui 1.0
  5089. * @platform Web,Native
  5090. * @language en_US
  5091. */
  5092. /**
  5093. * 轨道的触碰开始事件。我们会在这里根据新的坐标位置计算value,然后移动滑块到当前位置。
  5094. *
  5095. * @param event 事件 <code>egret.TouchEvent</code> 的对象.
  5096. *
  5097. * @version Egret 2.4
  5098. * @version eui 1.0
  5099. * @platform Web,Native
  5100. * @language zh_CN
  5101. */
  5102. protected onTrackTouchBegin(event: egret.TouchEvent): void;
  5103. }
  5104. }
  5105. declare namespace eui.sys {
  5106. /**
  5107. * @private
  5108. * EXML配置管理器实例
  5109. */
  5110. let exmlConfig: EXMLConfig;
  5111. /**
  5112. * @private
  5113. */
  5114. class EXMLParser {
  5115. /**
  5116. * @private
  5117. */
  5118. constructor();
  5119. /**
  5120. * @private
  5121. * 获取重复的ID名
  5122. */
  5123. getRepeatedIds: (xml: egret.XML) => string[];
  5124. /**
  5125. * @private
  5126. */
  5127. private getIds;
  5128. /**
  5129. * @private
  5130. */
  5131. private repeatedIdMap;
  5132. /**
  5133. * @private
  5134. */
  5135. private checkDeclarations;
  5136. /**
  5137. * @private
  5138. * 当前类
  5139. */
  5140. private currentClass;
  5141. /**
  5142. * 当前exml的根节点是否为Skin
  5143. */
  5144. private isSkinClass;
  5145. /**
  5146. * @private
  5147. * 当前编译的类名
  5148. */
  5149. private currentClassName;
  5150. /**
  5151. * @private
  5152. * 当前要编译的EXML文件
  5153. */
  5154. private currentXML;
  5155. /**
  5156. * @private
  5157. * id缓存字典
  5158. */
  5159. private idDic;
  5160. /**
  5161. * @private
  5162. * 状态代码列表
  5163. */
  5164. private stateCode;
  5165. /**
  5166. * @private
  5167. */
  5168. private stateNames;
  5169. /**
  5170. * @private
  5171. * 需要单独创建的实例id列表
  5172. */
  5173. private stateIds;
  5174. /**
  5175. * @private
  5176. */
  5177. private skinParts;
  5178. /**
  5179. * @private
  5180. */
  5181. private bindings;
  5182. /**
  5183. * @private
  5184. */
  5185. private declarations;
  5186. /**
  5187. * @private
  5188. * 延迟赋值字典
  5189. */
  5190. private delayAssignmentDic;
  5191. /**
  5192. * @private
  5193. * 将已有javascript代码注册
  5194. * @param codeText 执行的javascript代码
  5195. * @param classStr 类名
  5196. */
  5197. $parseCode(codeText: string, classStr: string): {
  5198. new (): any;
  5199. };
  5200. /**
  5201. * @private
  5202. * 编译指定的XML对象为JavaScript代码。
  5203. * @param xmlData 要编译的EXML文件内容
  5204. *
  5205. */
  5206. parse(text: string): {
  5207. new (): any;
  5208. };
  5209. /**
  5210. * @private
  5211. * 编译指定的XML对象为CpClass对象。
  5212. */
  5213. private parseClass(xmlData, className);
  5214. /**
  5215. * @private
  5216. * 开始编译
  5217. */
  5218. private startCompile();
  5219. /**
  5220. * @private
  5221. * 添加必须的id
  5222. */
  5223. private addIds(items);
  5224. /**
  5225. * @private
  5226. * 是否为内部类。
  5227. */
  5228. private isInnerClass(node);
  5229. /**
  5230. * @private
  5231. * 检测指定节点的属性是否含有视图状态
  5232. */
  5233. private containsState(node);
  5234. /**
  5235. * @private
  5236. * 为指定节点创建id属性
  5237. */
  5238. private createIdForNode(node);
  5239. /**
  5240. * @private
  5241. * 获取节点ID
  5242. */
  5243. private getNodeId(node);
  5244. /**
  5245. * @private
  5246. * 为指定节点创建变量
  5247. */
  5248. private createVarForNode(node);
  5249. /**
  5250. * @private
  5251. * 为指定节点创建初始化函数,返回函数名引用
  5252. */
  5253. private createFuncForNode(node);
  5254. /**
  5255. * @private
  5256. * 检查目标类名是否是基本数据类型
  5257. */
  5258. private isBasicTypeData(className);
  5259. /**
  5260. * @private
  5261. * 为指定基本数据类型节点实例化,返回实例化后的值。
  5262. */
  5263. private createBasicTypeForNode(node);
  5264. /**
  5265. * @private
  5266. * 将节点属性赋值语句添加到代码块
  5267. */
  5268. private addAttributesToCodeBlock(cb, varName, node);
  5269. /**
  5270. * @private
  5271. * 初始化子项
  5272. */
  5273. private initlizeChildNode(node, cb, varName);
  5274. /**
  5275. * @private
  5276. * 解析内部类节点,并返回类名。
  5277. */
  5278. private parseInnerClass(node);
  5279. /**
  5280. * @private
  5281. * 添加多个子节点到指定的属性
  5282. */
  5283. private addChildrenToProp(children, type, prop, cb, varName, errorInfo, propList, node);
  5284. /**
  5285. * @private
  5286. * 指定节点是否是属性节点
  5287. */
  5288. private isProperty(node);
  5289. /**
  5290. * @private
  5291. * 是否是普通赋值的key
  5292. */
  5293. private isNormalKey(key);
  5294. /**
  5295. * @private
  5296. * 格式化key
  5297. */
  5298. private formatKey(key, value);
  5299. /**
  5300. * @private
  5301. * 格式化值
  5302. */
  5303. private formatValue(key, value, node);
  5304. /**
  5305. * @private
  5306. * 格式化字符串
  5307. */
  5308. private formatString(value);
  5309. private formatBinding(key, value, node);
  5310. private parseTemplates(value);
  5311. /**
  5312. * @private
  5313. /**
  5314. * 转换HTML实体字符为普通字符
  5315. */
  5316. private unescapeHTMLEntity(str);
  5317. /**
  5318. * @private
  5319. * 创建构造函数
  5320. */
  5321. private createConstructFunc();
  5322. /**
  5323. * @private
  5324. * 是否含有includeIn和excludeFrom属性
  5325. */
  5326. private isStateNode(node);
  5327. /**
  5328. * @private
  5329. * 获取视图状态名称列表
  5330. */
  5331. private getStateNames();
  5332. /**
  5333. * @private
  5334. * 解析视图状态代码
  5335. */
  5336. private createStates(parentNode);
  5337. /**
  5338. * @private
  5339. * 检查指定的ID是否创建了类成员变量,若没创建则为其创建。
  5340. */
  5341. private checkIdForState(node);
  5342. /**
  5343. * @private
  5344. * 通过视图状态名称获取对应的视图状态
  5345. */
  5346. private getStateByName(name, node);
  5347. /**
  5348. * @private
  5349. * 寻找节点的临近节点ID和位置
  5350. */
  5351. private findNearNodeId(node);
  5352. /**
  5353. * @private
  5354. * 获取节点的完整类名,包括模块名
  5355. */
  5356. private getClassNameOfNode(node);
  5357. }
  5358. }
  5359. declare namespace eui {
  5360. /**
  5361. * The ToggleButton component defines a toggle button.
  5362. * Clicking the button toggles it between the up and an down states.
  5363. * If you click the button while it is in the up state,
  5364. * it toggles to the down state. You must click the button again
  5365. * to toggle it back to the up state.
  5366. * <p>You can get or set this state programmatically
  5367. * by using the <code>selected</code> property.</p>
  5368. *
  5369. * @event egret.Event.CHANGE Dispatched when the <code>selected</code> property
  5370. * changes for the ToggleButton control.
  5371. * This event is dispatched only when the
  5372. * user interacts with the control by touching.
  5373. *
  5374. * @state up Button up state
  5375. * @state down Button down state
  5376. * @state disabled Button disabled state
  5377. * @state upAndSelected Up state when the button is selected
  5378. * @state downAndSelected Down state when the button is selected
  5379. * @state disabledAndSelected Disabled state when the button is selected
  5380. * @version Egret 2.4
  5381. * @version eui 1.0
  5382. * @platform Web,Native
  5383. * @includeExample extension/eui/components/ToggleButtonExample.ts
  5384. * @language en_US
  5385. */
  5386. /**
  5387. * ToggleButton 组件定义切换按钮。单击该按钮会在弹起状态和按下状态之间进行切换。
  5388. * 如果在按钮处于弹起状态时单击该按钮,则它会切换到按下状态。必须再次单击该按钮才可将其切换回弹起状态。
  5389. * <p>可以使用 <code>selected</code> 属性以编程方式获取或设置此状态。</p>
  5390. *
  5391. * @event egret.Event.CHANGE ToggleButtonBase 控件的 <code>selected</code> 属性更改时分派。
  5392. * 仅当用户通过触摸与控件交互时,才分派此事件。
  5393. *
  5394. * @state up 按钮弹起状态
  5395. * @state down 按钮按下状态
  5396. * @state disabled 按钮禁用状态
  5397. * @state upAndSelected 按钮选择时的弹起状态
  5398. * @state downAndSelected 按钮选择时的按下状态
  5399. * @state disabledAndSelected 按钮选择时的禁用状态
  5400. * @version Egret 2.4
  5401. * @version eui 1.0
  5402. * @platform Web,Native
  5403. * @includeExample extension/eui/components/ToggleButtonExample.ts
  5404. * @language zh_CN
  5405. */
  5406. class ToggleButton extends Button {
  5407. /**
  5408. * @private
  5409. */
  5410. $selected: boolean;
  5411. /**
  5412. * Contains <code>true</code> if the button is in the down state,
  5413. * and <code>false</code> if it is in the up state.
  5414. *
  5415. * @version Egret 2.4
  5416. * @version eui 1.0
  5417. * @platform Web,Native
  5418. * @language en_US
  5419. */
  5420. /**
  5421. * 按钮处于按下状态时为 <code>true</code>,而按钮处于弹起状态时为 <code>false</code>。
  5422. *
  5423. * @version Egret 2.4
  5424. * @version eui 1.0
  5425. * @platform Web,Native
  5426. * @language zh_CN
  5427. */
  5428. selected: boolean;
  5429. /**
  5430. * @private
  5431. *
  5432. * @param value
  5433. */
  5434. $setSelected(value: boolean): boolean;
  5435. /**
  5436. * @inheritDoc
  5437. *
  5438. * @version Egret 2.4
  5439. * @version eui 1.0
  5440. * @platform Web,Native
  5441. */
  5442. protected getCurrentState(): string;
  5443. /**
  5444. * @private
  5445. * 是否根据触摸事件自动变换选中状态,默认true。仅框架内使用。
  5446. */
  5447. $autoSelected: boolean;
  5448. /**
  5449. * @inheritDoc
  5450. *
  5451. * @version Egret 2.4
  5452. * @version eui 1.0
  5453. * @platform Web,Native
  5454. */
  5455. protected buttonReleased(): void;
  5456. }
  5457. }
  5458. declare namespace eui {
  5459. /**
  5460. * Linear layout base class, usually as the parent class of
  5461. * <code>HorizontalLayout</code> and <code>VerticalLayout</code>.
  5462. *
  5463. * @version Egret 2.4
  5464. * @version eui 1.0
  5465. * @platform Web,Native
  5466. * @language en_US
  5467. */
  5468. /**
  5469. * 线性布局基类,通常作为 <code>HorizontalLayout</code> 和 <code>VerticalLayout</code> 的父类。
  5470. *
  5471. * @version Egret 2.4
  5472. * @version eui 1.0
  5473. * @platform Web,Native
  5474. * @language zh_CN
  5475. */
  5476. class LinearLayoutBase extends LayoutBase {
  5477. /**
  5478. * @private
  5479. */
  5480. $horizontalAlign: string;
  5481. /**
  5482. * The horizontal alignment of layout elements.
  5483. * <p>The <code>egret.HorizontalAlign</code> and <code>eui.JustifyAlign</code> class
  5484. * defines the possible values for this property.</p>
  5485. *
  5486. * @default "left"
  5487. *
  5488. * @version Egret 2.4
  5489. * @version eui 1.0
  5490. * @platform Web,Native
  5491. * @language en_US
  5492. */
  5493. /**
  5494. * 布局元素的水平对齐策略。
  5495. * <p><code>egret.HorizontalAlign</code> 和
  5496. * <code>eui.JustifyAlign</code>类定义此属性的可能值。<p>
  5497. *
  5498. * @default "left"
  5499. *
  5500. * @version Egret 2.4
  5501. * @version eui 1.0
  5502. * @platform Web,Native
  5503. * @language zh_CN
  5504. */
  5505. horizontalAlign: string;
  5506. /**
  5507. * @private
  5508. */
  5509. $verticalAlign: string;
  5510. /**
  5511. * The vertical alignment of layout elements.
  5512. * <p>The <code>egret.VerticalAlign</code> and <code>eui.JustifyAlign</code> class
  5513. * defines the possible values for this property.</p>
  5514. *
  5515. * @default "top"
  5516. *
  5517. * @version Egret 2.4
  5518. * @version eui 1.0
  5519. * @platform Web,Native
  5520. * @language en_US
  5521. */
  5522. /**
  5523. * 布局元素的垂直对齐策略。请使用 VerticalAlign 定义的常量。
  5524. * <p><code>egret.VerticalAlign</code> 和
  5525. * <code>eui.JustifyAlign</code>类定义此属性的可能值。<p>
  5526. *
  5527. * @default "top"
  5528. *
  5529. * @version Egret 2.4
  5530. * @version eui 1.0
  5531. * @platform Web,Native
  5532. * @language zh_CN
  5533. */
  5534. verticalAlign: string;
  5535. /**
  5536. * @private
  5537. */
  5538. $gap: number;
  5539. /**
  5540. * The space between layout elements, in pixels.
  5541. *
  5542. * @default 6
  5543. *
  5544. * @version Egret 2.4
  5545. * @version eui 1.0
  5546. * @platform Web,Native
  5547. * @language en_US
  5548. */
  5549. /**
  5550. * 布局元素之间的间隔(以像素为单位)。
  5551. *
  5552. * @default 6
  5553. *
  5554. * @version Egret 2.4
  5555. * @version eui 1.0
  5556. * @platform Web,Native
  5557. * @language zh_CN
  5558. */
  5559. gap: number;
  5560. /**
  5561. * @private
  5562. */
  5563. $paddingLeft: number;
  5564. /**
  5565. * Number of pixels between the container's left edge
  5566. * and the left edge of the first layout element.
  5567. *
  5568. * @default 0
  5569. *
  5570. * @version Egret 2.4
  5571. * @version eui 1.0
  5572. * @platform Web,Native
  5573. * @language en_US
  5574. */
  5575. /**
  5576. * 容器的左边缘与第一个布局元素的左边缘之间的像素数。
  5577. *
  5578. * @default 0
  5579. *
  5580. * @version Egret 2.4
  5581. * @version eui 1.0
  5582. * @platform Web,Native
  5583. * @language zh_CN
  5584. */
  5585. paddingLeft: number;
  5586. /**
  5587. * @private
  5588. */
  5589. $paddingRight: number;
  5590. /**
  5591. * Number of pixels between the container's right edge
  5592. * and the right edge of the last layout element.
  5593. *
  5594. * @default 0
  5595. *
  5596. * @version Egret 2.4
  5597. * @version eui 1.0
  5598. * @platform Web,Native
  5599. * @language en_US
  5600. */
  5601. /**
  5602. * 容器的右边缘与最后一个布局元素的右边缘之间的像素数。
  5603. *
  5604. * @default 0
  5605. *
  5606. * @version Egret 2.4
  5607. * @version eui 1.0
  5608. * @platform Web,Native
  5609. * @language zh_CN
  5610. */
  5611. paddingRight: number;
  5612. /**
  5613. * @private
  5614. */
  5615. $paddingTop: number;
  5616. /**
  5617. * The minimum number of pixels between the container's top edge and
  5618. * the top of all the container's layout elements.
  5619. *
  5620. * @default 0
  5621. *
  5622. * @version Egret 2.4
  5623. * @version eui 1.0
  5624. * @platform Web,Native
  5625. * @language en_US
  5626. */
  5627. /**
  5628. * 容器的顶边缘与所有容器的布局元素的顶边缘之间的最少像素数。
  5629. *
  5630. * @default 0
  5631. *
  5632. * @version Egret 2.4
  5633. * @version eui 1.0
  5634. * @platform Web,Native
  5635. * @language zh_CN
  5636. */
  5637. paddingTop: number;
  5638. /**
  5639. * @private
  5640. */
  5641. $paddingBottom: number;
  5642. /**
  5643. * The minimum number of pixels between the container's bottom edge and
  5644. * the bottom of all the container's layout elements.
  5645. *
  5646. * @default 0
  5647. *
  5648. * @version Egret 2.4
  5649. * @version eui 1.0
  5650. * @platform Web,Native
  5651. * @language en_US
  5652. */
  5653. /**
  5654. * 容器的底边缘与所有容器的布局元素的底边缘之间的最少像素数。
  5655. *
  5656. * @default 0
  5657. *
  5658. * @version Egret 2.4
  5659. * @version eui 1.0
  5660. * @platform Web,Native
  5661. * @language zh_CN
  5662. */
  5663. paddingBottom: number;
  5664. /**
  5665. * Convenience function for subclasses that invalidates the
  5666. * target's size and displayList so that both layout's <code>measure()</code>
  5667. * and <code>updateDisplayList</code> methods get called.
  5668. *
  5669. * @version Egret 2.4
  5670. * @version eui 1.0
  5671. * @platform Web,Native
  5672. * @language en_US
  5673. */
  5674. /**
  5675. * 失效目标容器的尺寸和显示列表的简便方法,调用目标容器的
  5676. * <code>measure()</code>和<code>updateDisplayList</code>方法
  5677. *
  5678. * @version Egret 2.4
  5679. * @version eui 1.0
  5680. * @platform Web,Native
  5681. * @language zh_CN
  5682. */
  5683. protected invalidateTargetLayout(): void;
  5684. /**
  5685. * @inheritDoc
  5686. *
  5687. * @version Egret 2.4
  5688. * @version eui 1.0
  5689. * @platform Web,Native
  5690. */
  5691. measure(): void;
  5692. /**
  5693. * Compute exact values for measuredWidth and measuredHeight.
  5694. *
  5695. * @version Egret 2.4
  5696. * @version eui 1.0
  5697. * @platform Web,Native
  5698. * @language en_US
  5699. */
  5700. /**
  5701. * 计算目标容器 measuredWidth 和 measuredHeight 的精确值
  5702. *
  5703. * @version Egret 2.4
  5704. * @version eui 1.0
  5705. * @platform Web,Native
  5706. * @language zh_CN
  5707. */
  5708. protected measureReal(): void;
  5709. /**
  5710. * Compute potentially approximate values for measuredWidth and measuredHeight.
  5711. * @version Egret 2.4
  5712. * @version eui 1.0
  5713. * @platform Web,Native
  5714. * @language en_US
  5715. */
  5716. /**
  5717. * 计算目标容器 measuredWidth 和 measuredHeight 的近似值
  5718. *
  5719. * @version Egret 2.4
  5720. * @version eui 1.0
  5721. * @platform Web,Native
  5722. * @language zh_CN
  5723. */
  5724. protected measureVirtual(): void;
  5725. /**
  5726. * @inheritDoc
  5727. *
  5728. * @version Egret 2.4
  5729. * @version eui 1.0
  5730. * @platform Web,Native
  5731. */
  5732. updateDisplayList(width: number, height: number): void;
  5733. /**
  5734. * An Array of the virtual layout elements size cache.
  5735. *
  5736. * @version Egret 2.4
  5737. * @version eui 1.0
  5738. * @platform Web,Native
  5739. * @language en_US
  5740. */
  5741. /**
  5742. * 虚拟布局使用的尺寸缓存。
  5743. *
  5744. * @version Egret 2.4
  5745. * @version eui 1.0
  5746. * @platform Web,Native
  5747. * @language zh_CN
  5748. */
  5749. protected elementSizeTable: number[];
  5750. /**
  5751. * Gets the starting position of the specified index element
  5752. *
  5753. * @version Egret 2.4
  5754. * @version eui 1.0
  5755. * @platform Web,Native
  5756. * @language en_US
  5757. */
  5758. /**
  5759. * 获取指定索引元素的起始位置
  5760. *
  5761. * @version Egret 2.4
  5762. * @version eui 1.0
  5763. * @platform Web,Native
  5764. * @language zh_CN
  5765. */
  5766. protected getStartPosition(index: number): number;
  5767. /**
  5768. * Gets the size of the specified index element
  5769. *
  5770. * @version Egret 2.4
  5771. * @version eui 1.0
  5772. * @platform Web,Native
  5773. * @language en_US
  5774. */
  5775. /**
  5776. * 获取指定索引元素的尺寸
  5777. *
  5778. * @version Egret 2.4
  5779. * @version eui 1.0
  5780. * @platform Web,Native
  5781. * @language zh_CN
  5782. */
  5783. protected getElementSize(index: number): number;
  5784. /**
  5785. * Gets the sum of the size of cached elements
  5786. *
  5787. * @version Egret 2.4
  5788. * @version eui 1.0
  5789. * @platform Web,Native
  5790. * @language en_US
  5791. */
  5792. /**
  5793. * 获取缓存的子对象尺寸总和
  5794. *
  5795. * @version Egret 2.4
  5796. * @version eui 1.0
  5797. * @platform Web,Native
  5798. * @language zh_CN
  5799. */
  5800. protected getElementTotalSize(): number;
  5801. /**
  5802. * @inheritDoc
  5803. *
  5804. * @param index
  5805. * @version Egret 2.4
  5806. * @version eui 1.0
  5807. * @platform Web,Native
  5808. */
  5809. elementRemoved(index: number): void;
  5810. /**
  5811. * @inheritDoc
  5812. *
  5813. * @version Egret 2.4
  5814. * @version eui 1.0
  5815. * @platform Web,Native
  5816. */
  5817. clearVirtualLayoutCache(): void;
  5818. /**
  5819. * The binary search to find the specified index position of the display object
  5820. *
  5821. * @version Egret 2.4
  5822. * @version eui 1.0
  5823. * @platform Web,Native
  5824. * @language en_US
  5825. */
  5826. /**
  5827. * 折半查找法寻找指定位置的显示对象索引
  5828. *
  5829. * @version Egret 2.4
  5830. * @version eui 1.0
  5831. * @platform Web,Native
  5832. * @language zh_CN
  5833. */
  5834. protected findIndexAt(x: number, i0: number, i1: number): number;
  5835. /**
  5836. * The first element index in the view of the virtual layout
  5837. *
  5838. * @version Egret 2.4
  5839. * @version eui 1.0
  5840. * @platform Web,Native
  5841. * @language en_US
  5842. */
  5843. /**
  5844. * 虚拟布局使用的当前视图中的第一个元素索引
  5845. *
  5846. * @version Egret 2.4
  5847. * @version eui 1.0
  5848. * @platform Web,Native
  5849. * @language zh_CN
  5850. */
  5851. protected startIndex: number;
  5852. /**
  5853. * The last element index in the view of the virtual layout
  5854. *
  5855. * @version Egret 2.4
  5856. * @version eui 1.0
  5857. * @platform Web,Native
  5858. * @language en_US
  5859. */
  5860. /**
  5861. * 虚拟布局使用的当前视图中的最后一个元素的索引
  5862. *
  5863. * @version Egret 2.4
  5864. * @version eui 1.0
  5865. * @platform Web,Native
  5866. * @language zh_CN
  5867. */
  5868. protected endIndex: number;
  5869. /**
  5870. * A Flag of the first element and the end element has been calculated.
  5871. *
  5872. * @version Egret 2.4
  5873. * @version eui 1.0
  5874. * @platform Web,Native
  5875. * @language en_US
  5876. */
  5877. /**
  5878. * 视图的第一个和最后一个元素的索引值已经计算好的标志
  5879. *
  5880. * @version Egret 2.4
  5881. * @version eui 1.0
  5882. * @platform Web,Native
  5883. * @language zh_CN
  5884. */
  5885. protected indexInViewCalculated: boolean;
  5886. /**
  5887. * @inheritDoc
  5888. *
  5889. * @version Egret 2.4
  5890. * @version eui 1.0
  5891. * @platform Web,Native
  5892. */
  5893. scrollPositionChanged(): void;
  5894. /**
  5895. * Get the index of the first and last element in the view,
  5896. * and to return whether or not to change.
  5897. *
  5898. * @return has the index changed
  5899. *
  5900. * @version Egret 2.4
  5901. * @version eui 1.0
  5902. * @platform Web,Native
  5903. * @language en_US
  5904. */
  5905. /**
  5906. * 获取视图中第一个和最后一个元素的索引,返回是否发生改变。
  5907. *
  5908. * @return 索引是否已改变
  5909. *
  5910. * @version Egret 2.4
  5911. * @version eui 1.0
  5912. * @platform Web,Native
  5913. * @language zh_CN
  5914. */
  5915. protected getIndexInView(): boolean;
  5916. /**
  5917. * The maximum size of elements
  5918. *
  5919. *
  5920. * @version Egret 2.4
  5921. * @version eui 1.0
  5922. * @platform Web,Native
  5923. * @language en_US
  5924. */
  5925. /**
  5926. * 子元素最大的尺寸
  5927. *
  5928. * @version Egret 2.4
  5929. * @version eui 1.0
  5930. * @platform Web,Native
  5931. * @language zh_CN
  5932. */
  5933. protected maxElementSize: number;
  5934. /**
  5935. * Update the layout of the virtualized elements
  5936. *
  5937. * @version Egret 2.4
  5938. * @version eui 1.0
  5939. * @platform Web,Native
  5940. * @language en_US
  5941. */
  5942. /**
  5943. * 更新虚拟布局的显示列表
  5944. *
  5945. * @version Egret 2.4
  5946. * @version eui 1.0
  5947. * @platform Web,Native
  5948. * @language zh_CN
  5949. */
  5950. protected updateDisplayListVirtual(width: number, height: number): void;
  5951. /**
  5952. * Update the layout of the reality elements
  5953. *
  5954. * @version Egret 2.4
  5955. * @version eui 1.0
  5956. * @platform Web,Native
  5957. * @language en_US
  5958. */
  5959. /**
  5960. * 更新真实布局的显示列表
  5961. *
  5962. * @version Egret 2.4
  5963. * @version eui 1.0
  5964. * @platform Web,Native
  5965. * @language zh_CN
  5966. */
  5967. protected updateDisplayListReal(width: number, height: number): void;
  5968. /**
  5969. * Allocate blank area for each variable size element.
  5970. *
  5971. * @version Egret 2.4
  5972. * @version eui 1.0
  5973. * @platform Web,Native
  5974. * @language en_US
  5975. */
  5976. /**
  5977. * 为每个可变尺寸的子项分配空白区域。
  5978. *
  5979. * @version Egret 2.4
  5980. * @version eui 1.0
  5981. * @platform Web,Native
  5982. * @language zh_CN
  5983. */
  5984. protected flexChildrenProportionally(spaceForChildren: number, spaceToDistribute: number, totalPercent: number, childInfoArray: any[]): void;
  5985. }
  5986. }
  5987. declare namespace eui.sys {
  5988. /**
  5989. * @private
  5990. */
  5991. class ChildInfo {
  5992. /**
  5993. * @private
  5994. */
  5995. layoutElement: eui.UIComponent;
  5996. /**
  5997. * @private
  5998. */
  5999. size: number;
  6000. /**
  6001. * @private
  6002. */
  6003. percent: number;
  6004. /**
  6005. * @private
  6006. */
  6007. min: number;
  6008. /**
  6009. * @private
  6010. */
  6011. max: number;
  6012. }
  6013. }
  6014. declare namespace eui {
  6015. /**
  6016. * The HSlider (horizontal slider) control lets users select a value
  6017. * by moving a slider thumb between the end points of the slider track.
  6018. * The current value of the slider is determined by the relative location of the thumb between
  6019. * the end points of the slider, corresponding to the slider's minimum and maximum values.
  6020. *
  6021. * @includeExample extension/eui/components/HSliderExample.ts
  6022. * @version Egret 2.4
  6023. * @version eui 1.0
  6024. * @platform Web,Native
  6025. * @language en_US
  6026. */
  6027. /**
  6028. * 使用 HSlider(水平滑块)控件,用户可通过在滑块轨道的端点之间移动滑块来选择值。
  6029. * 滑块的当前值由滑块端点(对应于滑块的最小值和最大值)之间滑块的相对位置确定。
  6030. *
  6031. * @includeExample extension/eui/components/HSliderExample.ts
  6032. * @version Egret 2.4
  6033. * @version eui 1.0
  6034. * @platform Web,Native
  6035. * @language zh_CN
  6036. */
  6037. class HSlider extends SliderBase {
  6038. /**
  6039. * Constructor.
  6040. *
  6041. * @version Egret 2.4
  6042. * @version eui 1.0
  6043. * @platform Web,Native
  6044. * @language en_US
  6045. */
  6046. /**
  6047. * 构造函数。
  6048. *
  6049. * @version Egret 2.4
  6050. * @version eui 1.0
  6051. * @platform Web,Native
  6052. * @language zh_CN
  6053. */
  6054. constructor();
  6055. /**
  6056. * @inheritDoc
  6057. *
  6058. * @version Egret 2.4
  6059. * @version eui 1.0
  6060. * @platform Web,Native
  6061. */
  6062. protected pointToValue(x: number, y: number): number;
  6063. /**
  6064. * @private
  6065. *
  6066. * @returns
  6067. */
  6068. private getThumbRange();
  6069. /**
  6070. * @inheritDoc
  6071. *
  6072. * @version Egret 2.4
  6073. * @version eui 1.0
  6074. * @platform Web,Native
  6075. */
  6076. protected updateSkinDisplayList(): void;
  6077. }
  6078. }
  6079. declare namespace eui {
  6080. /**
  6081. * Default instance of interface <code>IAssetAdapter</code>.
  6082. * @version Egret 2.4
  6083. * @version eui 1.0
  6084. * @platform Web,Native
  6085. * @includeExample extension/eui/components/supportClasses/DefaultAssetAdapterExample.ts
  6086. * @language en_US
  6087. */
  6088. /**
  6089. * 默认的IAssetAdapter接口实现。
  6090. * @version Egret 2.4
  6091. * @version eui 1.0
  6092. * @platform Web,Native
  6093. * @includeExample extension/eui/components/supportClasses/DefaultAssetAdapterExample.ts
  6094. * @language zh_CN
  6095. */
  6096. class DefaultAssetAdapter implements IAssetAdapter {
  6097. /**
  6098. * resolve asset.
  6099. * @param source the identifier of new asset need to be resolved
  6100. * @param callBack callback function when resolving complete
  6101. * example:callBack(content:any,source:string):void;
  6102. * @param thisObject <code>this</code> object of callback method
  6103. * @version Egret 2.4
  6104. * @version eui 1.0
  6105. * @platform Web,Native
  6106. * @language en_US
  6107. */
  6108. /**
  6109. * 解析素材
  6110. * @param source 待解析的新素材标识符
  6111. * @param callBack 解析完成回调函数,示例:callBack(content:any,source:string):void;
  6112. * @param thisObject callBack的 this 引用
  6113. * @version Egret 2.4
  6114. * @version eui 1.0
  6115. * @platform Web,Native
  6116. * @language zh_CN
  6117. */
  6118. getAsset(source: string, callBack: (data: any, source: string) => void, thisObject: any): void;
  6119. /**
  6120. * @private
  6121. *
  6122. * @param event
  6123. */
  6124. private onLoadFinish(event);
  6125. }
  6126. }
  6127. declare namespace eui {
  6128. /**
  6129. * The Image control lets you show JPEG, PNG, and GIF files
  6130. * at runtime. Image inherit Bitmap,so you can set the <code>bitmapData</code> property
  6131. * to show the data. you can also set the <code>source</code> property, Image will auto load
  6132. * and show the url image or the bitmapData.
  6133. *
  6134. * @event egret.Event.COMPLETE Dispatched when the image loaded complete.
  6135. * @version Egret 2.4
  6136. * @version eui 1.0
  6137. * @platform Web,Native
  6138. * @includeExample extension/eui/components/ImageExample.ts
  6139. * @language en_US
  6140. */
  6141. /**
  6142. * Image 控件允许您在运行时显示 JPEG、PNG 等图片文件文件。Image 继承至 Bitmap,因此您可以直接对其 bitmapData 属性,
  6143. * 赋值从外部加载得到的位图数据以显示对应图片。同时,Image 还提供了更加方便的 source 属性,source 属性可以接受一个网络图片url作为值,
  6144. * 赋值为url后,它内部会自动去加载并显示图片。并且您同样也可以直接把 BitmapData 对象赋值给 source 属性以显示图片。
  6145. *
  6146. * @event egret.Event.COMPLETE 当图片加载完成后调度
  6147. * @version Egret 2.4
  6148. * @version eui 1.0
  6149. * @platform Web,Native
  6150. * @includeExample extension/eui/components/ImageExample.ts
  6151. * @language zh_CN
  6152. */
  6153. class Image extends egret.Bitmap implements UIComponent {
  6154. /**
  6155. * Constructor.
  6156. *
  6157. * @param source The source used for the bitmap fill. the value can be
  6158. * a string or an instance of <code>egret.Texture</code>
  6159. *
  6160. * @version Egret 2.4
  6161. * @version eui 1.0
  6162. * @platform Web,Native
  6163. * @language en_US
  6164. */
  6165. /**
  6166. * 构造函数。
  6167. *
  6168. * @param source 用于位图填充的源。可以是一个字符串或者 <code>egret.Texture</code> 对象
  6169. *
  6170. * @version Egret 2.4
  6171. * @version eui 1.0
  6172. * @platform Web,Native
  6173. * @language zh_CN
  6174. */
  6175. constructor(source?: string | egret.Texture);
  6176. /**
  6177. * Represent a Rectangle Area that the 9 scale area of Image.
  6178. * Notice: This property is valid only when <code>fillMode</code>
  6179. * is <code>BitmapFillMode.SCALE</code>.
  6180. *
  6181. * @version Egret 2.4
  6182. * @version eui 1.0
  6183. * @platform Web,Native
  6184. * @language en_US
  6185. */
  6186. /**
  6187. * 矩形区域,它定义素材对象的九个缩放区域。
  6188. * 注意:此属性仅在<code>fillMode</code>为<code>BitmapFillMode.SCALE</code>时有效。
  6189. *
  6190. * @version Egret 2.4
  6191. * @version eui 1.0
  6192. * @platform Web,Native
  6193. * @language zh_CN
  6194. */
  6195. scale9Grid: egret.Rectangle;
  6196. /**
  6197. * Determines how the bitmap fills in the dimensions.
  6198. * <p>When set to <code>BitmapFillMode.CLIP</code>, the bitmap
  6199. * ends at the edge of the region.</p>
  6200. * <p>When set to <code>BitmapFillMode.REPEAT</code>, the bitmap
  6201. * repeats to fill the region.</p>
  6202. * <p>When set to <code>BitmapFillMode.SCALE</code>, the bitmap
  6203. * stretches to fill the region.</p>
  6204. *
  6205. * @default <code>BitmapFillMode.SCALE</code>
  6206. *
  6207. * @version Egret 2.4
  6208. * @version eui 1.0
  6209. * @platform Web,Native
  6210. * @language en_US
  6211. */
  6212. /**
  6213. * 确定位图填充尺寸的方式。
  6214. * <p>设置为 <code>BitmapFillMode.CLIP</code>时,位图将在边缘处被截断。</p>
  6215. * <p>设置为 <code>BitmapFillMode.REPEAT</code>时,位图将重复以填充区域。</p>
  6216. * <p>设置为 <code>BitmapFillMode.SCALE</code>时,位图将拉伸以填充区域。</p>
  6217. *
  6218. * @default <code>BitmapFillMode.SCALE</code>
  6219. *
  6220. * @version Egret 2.4
  6221. * @version eui 1.0
  6222. * @platform Web,Native
  6223. * @language zh_CN
  6224. */
  6225. fillMode: string;
  6226. $setFillMode(value: string): boolean;
  6227. /**
  6228. * @private
  6229. */
  6230. private sourceChanged;
  6231. /**
  6232. * @private
  6233. */
  6234. private _source;
  6235. /**
  6236. * The source used for the bitmap fill. the value can be
  6237. * a string or an instance of <code>egret.Texture</code>
  6238. *
  6239. * @version Egret 2.4
  6240. * @version eui 1.0
  6241. * @platform Web,Native
  6242. * @language en_US
  6243. */
  6244. /**
  6245. * 用于位图填充的源。可以是一个字符串或者 <code>egret.Texture</code> 对象
  6246. *
  6247. * @version Egret 2.4
  6248. * @version eui 1.0
  6249. * @platform Web,Native
  6250. * @language zh_CN
  6251. */
  6252. source: string | egret.Texture;
  6253. $setTexture(value: egret.Texture): boolean;
  6254. /**
  6255. * @private
  6256. * 解析source
  6257. */
  6258. private parseSource();
  6259. $measureContentBounds(bounds: egret.Rectangle): void;
  6260. /**
  6261. * @private
  6262. *
  6263. * @param context
  6264. */
  6265. /**
  6266. * @private
  6267. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  6268. */
  6269. private initializeUIValues;
  6270. /**
  6271. * @copy eui.UIComponent#createChildren
  6272. *
  6273. * @version Egret 2.4
  6274. * @version eui 1.0
  6275. * @platform Web,Native
  6276. */
  6277. protected createChildren(): void;
  6278. /**
  6279. * @private
  6280. * 设置组件的宽高。此方法不同于直接设置width,height属性,
  6281. * 不会影响显式标记尺寸属性
  6282. */
  6283. protected setActualSize(w: number, h: number): void;
  6284. /**
  6285. * @copy eui.UIComponent#childrenCreated
  6286. *
  6287. * @version Egret 2.4
  6288. * @version eui 1.0
  6289. * @platform Web,Native
  6290. */
  6291. protected childrenCreated(): void;
  6292. /**
  6293. * @copy eui.UIComponent#commitProperties
  6294. *
  6295. * @version Egret 2.4
  6296. * @version eui 1.0
  6297. * @platform Web,Native
  6298. */
  6299. protected commitProperties(): void;
  6300. /**
  6301. * @copy eui.UIComponent#measure
  6302. *
  6303. * @version Egret 2.4
  6304. * @version eui 1.0
  6305. * @platform Web,Native
  6306. */
  6307. protected measure(): void;
  6308. /**
  6309. * @copy eui.UIComponent#updateDisplayList
  6310. *
  6311. * @version Egret 2.4
  6312. * @version eui 1.0
  6313. * @platform Web,Native
  6314. */
  6315. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  6316. /**
  6317. * @copy eui.UIComponent#invalidateParentLayout
  6318. *
  6319. * @version Egret 2.4
  6320. * @version eui 1.0
  6321. * @platform Web,Native
  6322. */
  6323. protected invalidateParentLayout(): void;
  6324. /**
  6325. * @private
  6326. */
  6327. $UIComponent: Object;
  6328. /**
  6329. * @private
  6330. */
  6331. $includeInLayout: boolean;
  6332. /**
  6333. * @copy eui.UIComponent#includeInLayout
  6334. *
  6335. * @version Egret 2.4
  6336. * @version eui 1.0
  6337. * @platform Web,Native
  6338. */
  6339. includeInLayout: boolean;
  6340. /**
  6341. * @copy eui.UIComponent#left
  6342. *
  6343. * @version Egret 2.4
  6344. * @version eui 1.0
  6345. * @platform Web,Native
  6346. */
  6347. left: any;
  6348. /**
  6349. * @copy eui.UIComponent#right
  6350. *
  6351. * @version Egret 2.4
  6352. * @version eui 1.0
  6353. * @platform Web,Native
  6354. */
  6355. right: any;
  6356. /**
  6357. * @copy eui.UIComponent#top
  6358. *
  6359. * @version Egret 2.4
  6360. * @version eui 1.0
  6361. * @platform Web,Native
  6362. */
  6363. top: any;
  6364. /**
  6365. * @copy eui.UIComponent#bottom
  6366. *
  6367. * @version Egret 2.4
  6368. * @version eui 1.0
  6369. * @platform Web,Native
  6370. */
  6371. bottom: any;
  6372. /**
  6373. * @copy eui.UIComponent#horizontalCenter
  6374. *
  6375. * @version Egret 2.4
  6376. * @version eui 1.0
  6377. * @platform Web,Native
  6378. */
  6379. horizontalCenter: any;
  6380. /**
  6381. * @copy eui.UIComponent#verticalCenter
  6382. *
  6383. * @version Egret 2.4
  6384. * @version eui 1.0
  6385. * @platform Web,Native
  6386. */
  6387. verticalCenter: any;
  6388. /**
  6389. * @copy eui.UIComponent#percentWidth
  6390. *
  6391. * @version Egret 2.4
  6392. * @version eui 1.0
  6393. * @platform Web,Native
  6394. */
  6395. percentWidth: number;
  6396. /**
  6397. * @copy eui.UIComponent#percentHeight
  6398. *
  6399. * @version Egret 2.4
  6400. * @version eui 1.0
  6401. * @platform Web,Native
  6402. */
  6403. percentHeight: number;
  6404. /**
  6405. * @copy eui.UIComponent#explicitWidth
  6406. *
  6407. * @version Egret 2.4
  6408. * @version eui 1.0
  6409. * @platform Web,Native
  6410. */
  6411. explicitWidth: number;
  6412. /**
  6413. * @copy eui.UIComponent#explicitHeight
  6414. *
  6415. * @version Egret 2.4
  6416. * @version eui 1.0
  6417. * @platform Web,Native
  6418. */
  6419. explicitHeight: number;
  6420. /**
  6421. * @copy eui.UIComponent#minWidth
  6422. *
  6423. * @version Egret 2.4
  6424. * @version eui 1.0
  6425. * @platform Web,Native
  6426. */
  6427. minWidth: number;
  6428. /**
  6429. * @copy eui.UIComponent#maxWidth
  6430. *
  6431. * @version Egret 2.4
  6432. * @version eui 1.0
  6433. * @platform Web,Native
  6434. */
  6435. maxWidth: number;
  6436. /**
  6437. * @copy eui.UIComponent#minHeight
  6438. *
  6439. * @version Egret 2.4
  6440. * @version eui 1.0
  6441. * @platform Web,Native
  6442. */
  6443. minHeight: number;
  6444. /**
  6445. * @copy eui.UIComponent#maxHeight
  6446. *
  6447. * @version Egret 2.4
  6448. * @version eui 1.0
  6449. * @platform Web,Native
  6450. */
  6451. maxHeight: number;
  6452. /**
  6453. * @inheritDoc
  6454. *
  6455. * @version Egret 2.4
  6456. * @version eui 1.0
  6457. * @platform Web,Native
  6458. */
  6459. setMeasuredSize(width: number, height: number): void;
  6460. /**
  6461. * @inheritDoc
  6462. *
  6463. * @version Egret 2.4
  6464. * @version eui 1.0
  6465. * @platform Web,Native
  6466. */
  6467. invalidateProperties(): void;
  6468. /**
  6469. * @inheritDoc
  6470. *
  6471. * @version Egret 2.4
  6472. * @version eui 1.0
  6473. * @platform Web,Native
  6474. */
  6475. validateProperties(): void;
  6476. /**
  6477. * @inheritDoc
  6478. *
  6479. * @version Egret 2.4
  6480. * @version eui 1.0
  6481. * @platform Web,Native
  6482. */
  6483. invalidateSize(): void;
  6484. /**
  6485. * @inheritDoc
  6486. *
  6487. * @version Egret 2.4
  6488. * @version eui 1.0
  6489. * @platform Web,Native
  6490. */
  6491. validateSize(recursive?: boolean): void;
  6492. /**
  6493. * @inheritDoc
  6494. *
  6495. * @version Egret 2.4
  6496. * @version eui 1.0
  6497. * @platform Web,Native
  6498. */
  6499. invalidateDisplayList(): void;
  6500. /**
  6501. * @inheritDoc
  6502. *
  6503. * @version Egret 2.4
  6504. * @version eui 1.0
  6505. * @platform Web,Native
  6506. */
  6507. validateDisplayList(): void;
  6508. /**
  6509. * @inheritDoc
  6510. *
  6511. * @version Egret 2.4
  6512. * @version eui 1.0
  6513. * @platform Web,Native
  6514. */
  6515. validateNow(): void;
  6516. /**
  6517. * @inheritDoc
  6518. *
  6519. * @version Egret 2.4
  6520. * @version eui 1.0
  6521. * @platform Web,Native
  6522. */
  6523. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  6524. /**
  6525. * @inheritDoc
  6526. *
  6527. * @version Egret 2.4
  6528. * @version eui 1.0
  6529. * @platform Web,Native
  6530. */
  6531. setLayoutBoundsPosition(x: number, y: number): void;
  6532. /**
  6533. * @inheritDoc
  6534. *
  6535. * @version Egret 2.4
  6536. * @version eui 1.0
  6537. * @platform Web,Native
  6538. */
  6539. getLayoutBounds(bounds: egret.Rectangle): void;
  6540. /**
  6541. * @inheritDoc
  6542. *
  6543. * @version Egret 2.4
  6544. * @version eui 1.0
  6545. * @platform Web,Native
  6546. */
  6547. getPreferredBounds(bounds: egret.Rectangle): void;
  6548. }
  6549. }
  6550. declare namespace eui {
  6551. /**
  6552. * The ItemRenderer class is the base class for item renderers.
  6553. *
  6554. * @state up Up state
  6555. * @state down Down state
  6556. * @state upAndSelected Up state when the button is selected
  6557. * @state downAndSelected Down state when the button is selected
  6558. * @version Egret 2.4
  6559. * @version eui 1.0
  6560. * @platform Web,Native
  6561. * @includeExample extension/eui/components/ItemRendererExample.ts
  6562. * @language en_US
  6563. */
  6564. /**
  6565. * ItemRenderer 类是项呈示器的基类。
  6566. *
  6567. * @state up 弹起状态
  6568. * @state down 按下状态
  6569. * @state upAndSelected 选择时的弹起状态
  6570. * @state downAndSelected 选择时的按下状态
  6571. * @version Egret 2.4
  6572. * @version eui 1.0
  6573. * @platform Web,Native
  6574. * @includeExample extension/eui/components/ItemRendererExample.ts
  6575. * @language zh_CN
  6576. */
  6577. class ItemRenderer extends Component implements IItemRenderer {
  6578. /**
  6579. * Constructor.
  6580. *
  6581. * @version Egret 2.4
  6582. * @version eui 1.0
  6583. * @platform Web,Native
  6584. * @language en_US
  6585. */
  6586. /**
  6587. * 构造函数。
  6588. *
  6589. * @version Egret 2.4
  6590. * @version eui 1.0
  6591. * @platform Web,Native
  6592. * @language zh_CN
  6593. */
  6594. constructor();
  6595. /**
  6596. * @private
  6597. */
  6598. private _data;
  6599. /**
  6600. * The data to render or edit.
  6601. *
  6602. * @version Egret 2.4
  6603. * @version eui 1.0
  6604. * @platform Web,Native
  6605. * @language en_US
  6606. */
  6607. /**
  6608. * 要呈示或编辑的数据。
  6609. *
  6610. * @version Egret 2.4
  6611. * @version eui 1.0
  6612. * @platform Web,Native
  6613. * @language zh_CN
  6614. */
  6615. data: any;
  6616. /**
  6617. * Update the view when the <code>data</code> property changes.
  6618. *
  6619. * @version Egret 2.4
  6620. * @version eui 1.0
  6621. * @platform Web,Native
  6622. * @language en_US
  6623. */
  6624. /**
  6625. * 当数据改变时,更新视图。
  6626. *
  6627. * @version Egret 2.4
  6628. * @version eui 1.0
  6629. * @platform Web,Native
  6630. * @language zh_CN
  6631. */
  6632. protected dataChanged(): void;
  6633. /**
  6634. * @private
  6635. */
  6636. private _selected;
  6637. /**
  6638. * Contains <code>true</code> if the item renderer
  6639. * can show itself as selected.
  6640. *
  6641. * @version Egret 2.4
  6642. * @version eui 1.0
  6643. * @platform Web,Native
  6644. * @language en_US
  6645. */
  6646. /**
  6647. * 如果项呈示器可以将其自身显示为已选中,则为 true。
  6648. *
  6649. * @version Egret 2.4
  6650. * @version eui 1.0
  6651. * @platform Web,Native
  6652. * @language zh_CN
  6653. */
  6654. selected: boolean;
  6655. /**
  6656. * The index of the item in the data provider
  6657. * of the host component of the item renderer.
  6658. *
  6659. * @version Egret 2.4
  6660. * @version eui 1.0
  6661. * @platform Web,Native
  6662. * @language en_US
  6663. */
  6664. /**
  6665. * 项呈示器的数据提供程序中的项目索引。
  6666. *
  6667. * @version Egret 2.4
  6668. * @version eui 1.0
  6669. * @platform Web,Native
  6670. * @language zh_CN
  6671. */
  6672. itemIndex: number;
  6673. /**
  6674. * @private
  6675. * 指示第一次分派 TouchEvent.TOUCH_BEGIN 时,触摸点是否在按钮上。
  6676. */
  6677. private touchCaptured;
  6678. /**
  6679. * Dispatched when an event of some kind occurred that canceled the touch.
  6680. * @version Egret 3.0.1
  6681. * @version eui 1.0
  6682. * @platform Web,Native
  6683. * @language en_US
  6684. */
  6685. /**
  6686. * 由于某个事件取消了触摸时触发
  6687. * @version Egret 3.0.1
  6688. * @version eui 1.0
  6689. * @platform Web,Native
  6690. * @language zh_CN
  6691. */
  6692. protected onTouchCancle(event: egret.TouchEvent): void;
  6693. /**
  6694. * Handles <code>TouchEvent.TOUCH_BEGIN</code> events
  6695. *
  6696. * @version Egret 2.4
  6697. * @version eui 1.0
  6698. * @platform Web,Native
  6699. * @language en_US
  6700. */
  6701. /**
  6702. * 触碰开始时触发事件
  6703. *
  6704. * @version Egret 2.4
  6705. * @version eui 1.0
  6706. * @platform Web,Native
  6707. * @language zh_CN
  6708. */
  6709. protected onTouchBegin(event: egret.TouchEvent): void;
  6710. /**
  6711. * @private
  6712. * 舞台上触摸弹起事件
  6713. */
  6714. private onStageTouchEnd(event);
  6715. /**
  6716. * @inheritDoc
  6717. *
  6718. * @version Egret 2.4
  6719. * @version eui 1.0
  6720. * @platform Web,Native
  6721. */
  6722. protected getCurrentState(): string;
  6723. }
  6724. }
  6725. declare namespace eui {
  6726. /**
  6727. * Label is an UIComponent that can render one or more lines of text.
  6728. * The text to be displayed is determined by the <code>text</code> property.
  6729. * The formatting of the text is specified by the styles,
  6730. * such as <code>fontFamily</code> and <code>size</code>.
  6731. *
  6732. * <p>Because Label is fast and lightweight, it is especially suitable
  6733. * for use cases that involve rendering many small pieces of non-interactive
  6734. * text, such as item renderers and labels in Button skins.</p>
  6735. *
  6736. * <p>In Label, three character sequences are recognized
  6737. * as explicit line breaks: CR (<code>"\r"</code>), LF (<code>"\n"</code>),
  6738. * and CR+LF (<code>"\r\n"</code>).</p>
  6739. *
  6740. * <p>If you don't specify any kind of width for a Label,
  6741. * then the longest line, as determined by these explicit line breaks,
  6742. * determines the width of the Label.</p>
  6743. *
  6744. * <p>If you do specify some kind of width, then the specified text is
  6745. * word-wrapped at the right edge of the component's bounds.
  6746. * If the text extends below the bottom of the component,
  6747. * it is clipped.</p>
  6748. *
  6749. * @version Egret 2.4
  6750. * @version eui 1.0
  6751. * @platform Web,Native
  6752. * @includeExample extension/eui/components/LabelExample.ts
  6753. * @language en_US
  6754. */
  6755. /**
  6756. * Label 是可以呈示一行或多行统一格式文本的UI组件。要显示的文本由 text 属性确定。文本格式由样式属性指定,例如 fontFamily 和 size。
  6757. * 因为 Label 运行速度快且占用内存少,所以它特别适合用于显示多个小型非交互式文本的情况,例如,项呈示器和 Button 外观中的标签。
  6758. * 在 Label 中,将以下三个字符序列识别为显式换行符:CR(“\r”)、LF(“\n”)和 CR+LF(“\r\n”)。
  6759. * 如果没有为 Label 指定宽度,则由这些显式换行符确定的最长行确定 Label 的宽度。
  6760. * 如果指定了宽度,则指定文本将在组件边界的右边缘换行,如果文本扩展到低于组件底部,则将被剪切。
  6761. *
  6762. * @version Egret 2.4
  6763. * @version eui 1.0
  6764. * @platform Web,Native
  6765. * @includeExample extension/eui/components/LabelExample.ts
  6766. * @language zh_CN
  6767. */
  6768. class Label extends egret.TextField implements UIComponent, IDisplayText {
  6769. /**
  6770. * Constructor.
  6771. *
  6772. * @param text The text displayed by this text component.
  6773. *
  6774. * @version Egret 2.4
  6775. * @version eui 1.0
  6776. * @platform Web,Native
  6777. * @language en_US
  6778. */
  6779. /**
  6780. * 构造函数。
  6781. *
  6782. * @param text 此文本组件所显示的文本。
  6783. *
  6784. * @version Egret 2.4
  6785. * @version eui 1.0
  6786. * @platform Web,Native
  6787. * @language zh_CN
  6788. */
  6789. constructor(text?: string);
  6790. /**
  6791. * style中属性是否允许被赋值,当主动赋值过属性之后将不允许被赋值
  6792. */
  6793. private $styleSetMap;
  6794. private $revertStyle;
  6795. private $style;
  6796. private $changeFromStyle;
  6797. /**
  6798. * The style of text.
  6799. * @version Egret 3.2.1
  6800. * @platform Web,Native
  6801. * @language en_US
  6802. */
  6803. /**
  6804. * 文本样式。
  6805. * @version Egret 3.2.1
  6806. * @platform Web,Native
  6807. * @language zh_CN
  6808. */
  6809. style: string;
  6810. $setStyle(value: string): void;
  6811. $setFontFamily(value: string): boolean;
  6812. $setSize(value: number): boolean;
  6813. $setBold(value: boolean): boolean;
  6814. $setItalic(value: boolean): boolean;
  6815. $setTextAlign(value: string): boolean;
  6816. $setVerticalAlign(value: string): boolean;
  6817. $setLineSpacing(value: number): boolean;
  6818. $setTextColor(value: number): boolean;
  6819. $setWordWrap(value: boolean): void;
  6820. $setDisplayAsPassword(value: boolean): boolean;
  6821. $setStrokeColor(value: number): boolean;
  6822. $setStroke(value: number): boolean;
  6823. $setMaxChars(value: number): boolean;
  6824. $setMultiline(value: boolean): boolean;
  6825. $setBorder(value: boolean): void;
  6826. $setBorderColor(value: number): void;
  6827. $setBackground(value: boolean): void;
  6828. $setBackgroundColor(value: number): void;
  6829. /**
  6830. * @private
  6831. *
  6832. */
  6833. $invalidateTextField(): void;
  6834. /**
  6835. * @private
  6836. *
  6837. * @param value
  6838. */
  6839. $setWidth(value: number): boolean;
  6840. /**
  6841. * @private
  6842. *
  6843. * @param value
  6844. */
  6845. $setHeight(value: number): boolean;
  6846. /**
  6847. * @private
  6848. *
  6849. * @param value
  6850. */
  6851. $setText(value: string): boolean;
  6852. /**
  6853. * @private
  6854. */
  6855. private _widthConstraint;
  6856. /**
  6857. * @private
  6858. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  6859. */
  6860. private initializeUIValues;
  6861. /**
  6862. * @copy eui.UIComponent#createChildren
  6863. *
  6864. * @version Egret 2.4
  6865. * @version eui 1.0
  6866. * @platform Web,Native
  6867. */
  6868. protected createChildren(): void;
  6869. /**
  6870. * @copy eui.UIComponent#childrenCreated
  6871. *
  6872. * @version Egret 2.4
  6873. * @version eui 1.0
  6874. * @platform Web,Native
  6875. */
  6876. protected childrenCreated(): void;
  6877. /**
  6878. * @copy eui.UIComponent#commitProperties
  6879. *
  6880. * @version Egret 2.4
  6881. * @version eui 1.0
  6882. * @platform Web,Native
  6883. */
  6884. protected commitProperties(): void;
  6885. /**
  6886. * @copy eui.UIComponent#measure
  6887. *
  6888. * @version Egret 2.4
  6889. * @version eui 1.0
  6890. * @platform Web,Native
  6891. */
  6892. protected measure(): void;
  6893. /**
  6894. * @copy eui.UIComponent#updateDisplayList
  6895. *
  6896. * @version Egret 2.4
  6897. * @version eui 1.0
  6898. * @platform Web,Native
  6899. */
  6900. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  6901. /**
  6902. * @copy eui.UIComponent#invalidateParentLayout
  6903. *
  6904. * @version Egret 2.4
  6905. * @version eui 1.0
  6906. * @platform Web,Native
  6907. */
  6908. protected invalidateParentLayout(): void;
  6909. /**
  6910. * @private
  6911. */
  6912. $UIComponent: Object;
  6913. /**
  6914. * @private
  6915. */
  6916. $includeInLayout: boolean;
  6917. /**
  6918. * @copy eui.UIComponent#includeInLayout
  6919. *
  6920. * @version Egret 2.4
  6921. * @version eui 1.0
  6922. * @platform Web,Native
  6923. */
  6924. includeInLayout: boolean;
  6925. /**
  6926. * @copy eui.UIComponent#left
  6927. *
  6928. * @version Egret 2.4
  6929. * @version eui 1.0
  6930. * @platform Web,Native
  6931. */
  6932. left: any;
  6933. /**
  6934. * @copy eui.UIComponent#right
  6935. *
  6936. * @version Egret 2.4
  6937. * @version eui 1.0
  6938. * @platform Web,Native
  6939. */
  6940. right: any;
  6941. /**
  6942. * @copy eui.UIComponent#top
  6943. *
  6944. * @version Egret 2.4
  6945. * @version eui 1.0
  6946. * @platform Web,Native
  6947. */
  6948. top: any;
  6949. /**
  6950. * @copy eui.UIComponent#bottom
  6951. *
  6952. * @version Egret 2.4
  6953. * @version eui 1.0
  6954. * @platform Web,Native
  6955. */
  6956. bottom: any;
  6957. /**
  6958. * @copy eui.UIComponent#horizontalCenter
  6959. *
  6960. * @version Egret 2.4
  6961. * @version eui 1.0
  6962. * @platform Web,Native
  6963. */
  6964. horizontalCenter: any;
  6965. /**
  6966. * @copy eui.UIComponent#verticalCenter
  6967. *
  6968. * @version Egret 2.4
  6969. * @version eui 1.0
  6970. * @platform Web,Native
  6971. */
  6972. verticalCenter: any;
  6973. /**
  6974. * @copy eui.UIComponent#percentWidth
  6975. *
  6976. * @version Egret 2.4
  6977. * @version eui 1.0
  6978. * @platform Web,Native
  6979. */
  6980. percentWidth: number;
  6981. /**
  6982. * @copy eui.UIComponent#percentHeight
  6983. *
  6984. * @version Egret 2.4
  6985. * @version eui 1.0
  6986. * @platform Web,Native
  6987. */
  6988. percentHeight: number;
  6989. /**
  6990. * @copy eui.UIComponent#explicitWidth
  6991. *
  6992. * @version Egret 2.4
  6993. * @version eui 1.0
  6994. * @platform Web,Native
  6995. */
  6996. explicitWidth: number;
  6997. /**
  6998. * @copy eui.UIComponent#explicitHeight
  6999. *
  7000. * @version Egret 2.4
  7001. * @version eui 1.0
  7002. * @platform Web,Native
  7003. */
  7004. explicitHeight: number;
  7005. /**
  7006. * @copy eui.UIComponent#minWidth
  7007. *
  7008. * @version Egret 2.4
  7009. * @version eui 1.0
  7010. * @platform Web,Native
  7011. */
  7012. minWidth: number;
  7013. /**
  7014. * @copy eui.UIComponent#maxWidth
  7015. *
  7016. * @version Egret 2.4
  7017. * @version eui 1.0
  7018. * @platform Web,Native
  7019. */
  7020. maxWidth: number;
  7021. /**
  7022. * @copy eui.UIComponent#minHeight
  7023. *
  7024. * @version Egret 2.4
  7025. * @version eui 1.0
  7026. * @platform Web,Native
  7027. */
  7028. minHeight: number;
  7029. /**
  7030. * @copy eui.UIComponent#maxHeight
  7031. *
  7032. * @version Egret 2.4
  7033. * @version eui 1.0
  7034. * @platform Web,Native
  7035. */
  7036. maxHeight: number;
  7037. /**
  7038. * @inheritDoc
  7039. *
  7040. * @version Egret 2.4
  7041. * @version eui 1.0
  7042. * @platform Web,Native
  7043. */
  7044. setMeasuredSize(width: number, height: number): void;
  7045. /**
  7046. * @inheritDoc
  7047. *
  7048. * @version Egret 2.4
  7049. * @version eui 1.0
  7050. * @platform Web,Native
  7051. */
  7052. invalidateProperties(): void;
  7053. /**
  7054. * @inheritDoc
  7055. *
  7056. * @version Egret 2.4
  7057. * @version eui 1.0
  7058. * @platform Web,Native
  7059. */
  7060. validateProperties(): void;
  7061. /**
  7062. * @inheritDoc
  7063. *
  7064. * @version Egret 2.4
  7065. * @version eui 1.0
  7066. * @platform Web,Native
  7067. */
  7068. invalidateSize(): void;
  7069. /**
  7070. * @inheritDoc
  7071. *
  7072. * @version Egret 2.4
  7073. * @version eui 1.0
  7074. * @platform Web,Native
  7075. */
  7076. validateSize(recursive?: boolean): void;
  7077. /**
  7078. * @inheritDoc
  7079. *
  7080. * @version Egret 2.4
  7081. * @version eui 1.0
  7082. * @platform Web,Native
  7083. */
  7084. invalidateDisplayList(): void;
  7085. /**
  7086. * @inheritDoc
  7087. *
  7088. * @version Egret 2.4
  7089. * @version eui 1.0
  7090. * @platform Web,Native
  7091. */
  7092. validateDisplayList(): void;
  7093. /**
  7094. * @inheritDoc
  7095. *
  7096. * @version Egret 2.4
  7097. * @version eui 1.0
  7098. * @platform Web,Native
  7099. */
  7100. validateNow(): void;
  7101. /**
  7102. * @inheritDoc
  7103. *
  7104. * @version Egret 2.4
  7105. * @version eui 1.0
  7106. * @platform Web,Native
  7107. */
  7108. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  7109. /**
  7110. * @inheritDoc
  7111. *
  7112. * @version Egret 2.4
  7113. * @version eui 1.0
  7114. * @platform Web,Native
  7115. */
  7116. setLayoutBoundsPosition(x: number, y: number): void;
  7117. /**
  7118. * @inheritDoc
  7119. *
  7120. * @version Egret 2.4
  7121. * @version eui 1.0
  7122. * @platform Web,Native
  7123. */
  7124. getLayoutBounds(bounds: egret.Rectangle): void;
  7125. /**
  7126. * @inheritDoc
  7127. *
  7128. * @version Egret 2.4
  7129. * @version eui 1.0
  7130. * @platform Web,Native
  7131. */
  7132. getPreferredBounds(bounds: egret.Rectangle): void;
  7133. }
  7134. }
  7135. declare namespace eui {
  7136. /**
  7137. * The List control displays a vertical or horizontal list of items.
  7138. * The user can select one or more items from the list, depending
  7139. * on the value of the <code>allowMultipleSelection</code> property.
  7140. *
  7141. * @version Egret 2.4
  7142. * @version eui 1.0
  7143. * @platform Web,Native
  7144. * @includeExample extension/eui/components/ListExample.ts
  7145. * @language en_US
  7146. */
  7147. /**
  7148. * List 控件可显示垂直或水平的项目列表。用户可以根据 <code>allowMultipleSelection</code> 属性的值从列表中选择一个或多个项目。
  7149. *
  7150. * @version Egret 2.4
  7151. * @version eui 1.0
  7152. * @platform Web,Native
  7153. * @includeExample extension/eui/components/ListExample.ts
  7154. * @language zh_CN
  7155. */
  7156. class List extends ListBase {
  7157. /**
  7158. * whether are allowed to multiple selection.
  7159. * If <code>true</code> tap an unselected item will be selected,
  7160. * and tap the item again will cancel selection.
  7161. *
  7162. * @default false
  7163. *
  7164. * @version Egret 2.4
  7165. * @version eui 1.0
  7166. * @platform Web,Native
  7167. * @language en_US
  7168. */
  7169. /**
  7170. * 是否允许同时选中多项,设置为 <code>true</code> 时,触摸按下未选中的项呈示器,将会设置该项选中,再次按下将会取消选中。
  7171. * 可以设置多项为选中状态。
  7172. *
  7173. * @default false
  7174. *
  7175. * @version Egret 2.4
  7176. * @version eui 1.0
  7177. * @platform Web,Native
  7178. * @language zh_CN
  7179. */
  7180. allowMultipleSelection: boolean;
  7181. /**
  7182. * @private
  7183. */
  7184. private _selectedIndices;
  7185. /**
  7186. * @private
  7187. */
  7188. private _proposedSelectedIndices;
  7189. /**
  7190. * An Array of numbers representing the indices of the currently selected
  7191. * item or items.
  7192. *
  7193. * @default []
  7194. *
  7195. * @version Egret 2.4
  7196. * @version eui 1.0
  7197. * @platform Web,Native
  7198. * @language en_US
  7199. */
  7200. /**
  7201. * 当前选中的一个或多个项目的索引列表。
  7202. *
  7203. * @default []
  7204. *
  7205. * @version Egret 2.4
  7206. * @version eui 1.0
  7207. * @platform Web,Native
  7208. * @language zh_CN
  7209. */
  7210. selectedIndices: number[];
  7211. /**
  7212. * @inheritDoc
  7213. *
  7214. * @version Egret 2.4
  7215. * @version eui 1.0
  7216. * @platform Web,Native
  7217. */
  7218. selectedIndex: number;
  7219. /**
  7220. * An Array representing the currently selected data items.
  7221. *
  7222. * @version Egret 2.4
  7223. * @version eui 1.0
  7224. * @platform Web,Native
  7225. * @language en_US
  7226. */
  7227. /**
  7228. * 表示当前选定数据项的列表
  7229. *
  7230. * @version Egret 2.4
  7231. * @version eui 1.0
  7232. * @platform Web,Native
  7233. * @language zh_CN
  7234. */
  7235. selectedItems: any[];
  7236. /**
  7237. * Specify whether the selectedIndices changed programmatically or due to
  7238. * user interaction.
  7239. *
  7240. * @param value An array of numbers representing the indices of the selected
  7241. * @param dispatchChangeEvent whether dispatched a change event.
  7242. *
  7243. * @version Egret 2.4
  7244. * @version eui 1.0
  7245. * @platform Web,Native
  7246. * @language en_US
  7247. */
  7248. /**
  7249. * 设置多个选中项。
  7250. *
  7251. * @param value 选中项索引的数组
  7252. * @param dispatchChangeEvent 是否派发changed事件
  7253. *
  7254. * @version Egret 2.4
  7255. * @version eui 1.0
  7256. * @platform Web,Native
  7257. * @language zh_CN
  7258. */
  7259. protected setSelectedIndices(value: number[], dispatchChangeEvent?: boolean): void;
  7260. /**
  7261. * @inheritDoc
  7262. *
  7263. * @version Egret 2.4
  7264. * @version eui 1.0
  7265. * @platform Web,Native
  7266. */
  7267. protected commitProperties(): void;
  7268. /**
  7269. * @inheritDoc
  7270. *
  7271. * @version Egret 2.4
  7272. * @version eui 1.0
  7273. * @platform Web,Native
  7274. */
  7275. protected commitSelection(dispatchChangedEvents?: boolean): boolean;
  7276. /**
  7277. * @private
  7278. * 是否是有效的索引
  7279. */
  7280. private isValidIndex;
  7281. /**
  7282. * Given a new selection interval, figure out which
  7283. * items are newly added/removed from the selection interval and update
  7284. * selection properties and view accordingly.
  7285. *
  7286. * @version Egret 2.4
  7287. * @version eui 1.0
  7288. * @platform Web,Native
  7289. * @language en_US
  7290. */
  7291. /**
  7292. * 从给定的选择区间中找出新增或者移除的项,并更新属性。
  7293. *
  7294. * @version Egret 2.4
  7295. * @version eui 1.0
  7296. * @platform Web,Native
  7297. * @language zh_CN
  7298. */
  7299. protected commitMultipleSelection(): void;
  7300. /**
  7301. * @private
  7302. *
  7303. * @param index
  7304. * @returns
  7305. */
  7306. $isItemIndexSelected(index: number): boolean;
  7307. /**
  7308. * @inheritDoc
  7309. *
  7310. * @version Egret 2.4
  7311. * @version eui 1.0
  7312. * @platform Web,Native
  7313. */
  7314. dataProviderRefreshed(): void;
  7315. /**
  7316. * @private
  7317. * 计算当前的选中项列表
  7318. */
  7319. private calculateSelectedIndices(index);
  7320. /**
  7321. * @inheritDoc
  7322. *
  7323. * @version Egret 2.4
  7324. * @version eui 1.0
  7325. * @platform Web,Native
  7326. */
  7327. protected onRendererTouchEnd(event: egret.TouchEvent): void;
  7328. }
  7329. }
  7330. declare namespace eui {
  7331. /**
  7332. * The Panel class defines a container that includes a title bar,
  7333. * a closeButton, a moveArea, and a content area for its children.
  7334. *
  7335. * @event eui.UIEvent.CLOSING Dispatched when the close button is taped
  7336. * you can use <code>event.preventDefault()</code> to prevent close.
  7337. *
  7338. * @defaultProperty elementsContent
  7339. * @version Egret 2.4
  7340. * @version eui 1.0
  7341. * @platform Web,Native
  7342. * @includeExample extension/eui/components/PanelExample.ts
  7343. * @language en_US
  7344. */
  7345. /**
  7346. * Panel 类定义一个容器,该容器为其子代提供标题栏、关闭按钮、可移动区域和内容区域。
  7347. *
  7348. * @event eui.UIEvent.CLOSING 面板即将关闭事件,在关闭按钮被点击后抛出,
  7349. * 监听此事件并调用<code>event.preventDefault()</code>能够阻止面板被关闭。
  7350. *
  7351. * @defaultProperty elementsContent
  7352. * @version Egret 2.4
  7353. * @version eui 1.0
  7354. * @platform Web,Native
  7355. * @includeExample extension/eui/components/PanelExample.ts
  7356. * @language zh_CN
  7357. */
  7358. class Panel extends Component {
  7359. /**
  7360. * Constructor.
  7361. *
  7362. * @version Egret 2.4
  7363. * @version eui 1.0
  7364. * @platform Web,Native
  7365. * @language en_US
  7366. */
  7367. /**
  7368. * 构造函数。
  7369. *
  7370. * @version Egret 2.4
  7371. * @version eui 1.0
  7372. * @platform Web,Native
  7373. * @language zh_CN
  7374. */
  7375. constructor();
  7376. /**
  7377. * @private
  7378. * 在窗体上按下时前置窗口
  7379. */
  7380. private onWindowTouchBegin(event);
  7381. /**
  7382. * write-only property,This property is Usually invoked in resolving an EXML for adding multiple children quickly.
  7383. *
  7384. * @version Egret 2.4
  7385. * @version eui 1.0
  7386. * @platform Web,Native
  7387. * @language en_US
  7388. */
  7389. /**
  7390. * 只写属性,此属性通常在 EXML 的解析器中调用,便于快速添加多个子项。
  7391. * @version Egret 2.4
  7392. * @version eui 1.0
  7393. * @platform Web,Native
  7394. * @language zh_CN
  7395. */
  7396. elementsContent: egret.DisplayObject[];
  7397. /**
  7398. * The skin part that defines the appearance of the close button.
  7399. * When taped, the close button dispatches a <code>closing</code> event.
  7400. *
  7401. * @skinPart
  7402. *
  7403. * @version Egret 2.4
  7404. * @version eui 1.0
  7405. * @platform Web,Native
  7406. * @language en_US
  7407. */
  7408. /**
  7409. * 关闭按钮
  7410. *
  7411. * @skinPart
  7412. *
  7413. * @version Egret 2.4
  7414. * @version eui 1.0
  7415. * @platform Web,Native
  7416. * @language zh_CN
  7417. */
  7418. closeButton: Button;
  7419. /**
  7420. * The area where the user must drag to move the window.
  7421. *
  7422. * @version Egret 2.4
  7423. * @version eui 1.0
  7424. * @platform Web,Native
  7425. * @language en_US
  7426. */
  7427. /**
  7428. * 可移动区域
  7429. *
  7430. * @skinPart
  7431. *
  7432. * @version Egret 2.4
  7433. * @version eui 1.0
  7434. * @platform Web,Native
  7435. * @language zh_CN
  7436. */
  7437. moveArea: egret.DisplayObject;
  7438. /**
  7439. * The skin part that defines the appearance of the
  7440. * title text in the container.
  7441. *
  7442. * @skinPart
  7443. *
  7444. * @version Egret 2.4
  7445. * @version eui 1.0
  7446. * @platform Web,Native
  7447. * @language en_US
  7448. */
  7449. /**
  7450. * 标题显示对象
  7451. *
  7452. * @skinPart
  7453. *
  7454. * @version Egret 2.4
  7455. * @version eui 1.0
  7456. * @platform Web,Native
  7457. * @language zh_CN
  7458. */
  7459. titleDisplay: IDisplayText;
  7460. /**
  7461. * @private
  7462. */
  7463. private _title;
  7464. /**
  7465. * Title or caption displayed in the title bar.
  7466. *
  7467. * @default ""
  7468. *
  7469. * @version Egret 2.4
  7470. * @version eui 1.0
  7471. * @platform Web,Native
  7472. * @language en_US
  7473. */
  7474. /**
  7475. * 标题栏中显示的标题。
  7476. *
  7477. * @default ""
  7478. *
  7479. * @version Egret 2.4
  7480. * @version eui 1.0
  7481. * @platform Web,Native
  7482. * @language zh_CN
  7483. */
  7484. title: string;
  7485. /**
  7486. * @inheritDoc
  7487. *
  7488. * @version Egret 2.4
  7489. * @version eui 1.0
  7490. * @platform Web,Native
  7491. */
  7492. protected partAdded(partName: string, instance: any): void;
  7493. /**
  7494. * @inheritDoc
  7495. *
  7496. * @version Egret 2.4
  7497. * @version eui 1.0
  7498. * @platform Web,Native
  7499. */
  7500. protected partRemoved(partName: string, instance: any): void;
  7501. /**
  7502. * Dispatch the "closing" event when the closeButton is clicked.
  7503. *
  7504. * @version Egret 2.4
  7505. * @version eui 1.0
  7506. * @platform Web,Native
  7507. * @language en_US
  7508. */
  7509. /**
  7510. * 当 closeButton 被点击时派发 “closing” 事件
  7511. *
  7512. * @version Egret 2.4
  7513. * @version eui 1.0
  7514. * @platform Web,Native
  7515. * @language zh_CN
  7516. */
  7517. protected onCloseButtonClick(event: egret.TouchEvent): void;
  7518. /**
  7519. * Close the panel and remove from the parent container.
  7520. *
  7521. * @version Egret 2.4
  7522. * @version eui 1.0
  7523. * @platform Web,Native
  7524. * @language en_US
  7525. */
  7526. /**
  7527. * 关闭面板,从父级容器移除自身。
  7528. *
  7529. * @version Egret 2.4
  7530. * @version eui 1.0
  7531. * @platform Web,Native
  7532. * @language zh_CN
  7533. */
  7534. close(): void;
  7535. /**
  7536. * @private
  7537. * 触摸按下时的偏移量
  7538. */
  7539. private offsetPointX;
  7540. /**
  7541. * @private
  7542. */
  7543. private offsetPointY;
  7544. /**
  7545. * Called when the user starts dragging a Panel.
  7546. *
  7547. * @version Egret 2.4
  7548. * @version eui 1.0
  7549. * @platform Web,Native
  7550. * @language en_US
  7551. */
  7552. /**
  7553. * 在可移动区域按下
  7554. *
  7555. * @version Egret 2.4
  7556. * @version eui 1.0
  7557. * @platform Web,Native
  7558. * @language zh_CN
  7559. */
  7560. protected onTouchBegin(event: egret.TouchEvent): void;
  7561. /**
  7562. * Called when the user drags a Panel.
  7563. *
  7564. * @version Egret 2.4
  7565. * @version eui 1.0
  7566. * @platform Web,Native
  7567. * @language en_US
  7568. */
  7569. /**
  7570. * 触摸拖拽时的移动事件
  7571. *
  7572. * @version Egret 2.4
  7573. * @version eui 1.0
  7574. * @platform Web,Native
  7575. * @language zh_CN
  7576. */
  7577. protected onTouchMove(event: egret.TouchEvent): void;
  7578. /**
  7579. * Called when the user releases the Panel.
  7580. *
  7581. * @version Egret 2.4
  7582. * @version eui 1.0
  7583. * @platform Web,Native
  7584. * @language en_US
  7585. */
  7586. /**
  7587. * 在舞台上弹起事件
  7588. *
  7589. * @version Egret 2.4
  7590. * @version eui 1.0
  7591. * @platform Web,Native
  7592. * @language zh_CN
  7593. */
  7594. protected onTouchEnd(event: egret.TouchEvent): void;
  7595. }
  7596. }
  7597. declare namespace eui {
  7598. /**
  7599. * The ProgressBar control provides a visual representation of the progress of a task over time.
  7600. *
  7601. * @version Egret 2.4
  7602. * @version eui 1.0
  7603. * @platform Web,Native
  7604. * @includeExample extension/eui/components/ProgressBarExample.ts
  7605. * @language en_US
  7606. */
  7607. /**
  7608. * ProgressBar 控件为随时间而变的任务进度提供了形象化的表示。
  7609. *
  7610. * @version Egret 2.4
  7611. * @version eui 1.0
  7612. * @platform Web,Native
  7613. * @includeExample extension/eui/components/ProgressBarExample.ts
  7614. * @language zh_CN
  7615. */
  7616. class ProgressBar extends Range {
  7617. /**
  7618. * Constructor.
  7619. *
  7620. * @version Egret 2.4
  7621. * @version eui 1.0
  7622. * @platform Web,Native
  7623. * @language en_US
  7624. */
  7625. /**
  7626. * 构造函数。
  7627. *
  7628. * @version Egret 2.4
  7629. * @version eui 1.0
  7630. * @platform Web,Native
  7631. * @language zh_CN
  7632. */
  7633. constructor();
  7634. /**
  7635. * this hightlight component of the progressbar.
  7636. *
  7637. * @skinPart
  7638. *
  7639. * @version Egret 2.4
  7640. * @version eui 1.0
  7641. * @platform Web,Native
  7642. * @language en_US
  7643. */
  7644. /**
  7645. * 进度高亮显示对象。
  7646. *
  7647. * @skinPart
  7648. *
  7649. * @version Egret 2.4
  7650. * @version eui 1.0
  7651. * @platform Web,Native
  7652. * @language zh_CN
  7653. */
  7654. thumb: eui.UIComponent;
  7655. /**
  7656. * the label of the progressbar.
  7657. *
  7658. * @skinPart
  7659. *
  7660. * @version Egret 2.4
  7661. * @version eui 1.0
  7662. * @platform Web,Native
  7663. * @language en_US
  7664. */
  7665. /**
  7666. * 进度条文本
  7667. *
  7668. * @skinPart
  7669. *
  7670. * @version Egret 2.4
  7671. * @version eui 1.0
  7672. * @platform Web,Native
  7673. * @language zh_CN
  7674. */
  7675. labelDisplay: Label;
  7676. /**
  7677. * @private
  7678. */
  7679. private _labelFunction;
  7680. /**
  7681. * a text format callback function。example:
  7682. * <code>labelFunction(value:Number,maximum:Number):String;</code>
  7683. *
  7684. * @version Egret 2.4
  7685. * @version eui 1.0
  7686. * @platform Web,Native
  7687. * @language en_US
  7688. */
  7689. /**
  7690. * 进度条文本格式化回调函数。示例:
  7691. * <code>labelFunction(value:Number,maximum:Number):String;</code>
  7692. *
  7693. * @version Egret 2.4
  7694. * @version eui 1.0
  7695. * @platform Web,Native
  7696. * @language zh_CN
  7697. */
  7698. labelFunction: (value: number, maximum: number) => string;
  7699. /**
  7700. * Convert the current value to display text
  7701. *
  7702. * @param value the current value
  7703. * @param maximum the maximum value
  7704. *
  7705. * @return a converted text
  7706. *
  7707. * @version Egret 2.4
  7708. * @version eui 1.0
  7709. * @platform Web,Native
  7710. * @language en_US
  7711. */
  7712. /**
  7713. * 将当前value转换成文本
  7714. *
  7715. * @param value 当前值
  7716. * @param maximum 最大值
  7717. *
  7718. * @return 转换后的文本
  7719. *
  7720. * @version Egret 2.4
  7721. * @version eui 1.0
  7722. * @platform Web,Native
  7723. * @language zh_CN
  7724. */
  7725. protected valueToLabel(value: number, maximum: number): string;
  7726. /**
  7727. * @private
  7728. */
  7729. private _slideDuration;
  7730. /**
  7731. * Duration in milliseconds for a sliding animation
  7732. * when the value changing. If the vlaue is 0, no animation will be done.
  7733. *
  7734. * @default 500
  7735. *
  7736. * @version Egret 2.4
  7737. * @version eui 1.0
  7738. * @platform Web,Native
  7739. * @language en_US
  7740. */
  7741. /**
  7742. * value改变时更新视图的缓动动画时间(毫秒为单位)。设置为0则不执行缓动。
  7743. *
  7744. * @default 500
  7745. *
  7746. * @version Egret 2.4
  7747. * @version eui 1.0
  7748. * @platform Web,Native
  7749. * @language zh_CN
  7750. */
  7751. slideDuration: number;
  7752. /**
  7753. * @private
  7754. */
  7755. private _direction;
  7756. /**
  7757. * Direction in which the fill of the ProgressBar expands toward completion.
  7758. * you should use the <code>Direction</code> class constants to set the property.
  7759. *
  7760. * @default Direction.LTR
  7761. *
  7762. * @version Egret 2.4
  7763. * @version eui 1.0
  7764. * @platform Web,Native
  7765. * @language en_US
  7766. */
  7767. /**
  7768. * ProgressBar 填充在逐步完成过程中扩展的方向。使用 <code>Direction</code> 类定义的常量。
  7769. *
  7770. * @default Direction.LTR
  7771. *
  7772. * @version Egret 2.4
  7773. * @version eui 1.0
  7774. * @platform Web,Native
  7775. * @language zh_CN
  7776. */
  7777. direction: string;
  7778. /**
  7779. * @private
  7780. * 动画实例
  7781. */
  7782. private animation;
  7783. /**
  7784. * @private
  7785. * 动画播放结束时要到达的value。
  7786. */
  7787. private slideToValue;
  7788. /**
  7789. * @private
  7790. *
  7791. * @param newValue
  7792. */
  7793. $setValue(newValue: number): boolean;
  7794. /**
  7795. * @private
  7796. */
  7797. private animationValue;
  7798. /**
  7799. * @private
  7800. * 动画播放更新数值
  7801. */
  7802. private animationUpdateHandler(animation);
  7803. /**
  7804. * @private
  7805. */
  7806. private thumbInitX;
  7807. /**
  7808. * @private
  7809. */
  7810. private thumbInitY;
  7811. /**
  7812. * @inheritDoc
  7813. *
  7814. * @version Egret 2.4
  7815. * @version eui 1.0
  7816. * @platform Web,Native
  7817. */
  7818. protected partAdded(partName: string, instance: any): void;
  7819. /**
  7820. * @inheritDoc
  7821. *
  7822. * @version Egret 2.4
  7823. * @version eui 1.0
  7824. * @platform Web,Native
  7825. */
  7826. protected partRemoved(partName: string, instance: any): void;
  7827. /**
  7828. * @private
  7829. * thumb的位置或尺寸发生改变
  7830. */
  7831. private onThumbResize(event);
  7832. /**
  7833. * @inheritDoc
  7834. *
  7835. * @version Egret 2.4
  7836. * @version eui 1.0
  7837. * @platform Web,Native
  7838. */
  7839. protected updateSkinDisplayList(): void;
  7840. }
  7841. }
  7842. declare namespace eui {
  7843. /**
  7844. * The RadioButton component allows the user make a single choice
  7845. * within a set of mutually exclusive choices.
  7846. *
  7847. * @version Egret 2.4
  7848. * @version eui 1.0
  7849. * @platform Web,Native
  7850. * @includeExample extension/eui/components/RadioButtonExample.ts
  7851. * @language en_US
  7852. */
  7853. /**
  7854. * RadioButton 组件使用户可在一组互相排斥的选择中做出一种选择
  7855. *
  7856. * @version Egret 2.4
  7857. * @version eui 1.0
  7858. * @platform Web,Native
  7859. * @includeExample extension/eui/components/RadioButtonExample.ts
  7860. * @language zh_CN
  7861. */
  7862. class RadioButton extends ToggleButton {
  7863. /**
  7864. * Constructor.
  7865. *
  7866. * @version Egret 2.4
  7867. * @version eui 1.0
  7868. * @platform Web,Native
  7869. * @language en_US
  7870. */
  7871. /**
  7872. * 构造函数。
  7873. *
  7874. * @version Egret 2.4
  7875. * @version eui 1.0
  7876. * @platform Web,Native
  7877. * @language zh_CN
  7878. */
  7879. constructor();
  7880. /**
  7881. * @private
  7882. * 在RadioButtonGroup中的索引
  7883. */
  7884. $indexNumber: number;
  7885. /**
  7886. * @private
  7887. * 所属的RadioButtonGroup
  7888. */
  7889. $radioButtonGroup: RadioButtonGroup;
  7890. /**
  7891. * The RadioButton component is enabled if the
  7892. * RadioButtonGroup is enabled and the RadioButton itself is enabled.
  7893. *
  7894. * @version Egret 2.4
  7895. * @version eui 1.0
  7896. * @platform Web,Native
  7897. * @language en_US
  7898. */
  7899. /**
  7900. * 如果 RadioButtonGroup 启用且 RadioButton 本身也启用,则 RadioButton 组件启用。
  7901. *
  7902. * @version Egret 2.4
  7903. * @version eui 1.0
  7904. * @platform Web,Native
  7905. * @language zh_CN
  7906. */
  7907. enabled: boolean;
  7908. /**
  7909. * @private
  7910. */
  7911. private _group;
  7912. /**
  7913. * The RadioButtonGroup component to which this RadioButton belongs.
  7914. * If this property is not set,
  7915. * a unique RadioButtonGroup is created automatically based on the groupName property.
  7916. *
  7917. * @see eui.RadioButton#groupName
  7918. *
  7919. * @version Egret 2.4
  7920. * @version eui 1.0
  7921. * @platform Web,Native
  7922. * @language en_US
  7923. */
  7924. /**
  7925. * 此 RadioButton 所属的 RadioButtonGroup 组件。
  7926. * 若不设置此属性,则根据groupName属性自动创建一个唯一的RadioButtonGroup。
  7927. *
  7928. * @see eui.RadioButton#groupName
  7929. *
  7930. * @version Egret 2.4
  7931. * @version eui 1.0
  7932. * @platform Web,Native
  7933. * @language zh_CN
  7934. */
  7935. group: RadioButtonGroup;
  7936. /**
  7937. * @private
  7938. */
  7939. private groupChanged;
  7940. /**
  7941. * @private
  7942. */
  7943. private _groupName;
  7944. /**
  7945. * Specifies the name of the group to which this RadioButton component belongs
  7946. *
  7947. * @default “radioGroup”
  7948. *
  7949. * @see eui.RadioButton#group
  7950. *
  7951. * @version Egret 2.4
  7952. * @version eui 1.0
  7953. * @platform Web,Native
  7954. * @language en_US
  7955. */
  7956. /**
  7957. * RadioButton 组件所属的组的名称
  7958. *
  7959. * @default “radioGroup”
  7960. *
  7961. * @see eui.RadioButton#group
  7962. *
  7963. * @version Egret 2.4
  7964. * @version eui 1.0
  7965. * @platform Web,Native
  7966. * @language zh_CN
  7967. */
  7968. groupName: string;
  7969. /**
  7970. * @private
  7971. *
  7972. * @param value
  7973. */
  7974. $setSelected(value: boolean): boolean;
  7975. /**
  7976. * @private
  7977. */
  7978. private _value;
  7979. /**
  7980. * Optional user-defined value
  7981. * that is associated with a RadioButton component.
  7982. *
  7983. * @default null
  7984. *
  7985. * @version Egret 2.4
  7986. * @version eui 1.0
  7987. * @platform Web,Native
  7988. * @language en_US
  7989. */
  7990. /**
  7991. * 与 RadioButton 组件关联的可选用户定义值。
  7992. *
  7993. * @default null
  7994. *
  7995. * @version Egret 2.4
  7996. * @version eui 1.0
  7997. * @platform Web,Native
  7998. * @language zh_CN
  7999. */
  8000. value: any;
  8001. /**
  8002. * @inheritDoc
  8003. *
  8004. * @version Egret 2.4
  8005. * @version eui 1.0
  8006. * @platform Web,Native
  8007. */
  8008. protected commitProperties(): void;
  8009. /**
  8010. * @inheritDoc
  8011. *
  8012. * @version Egret 2.4
  8013. * @version eui 1.0
  8014. * @platform Web,Native
  8015. */
  8016. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  8017. /**
  8018. * @inheritDoc
  8019. *
  8020. * @version Egret 2.4
  8021. * @version eui 1.0
  8022. * @platform Web,Native
  8023. */
  8024. protected buttonReleased(): void;
  8025. /**
  8026. * @private
  8027. * 添此单选按钮加到组
  8028. */
  8029. private addToGroup();
  8030. }
  8031. }
  8032. declare namespace eui {
  8033. /**
  8034. * The RadioButtonGroup component defines a group of RadioButton components
  8035. * that act as a single mutually exclusive component; therefore,
  8036. * a user can select only one RadioButton component at a time.
  8037. *
  8038. * @event egret.Event.CHANGE Dispatched when the value of the selected RadioButton component in
  8039. * this group changes.
  8040. *
  8041. * @version Egret 2.4
  8042. * @version eui 1.0
  8043. * @platform Web,Native
  8044. * @includeExample extension/eui/components/RadioButtonGroupExample.ts
  8045. * @language en_US
  8046. */
  8047. /**
  8048. * RadioButtonGroup 组件定义一组 RadioButton 组件,这些组件相互排斥;因此,用户每次只能选择一个 RadioButton 组件
  8049. *
  8050. * @event egret.Event.CHANGE 此组中所选 RadioButton 组件的值更改时分派。
  8051. *
  8052. * @version Egret 2.4
  8053. * @version eui 1.0
  8054. * @platform Web,Native
  8055. * @includeExample extension/eui/components/RadioButtonGroupExample.ts
  8056. * @language zh_CN
  8057. */
  8058. class RadioButtonGroup extends egret.EventDispatcher {
  8059. /**
  8060. * Constructor.
  8061. *
  8062. * @version Egret 2.4
  8063. * @version eui 1.0
  8064. * @platform Web,Native
  8065. * @language en_US
  8066. */
  8067. /**
  8068. * 构造函数。
  8069. *
  8070. * @version Egret 2.4
  8071. * @version eui 1.0
  8072. * @platform Web,Native
  8073. * @language zh_CN
  8074. */
  8075. constructor();
  8076. /**
  8077. * @private
  8078. * 组名
  8079. */
  8080. $name: string;
  8081. /**
  8082. * @private
  8083. * 单选按钮列表
  8084. */
  8085. private radioButtons;
  8086. /**
  8087. * Returns the RadioButton component at the specified index.
  8088. *
  8089. * @param index The 0-based index of the RadioButton in the
  8090. * RadioButtonGroup.
  8091. *
  8092. * @return The specified RadioButton component if index is between
  8093. * 0 and <code>numRadioButtons</code> - 1. Returns
  8094. * <code>null</code> if the index is invalid.
  8095. *
  8096. * @see eui.RadioButtonGroup#numRadioButtons
  8097. *
  8098. * @version Egret 2.4
  8099. * @version eui 1.0
  8100. * @platform Web,Native
  8101. * @language en_US
  8102. */
  8103. /**
  8104. * 返回指定索引处的 RadioButton 组件。
  8105. *
  8106. * @param index RadioButtonGroup 中的 RadioButton 的从零开始的索引。
  8107. *
  8108. * @return 当索引位于 0 和 <code>numRadioButtons</code> 之间时,指定的 RadioButton 组件为 1。
  8109. * 如果索引无效,则返回 <code>null</code>。
  8110. *
  8111. * @see eui.RadioButtonGroup#numRadioButtons
  8112. *
  8113. * @version Egret 2.4
  8114. * @version eui 1.0
  8115. * @platform Web,Native
  8116. * @language zh_CN
  8117. */
  8118. getRadioButtonAt(index: number): RadioButton;
  8119. /**
  8120. * @private
  8121. */
  8122. $enabled: boolean;
  8123. /**
  8124. * Determines whether selection is allowed. Note that the value returned
  8125. * only reflects the value that was explicitly set on the
  8126. * <code>RadioButtonGroup</code> and does not reflect any values explicitly
  8127. * set on the individual RadioButtons.
  8128. *
  8129. * @default true
  8130. *
  8131. * @version Egret 2.4
  8132. * @version eui 1.0
  8133. * @platform Web,Native
  8134. * @language en_US
  8135. */
  8136. /**
  8137. * 确定是否允许选择。请注意,返回的值仅反映对 <code>RadioButtonGroup</code> 显式设置的值,
  8138. * 而不反映对各个 RadioButton 显式设置的任何值。
  8139. *
  8140. * @default true
  8141. *
  8142. * @version Egret 2.4
  8143. * @version eui 1.0
  8144. * @platform Web,Native
  8145. * @language zh_CN
  8146. */
  8147. enabled: boolean;
  8148. /**
  8149. * The number of RadioButtons that belong to this RadioButtonGroup.
  8150. *
  8151. * @default 0
  8152. *
  8153. * @version Egret 2.4
  8154. * @version eui 1.0
  8155. * @platform Web,Native
  8156. * @language en_US
  8157. */
  8158. /**
  8159. * 属于此 RadioButtonGroup 的 RadioButton 数。
  8160. *
  8161. * @default 0
  8162. *
  8163. * @version Egret 2.4
  8164. * @version eui 1.0
  8165. * @platform Web,Native
  8166. * @language zh_CN
  8167. */
  8168. readonly numRadioButtons: number;
  8169. /**
  8170. * @private
  8171. */
  8172. private _selectedValue;
  8173. /**
  8174. * The <code>value</code> property of the selected
  8175. * RadioButton component in the group, if it has been set,
  8176. * otherwise, the <code>label</code> property of the selected RadioButton.
  8177. * If no RadioButton is selected, this property is <code>null</code>.
  8178. *
  8179. * <p>If you set <code>selectedValue</code>, selects the
  8180. * first RadioButton component whose <code>value</code> or
  8181. * <code>label</code> property matches this value.</p>
  8182. *
  8183. * @default null
  8184. *
  8185. * @version Egret 2.4
  8186. * @version eui 1.0
  8187. * @platform Web,Native
  8188. * @language en_US
  8189. */
  8190. /**
  8191. * 组中所选 RadioButton 组件的 <code>value</code> 属性(如果未设置),
  8192. * 否则为所选 RadioButton 组件的 <code>label</code> 属性。
  8193. * 如果未选择任何 RadioButton,则此属性为 <code>null</code>。
  8194. *
  8195. * <p>如果设置了 <code>selectedValue</code>,则会选择 <code>value</code> 或 <code>label</code> 属性
  8196. * 与此值匹配的第一个 RadioButton 组件。</p>
  8197. *
  8198. * @default null
  8199. *
  8200. * @version Egret 2.4
  8201. * @version eui 1.0
  8202. * @platform Web,Native
  8203. * @language zh_CN
  8204. */
  8205. selectedValue: any;
  8206. /**
  8207. * @private
  8208. */
  8209. private _selection;
  8210. /**
  8211. * Contains a reference to the currently selected
  8212. * RadioButton component in the group.This property is valid only
  8213. * when the target RadioButton is displayed on the display list
  8214. *
  8215. * @default null
  8216. *
  8217. * @version Egret 2.4
  8218. * @version eui 1.0
  8219. * @platform Web,Native
  8220. * @language en_US
  8221. */
  8222. /**
  8223. * 当前被选中的单选按钮引用。此属性仅当目标RadioButton在显示列表时有效。
  8224. *
  8225. * @default null
  8226. *
  8227. * @version Egret 2.4
  8228. * @version eui 1.0
  8229. * @platform Web,Native
  8230. * @language zh_CN
  8231. */
  8232. selection: RadioButton;
  8233. /**
  8234. * @private
  8235. * 添加单选按钮到组内
  8236. */
  8237. $addInstance(instance: RadioButton): void;
  8238. /**
  8239. * @private
  8240. * 从组里移除单选按钮
  8241. */
  8242. $removeInstance(instance: RadioButton, addListener?: boolean): void;
  8243. /**
  8244. * @private
  8245. * 设置选中的单选按钮
  8246. */
  8247. $setSelection(value: RadioButton, fireChange?: boolean): boolean;
  8248. /**
  8249. * @private
  8250. * 改变选中项
  8251. */
  8252. private changeSelection(index, fireChange?);
  8253. /**
  8254. * @private
  8255. * 单选按钮添加到显示列表
  8256. */
  8257. private addedHandler(event);
  8258. /**
  8259. * @private
  8260. * 单选按钮从显示列表移除
  8261. */
  8262. private removedHandler(event);
  8263. }
  8264. }
  8265. declare namespace eui {
  8266. /**
  8267. * The Rect component is a rectangular shape. It can be touched.
  8268. * @version Egret 2.5.5
  8269. * @version eui 1.0
  8270. * @platform Web,Native
  8271. * @language en_US
  8272. */
  8273. /**
  8274. * Rect 组件矩形绘图元素。此组件可响应鼠标事件。
  8275. * @version Egret 2.5.5
  8276. * @version eui 1.0
  8277. * @platform Web,Native
  8278. * @language zh_CN
  8279. */
  8280. class Rect extends Component {
  8281. constructor(width?: number, height?: number, fillColor?: number);
  8282. protected createNativeDisplayObject(): void;
  8283. /**
  8284. * @private
  8285. */
  8286. $graphics: egret.Graphics;
  8287. readonly graphics: egret.Graphics;
  8288. /**
  8289. * @private
  8290. */
  8291. $measureContentBounds(bounds: egret.Rectangle): void;
  8292. private $fillColor;
  8293. /**
  8294. * Fill color
  8295. * @version Egret 2.5.5
  8296. * @version eui 1.0
  8297. * @platform Web,Native
  8298. * @language en_US
  8299. */
  8300. /**
  8301. * 填充颜色
  8302. * @version Egret 2.5.5
  8303. * @version eui 1.0
  8304. * @platform Web,Native
  8305. * @language zh_CN
  8306. */
  8307. fillColor: number;
  8308. private $fillAlpha;
  8309. /**
  8310. * Fill alpha
  8311. * @version Egret 2.5.5
  8312. * @version eui 1.0
  8313. * @platform Web,Native
  8314. * @language en_US
  8315. */
  8316. /**
  8317. * 填充透明度,默认值为1。
  8318. * @version Egret 2.5.5
  8319. * @version eui 1.0
  8320. * @platform Web,Native
  8321. * @language zh_CN
  8322. */
  8323. fillAlpha: number;
  8324. private $strokeColor;
  8325. /**
  8326. * The line's color inside the rect border. Caution: when the strokeWeight is 0, a line is not drawn
  8327. * @version Egret 2.5.5
  8328. * @version eui 1.0
  8329. * @platform Web,Native
  8330. * @language en_US
  8331. */
  8332. /**
  8333. * 边框颜色,注意:当 strokeWeight 为 0 时,不显示边框。
  8334. * @version Egret 2.5.5
  8335. * @version eui 1.0
  8336. * @platform Web,Native
  8337. * @language zh_CN
  8338. */
  8339. strokeColor: number;
  8340. private $strokeAlpha;
  8341. /**
  8342. * The line's alpha inside the rect border. Caution: when the strokeWeight is 0, a line is not drawn
  8343. * @version Egret 2.5.5
  8344. * @version eui 1.0
  8345. * @platform Web,Native
  8346. * @language en_US
  8347. */
  8348. /**
  8349. * 边框透明度,注意:当 strokeWeight 为0时,不显示边框。
  8350. * @version Egret 2.5.5
  8351. * @version eui 1.0
  8352. * @platform Web,Native
  8353. * @language zh_CN
  8354. */
  8355. strokeAlpha: number;
  8356. private $strokeWeight;
  8357. /**
  8358. * The line's thickness inside the rect border. Caution: when the strokeWeight is 0, a line is not drawn
  8359. * @version Egret 2.5.5
  8360. * @version eui 1.0
  8361. * @platform Web,Native
  8362. * @language en_US
  8363. */
  8364. /**
  8365. * 边框粗细(像素),注意:当 strokeWeight 为 0 时,不显示边框。
  8366. * @version Egret 2.5.5
  8367. * @version eui 1.0
  8368. * @platform Web,Native
  8369. * @language zh_CN
  8370. */
  8371. strokeWeight: number;
  8372. private $ellipseWidth;
  8373. /**
  8374. * Width used to draw an ellipse with rounded corners (in pixels).
  8375. * @version Egret 2.5.5
  8376. * @version eui 1.0
  8377. * @platform Web,Native
  8378. * @language en_US
  8379. */
  8380. /**
  8381. * 用于绘制圆角的椭圆的宽度(以像素为单位)
  8382. * @version Egret 2.5.5
  8383. * @version eui 1.0
  8384. * @platform Web,Native
  8385. * @language zh_CN
  8386. */
  8387. ellipseWidth: number;
  8388. private $ellipseHeight;
  8389. /**
  8390. * Height used to draw an ellipse with rounded corners (in pixels). If no value is specified, the default value matches the value of the ellipseWidth parameter.
  8391. * @version Egret 2.5.5
  8392. * @version eui 1.0
  8393. * @platform Web,Native
  8394. * @language en_US
  8395. */
  8396. /**
  8397. * 用于绘制圆角的椭圆的高度 (以像素为单位)。如果未指定值,则默认值与为 ellipseWidth 参数提供的值相匹配。
  8398. * @version Egret 2.5.5
  8399. * @version eui 1.0
  8400. * @platform Web,Native
  8401. * @language zh_CN
  8402. */
  8403. ellipseHeight: number;
  8404. /**
  8405. * @copy eui.UIComponent#updateDisplayList
  8406. *
  8407. * @version Egret 2.5.5
  8408. * @version eui 1.0
  8409. * @platform Web,Native
  8410. */
  8411. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  8412. /**
  8413. * @private
  8414. */
  8415. $onRemoveFromStage(): void;
  8416. }
  8417. }
  8418. declare namespace eui {
  8419. /**
  8420. * The Scroller component displays a single scrollable component,
  8421. * called a viewport, and horizontal and vertical scroll bars.
  8422. * The viewport must implement the IViewport interface.
  8423. * <p>The Group components implement the IViewport interface
  8424. * and can be used as the children of the Scroller control,
  8425. * as the following example shows:</p>
  8426. * <pre>
  8427. * <s:Scroller width="100" height="100">
  8428. * <s:Group>
  8429. * <s:Image width="300" height="400" source="assets/logo.jpg"/>
  8430. * </s:Group>
  8431. * </s:Scroller>
  8432. * </pre>
  8433. * <p>The size of the Image control is set larger than that of its parent Group container.
  8434. * By default, the child extends past the boundaries of the parent container.
  8435. * Rather than allow the child to extend past the boundaries of the parent container,
  8436. * the Scroller specifies to clip the child to the boundaries and display scroll bars.</p>
  8437. *
  8438. * @event eui.UIEvent.CHANGE_START Dispatched when the scroll position is going to change
  8439. * @event eui.UIEvent.CHANGE_END Dispatched when the scroll position changed complete
  8440. * @event egret.Event.CHANGE Dispatched when the scroll position is changing
  8441. * @event egret.TouchEvent.TOUCH_CANCEL canceled the touch
  8442. *
  8443. * @defaultProperty viewport
  8444. * @version Egret 2.4
  8445. * @version eui 1.0
  8446. * @platform Web,Native
  8447. * @includeExample extension/eui/components/ScrollerExample.ts
  8448. * @language en_US
  8449. */
  8450. /**
  8451. * Scroller 组件显示一个称为视域的单个可滚动组件,以及水平滚动条和垂直滚动条。该视域必须实现 IViewport 接口。
  8452. * <p>Group 组件实现 IViewport 接口,且可以用作 Scroller 控件的子代,如下例所示:</p>
  8453. * <pre>
  8454. * <s:Scroller width="100" height="100">
  8455. * <s:Group>
  8456. * <s:Image width="300" height="400" source="assets/logo.jpg"/>
  8457. * </s:Group>
  8458. * </s:Scroller>
  8459. * </pre>
  8460. * Image 控件的大小比其父 Group 容器设置得大。默认情况下,子代超过父容器的边界。
  8461. * Scroller 会指定将子代剪切到边界并显示滚动条,而不是让子代超过父容器的边界。
  8462. *
  8463. * @event eui.UIEvent.CHANGE_START 滚动位置改变开始
  8464. * @event eui.UIEvent.CHANGE_END 滚动位置改变结束
  8465. * @event egret.Event.CHANGE 滚动位置改变的时候
  8466. * @event egret.TouchEvent.TOUCH_CANCEL 取消触摸事件
  8467. *
  8468. * @defaultProperty viewport
  8469. * @version Egret 2.4
  8470. * @version eui 1.0
  8471. * @platform Web,Native
  8472. * @includeExample extension/eui/components/ScrollerExample.ts
  8473. * @language zh_CN
  8474. */
  8475. class Scroller extends Component {
  8476. /**
  8477. * The threshold value(in pixels) trigger the rolling.
  8478. * when the touch points deviate from the initial touch point than this value will trigger the rolling.
  8479. *
  8480. * @default 5
  8481. *
  8482. * @version Egret 2.4
  8483. * @version eui 1.0
  8484. * @platform Web,Native
  8485. * @language en_US
  8486. */
  8487. /**
  8488. * 开始触发滚动的阈值(以像素为单位),当触摸点偏离初始触摸点的距离超过这个值时才会触发滚动。
  8489. *
  8490. * @default 5
  8491. *
  8492. * @version Egret 2.4
  8493. * @version eui 1.0
  8494. * @platform Web,Native
  8495. * @language zh_CN
  8496. */
  8497. static scrollThreshold: number;
  8498. /**
  8499. * Constructor.
  8500. *
  8501. * @version Egret 2.4
  8502. * @version eui 1.0
  8503. * @platform Web,Native
  8504. * @language en_US
  8505. */
  8506. /**
  8507. * 构造函数。
  8508. *
  8509. * @version Egret 2.4
  8510. * @version eui 1.0
  8511. * @platform Web,Native
  8512. * @language zh_CN
  8513. */
  8514. constructor();
  8515. private $bounces;
  8516. /**
  8517. * Whether to enable rebound, rebound When enabled, ScrollView contents allowed to continue to drag the border after arriving at the end user drag operation, and then bounce back boundary position
  8518. * @default true
  8519. * @version Egret 2.5.6
  8520. * @language en_US
  8521. */
  8522. /**
  8523. * 是否启用回弹,当启用回弹后,ScrollView中内容在到达边界后允许继续拖动,在用户拖动操作结束后,再反弹回边界位置
  8524. * @default true
  8525. * @version Egret 2.5.6
  8526. * @language zh_CN
  8527. */
  8528. bounces: boolean;
  8529. /**
  8530. * Adjust the speed to get out of the slide end.When equal to 0,the scroll animation will not be play.
  8531. * @version Egret 2.4
  8532. * @version eui 1.0
  8533. * @platform Web,Native
  8534. * @language en_US
  8535. */
  8536. /**
  8537. * 调节滑动结束时滚出的速度。等于0时,没有滚动动画
  8538. * @version Egret 2.4
  8539. * @version eui 1.0
  8540. * @platform Web,Native
  8541. * @language zh_CN
  8542. */
  8543. throwSpeed: number;
  8544. /**
  8545. * @private
  8546. */
  8547. $getThrowInfo(currentPos: number, toPos: number): eui.ScrollerThrowEvent;
  8548. /**
  8549. * @private
  8550. */
  8551. $Scroller: Object;
  8552. /**
  8553. * the horizontal scroll bar
  8554. *
  8555. * @skinPart
  8556. *
  8557. * @version Egret 2.4
  8558. * @version eui 1.0
  8559. * @platform Web,Native
  8560. * @language en_US
  8561. */
  8562. /**
  8563. * 水平滚动条
  8564. *
  8565. * @skinPart
  8566. *
  8567. * @version Egret 2.4
  8568. * @version eui 1.0
  8569. * @platform Web,Native
  8570. * @language zh_CN
  8571. */
  8572. horizontalScrollBar: eui.HScrollBar;
  8573. /**
  8574. * the vertical scroll bar
  8575. *
  8576. * @skinPart
  8577. *
  8578. * @version Egret 2.4
  8579. * @version eui 1.0
  8580. * @platform Web,Native
  8581. * @language en_US
  8582. */
  8583. /**
  8584. * 垂直滚动条
  8585. *
  8586. * @skinPart
  8587. *
  8588. * @version Egret 2.4
  8589. * @version eui 1.0
  8590. * @platform Web,Native
  8591. * @language zh_CN
  8592. */
  8593. verticalScrollBar: eui.VScrollBar;
  8594. /**
  8595. * Indicates under what conditions the scroller can be moved and the vertical scroll bar is displayed.
  8596. * <p><code>ScrollPolicy.ON</code> - the scroller can be moved, and the scroll bar is displayed when it's move.</p>
  8597. * <p><code>ScrollPolicy.OFF</code> - the scroller can not be moved, the scroll bar is never displayed.</p>
  8598. * <p><code>ScrollPolicy.AUTO</code> - the scroller can not be moved when
  8599. * the viewport's contentHeight is larger than its height. the scroll bar is displayed when it's move.
  8600. *
  8601. * @default ScrollPolicy.AUTO
  8602. *
  8603. * @version Egret 2.4
  8604. * @version eui 1.0
  8605. * @platform Web,Native
  8606. * @language en_US
  8607. */
  8608. /**
  8609. * 指示在哪些条件可以滚动并且显示垂直滑动条。
  8610. * <p><code>ScrollPolicy.ON</code> - 可以滚动,滚动时显示滚动条。</p>
  8611. * <p><code>ScrollPolicy.OFF</code> - 不可以滚动并且不显示滚动条。</p>
  8612. * <p><code>ScrollPolicy.AUTO</code> - 当视域的 contentHeight 大于其自身的高度时可以滚动,滚动时显示滚动条。</p>
  8613. *
  8614. * @default ScrollPolicy.AUTO
  8615. *
  8616. * @version Egret 2.4
  8617. * @version eui 1.0
  8618. * @platform Web,Native
  8619. * @language zh_CN
  8620. */
  8621. scrollPolicyV: string;
  8622. /**
  8623. * Indicates under what conditions the scroller can be moved and the horizontal scroll bar is displayed.
  8624. * <p><code>ScrollPolicy.ON</code> - the scroller can be moved, and the scroll bar is displayed when it's move.</p>
  8625. * <p><code>ScrollPolicy.OFF</code> - the scroller can not be moved, the scroll bar is never displayed.</p>
  8626. * <p><code>ScrollPolicy.AUTO</code> - the can not be moved when
  8627. * the viewport's contentWidth is larger than its width. the scroll bar is displayed when it's move.
  8628. *
  8629. * @default ScrollPolicy.AUTO
  8630. *
  8631. * @version Egret 2.4
  8632. * @version eui 1.0
  8633. * @platform Web,Native
  8634. * @language en_US
  8635. */
  8636. /**
  8637. * 指示在哪些条件下可以滚动并且显示水平滑动条。
  8638. * <p><code>ScrollPolicy.ON</code> - 可以滚动,滚动时显示滚动条。</p>
  8639. * <p><code>ScrollPolicy.OFF</code> - 不可以滚动并且不显示滚动条。</p>
  8640. * <p><code>ScrollPolicy.AUTO</code> - 当视域的 contentWidth 大于其自身的宽度时可以滚动,滚动时显示滚动条。</p>
  8641. *
  8642. * @default ScrollPolicy.AUTO
  8643. *
  8644. * @version Egret 2.4
  8645. * @version eui 1.0
  8646. * @platform Web,Native
  8647. * @language zh_CN
  8648. */
  8649. scrollPolicyH: string;
  8650. /**
  8651. * Stop the scroller animation
  8652. * @version Egret 3.0.2
  8653. * @version eui 1.0
  8654. * @platform Web,Native
  8655. * @language en_US
  8656. */
  8657. /**
  8658. * 停止滚动的动画
  8659. *
  8660. * @version Egret 3.0.2
  8661. * @version eui 1.0
  8662. * @platform Web,Native
  8663. * @language zh_CN
  8664. */
  8665. stopAnimation(): void;
  8666. /**
  8667. * The viewport component to be scrolled.
  8668. *
  8669. * @version Egret 2.4
  8670. * @version eui 1.0
  8671. * @platform Web,Native
  8672. * @language en_US
  8673. */
  8674. /**
  8675. * 要滚动的视域组件。
  8676. *
  8677. * @version Egret 2.4
  8678. * @version eui 1.0
  8679. * @platform Web,Native
  8680. * @language zh_CN
  8681. */
  8682. viewport: IViewport;
  8683. /**
  8684. * @private
  8685. * 安装并初始化视域组件
  8686. */
  8687. private installViewport();
  8688. /**
  8689. * @private
  8690. * 卸载视域组件
  8691. */
  8692. private uninstallViewport();
  8693. private onViewPortRemove(event);
  8694. /**
  8695. * @inheritDoc
  8696. *
  8697. * @version Egret 2.4
  8698. * @version eui 1.0
  8699. * @platform Web,Native
  8700. */
  8701. protected setSkin(skin: Skin): void;
  8702. /**
  8703. * @private
  8704. * @param event
  8705. */
  8706. private onTouchBeginCapture(event);
  8707. /**
  8708. * @private
  8709. * @param event
  8710. */
  8711. private onTouchEndCapture(event);
  8712. /**
  8713. * @private
  8714. * @param event
  8715. */
  8716. private onTouchTapCapture(event);
  8717. /**
  8718. * @private
  8719. * 检查当前滚动策略,若有一个方向可以滚动,返回true。
  8720. */
  8721. private checkScrollPolicy();
  8722. /**
  8723. * @private
  8724. * 记录按下的对象,touchCancle时使用
  8725. */
  8726. private downTarget;
  8727. private tempStage;
  8728. /**
  8729. * @private
  8730. *
  8731. * @param event
  8732. */
  8733. private onTouchBegin(event);
  8734. /**
  8735. * @private
  8736. *
  8737. * @param event
  8738. */
  8739. private onTouchMove(event);
  8740. /**
  8741. * @private
  8742. * @param event
  8743. */
  8744. private onTouchCancel(event);
  8745. /**
  8746. * @private
  8747. * @param event
  8748. */
  8749. private dispatchBubbleEvent(event);
  8750. /**
  8751. * @private
  8752. * @param event
  8753. */
  8754. private dispatchCancelEvent(event);
  8755. /**
  8756. * @private
  8757. * @param event
  8758. */
  8759. private onTouchEnd(event);
  8760. /**
  8761. * @private
  8762. */
  8763. private onRemoveListeners();
  8764. /**
  8765. * @private
  8766. *
  8767. * @param scrollPos
  8768. */
  8769. private horizontalUpdateHandler(scrollPos);
  8770. /**
  8771. * @private
  8772. *
  8773. * @param scrollPos
  8774. */
  8775. private verticalUpdateHandler(scrollPos);
  8776. /**
  8777. * @private
  8778. *
  8779. */
  8780. private horizontalEndHandler();
  8781. /**
  8782. * @private
  8783. *
  8784. */
  8785. private verticalEndHanlder();
  8786. /**
  8787. * @private
  8788. *
  8789. */
  8790. private onChangeEnd();
  8791. /**
  8792. * @private
  8793. *
  8794. * @param event
  8795. */
  8796. private onAutoHideTimer(event);
  8797. /**
  8798. * @inheritDoc
  8799. *
  8800. * @version Egret 2.4
  8801. * @version eui 1.0
  8802. * @platform Web,Native
  8803. */
  8804. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  8805. /**
  8806. * @inheritDoc
  8807. *
  8808. * @version Egret 2.4
  8809. * @version eui 1.0
  8810. * @platform Web,Native
  8811. */
  8812. protected partAdded(partName: string, instance: any): void;
  8813. }
  8814. }
  8815. declare namespace eui {
  8816. /**
  8817. * The Skin class defines the base class for all skins.
  8818. * You typically don't need to manually create the instance of this class.
  8819. * It can be created by resolving a EXML.<p/>
  8820. *
  8821. * @example You typically write the skin classes in EXML, as the followiong example shows:<p/>
  8822. * <pre>
  8823. * <?xml version="1.0" encoding="utf-8"?>
  8824. * <s:Skin xmlns:s="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
  8825. * <states>
  8826. * <!-- Specify the states controlled by this skin. -->
  8827. * </states>
  8828. * <!-- Define skin. -->
  8829. * </s:Skin>
  8830. * </pre>
  8831. *
  8832. * @defaultProperty elementsContent
  8833. * @version Egret 2.4
  8834. * @version eui 1.0
  8835. * @platform Web,Native
  8836. * @includeExample extension/eui/components/SkinExample.ts
  8837. * @language en_US
  8838. */
  8839. /**
  8840. * 皮肤基类。通常情况下,您不需要手动创建这个类的实例,而是通过解析EXML文件后自动生成。<p/>
  8841. *
  8842. * @example 通常您可以按照如下方式写EXML代码:<p/>
  8843. * <pre>
  8844. * <?xml version="1.0" encoding="utf-8"?>
  8845. * <s:Skin xmlns:s="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
  8846. * <states>
  8847. * <!-- Specify the states controlled by this skin. -->
  8848. * </states>
  8849. * <!-- Define skin. -->
  8850. * </s:Skin>
  8851. * </pre>
  8852. *
  8853. * @defaultProperty elementsContent
  8854. * @version Egret 2.4
  8855. * @version eui 1.0
  8856. * @platform Web,Native
  8857. * @includeExample extension/eui/components/SkinExample.ts
  8858. * @language zh_CN
  8859. */
  8860. class Skin extends egret.EventDispatcher {
  8861. /**
  8862. * The list of skin parts name
  8863. * @version Egret 2.4
  8864. * @version eui 1.0
  8865. * @platform Web,Native
  8866. * @language en_US
  8867. */
  8868. /**
  8869. * 皮肤部件名称列表
  8870. * @version Egret 2.4
  8871. * @version eui 1.0
  8872. * @platform Web,Native
  8873. * @language zh_CN
  8874. */
  8875. skinParts: string[];
  8876. /**
  8877. * The maximum recommended width of the component to be considered.
  8878. * This property can only affect measure result of host component.
  8879. *
  8880. * @default 100000
  8881. *
  8882. * @version Egret 2.4
  8883. * @version eui 1.0
  8884. * @platform Web,Native
  8885. * @language en_US
  8886. */
  8887. /**
  8888. * 皮肤的最大宽度。仅影响主机组件的测量结果。
  8889. *
  8890. * @default 100000
  8891. *
  8892. * @version Egret 2.4
  8893. * @version eui 1.0
  8894. * @platform Web,Native
  8895. * @language zh_CN
  8896. */
  8897. maxWidth: number;
  8898. /**
  8899. * The minimum recommended width of the component to be considered.
  8900. * This property can only affect measure result of host component.
  8901. *
  8902. * @default 0
  8903. *
  8904. * @version Egret 2.4
  8905. * @version eui 1.0
  8906. * @platform Web,Native
  8907. * @language en_US
  8908. */
  8909. /**
  8910. * 皮肤的最小宽度,此属性设置为大于maxWidth的值时无效。仅影响主机组件的测量结果。
  8911. *
  8912. * @default 0
  8913. *
  8914. * @version Egret 2.4
  8915. * @version eui 1.0
  8916. * @platform Web,Native
  8917. * @language zh_CN
  8918. */
  8919. minWidth: number;
  8920. /**
  8921. * The maximum recommended height of the component to be considered.
  8922. * This property can only affect measure result of host component.
  8923. *
  8924. * @default 100000
  8925. *
  8926. * @version Egret 2.4
  8927. * @version eui 1.0
  8928. * @platform Web,Native
  8929. * @language en_US
  8930. */
  8931. /**
  8932. * 皮肤的最大高度。仅影响主机组件的测量结果。
  8933. *
  8934. * @default 100000
  8935. *
  8936. * @version Egret 2.4
  8937. * @version eui 1.0
  8938. * @platform Web,Native
  8939. * @language zh_CN
  8940. */
  8941. maxHeight: number;
  8942. /**
  8943. * The minimum recommended height of the component to be considered.
  8944. * This property can only affect measure result of host component.
  8945. *
  8946. * @default 0
  8947. *
  8948. * @version Egret 2.4
  8949. * @version eui 1.0
  8950. * @platform Web,Native
  8951. * @language en_US
  8952. */
  8953. /**
  8954. * 皮肤的最小高度,此属性设置为大于maxHeight的值时无效。仅影响主机组件的测量结果。
  8955. *
  8956. * @default 0
  8957. *
  8958. * @version Egret 2.4
  8959. * @version eui 1.0
  8960. * @platform Web,Native
  8961. * @language zh_CN
  8962. */
  8963. minHeight: number;
  8964. /**
  8965. * Number that specifies the explicit width of the skin.
  8966. * This property can only affect measure result of host component.
  8967. * @default NaN
  8968. *
  8969. * @version Egret 2.4
  8970. * @version eui 1.0
  8971. * @platform Web,Native
  8972. * @language en_US
  8973. */
  8974. /**
  8975. * 皮肤显式设置宽度,设置为 NaN 表示不显式设置。仅影响主机组件的测量结果。
  8976. *
  8977. * @default NaN
  8978. *
  8979. * @version Egret 2.4
  8980. * @version eui 1.0
  8981. * @platform Web,Native
  8982. * @language zh_CN
  8983. */
  8984. width: number;
  8985. /**
  8986. * Number that specifies the explicit height of the skin.
  8987. * This property can only affect measure result of host component.
  8988. *
  8989. * @default NaN
  8990. *
  8991. * @version Egret 2.4
  8992. * @version eui 1.0
  8993. * @platform Web,Native
  8994. * @language en_US
  8995. */
  8996. /**
  8997. * 皮肤显式设置高度,设置为 NaN 表示不显式设置。仅影响主机组件的测量结果。
  8998. *
  8999. * @default NaN
  9000. *
  9001. * @version Egret 2.4
  9002. * @version eui 1.0
  9003. * @platform Web,Native
  9004. * @language zh_CN
  9005. */
  9006. height: number;
  9007. /**
  9008. * @private
  9009. */
  9010. $elementsContent: egret.DisplayObject[];
  9011. elementsContent: egret.DisplayObject[];
  9012. /**
  9013. * @private
  9014. */
  9015. private _hostComponent;
  9016. /**
  9017. * The host component which the skin will be attached.
  9018. * @version Egret 2.4
  9019. * @version eui 1.0
  9020. * @platform Web,Native
  9021. * @language en_US
  9022. */
  9023. /**
  9024. * 此皮肤附加到的主机组件
  9025. * @version Egret 2.4
  9026. * @version eui 1.0
  9027. * @platform Web,Native
  9028. * @language zh_CN
  9029. */
  9030. hostComponent: Component;
  9031. /**
  9032. * @private
  9033. *
  9034. * @param event
  9035. */
  9036. private onAddedToStage(event?);
  9037. /**
  9038. * @private
  9039. */
  9040. $stateValues: sys.StateValues;
  9041. /**
  9042. * The list of state for host component.
  9043. * @version Egret 2.4
  9044. * @version eui 1.0
  9045. * @platform Web,Native
  9046. * @language en_US
  9047. */
  9048. /**
  9049. * 为此组件定义的视图状态。
  9050. * @version Egret 2.4
  9051. * @version eui 1.0
  9052. * @platform Web,Native
  9053. * @language zh_CN
  9054. */
  9055. states: State[];
  9056. /**
  9057. * The current state of host component.
  9058. * Set to <code>""</code> or <code>null</code> to reset the component back to its base state.
  9059. * @version Egret 2.4
  9060. * @version eui 1.0
  9061. * @platform Web,Native
  9062. * @language en_US
  9063. */
  9064. /**
  9065. * 组件的当前视图状态。将其设置为 "" 或 null 可将组件重置回其基本状态。
  9066. * @version Egret 2.4
  9067. * @version eui 1.0
  9068. * @platform Web,Native
  9069. * @language zh_CN
  9070. */
  9071. currentState: string;
  9072. /**
  9073. * Check if contains the specifies state name.
  9074. * @param stateName the state name need to be checked
  9075. * @version Egret 2.4
  9076. * @version eui 1.0
  9077. * @platform Web,Native
  9078. * @language en_US
  9079. */
  9080. /**
  9081. * 返回是否含有指定名称的视图状态
  9082. * @param stateName 要检查的视图状态名称
  9083. * @version Egret 2.4
  9084. * @version eui 1.0
  9085. * @platform Web,Native
  9086. * @language zh_CN
  9087. */
  9088. hasState: (stateName: string) => boolean;
  9089. /**
  9090. * @private
  9091. * 初始化所有视图状态
  9092. */
  9093. private initializeStates;
  9094. /**
  9095. * @private
  9096. * 应用当前的视图状态。子类覆盖此方法在视图状态发生改变时执行相应更新操作。
  9097. */
  9098. private commitCurrentState;
  9099. }
  9100. }
  9101. declare namespace eui {
  9102. /**
  9103. * The TabBar class displays a set of identical tabs.
  9104. * One tab can be selected at a time, and the first tab is selected by default.
  9105. * <p>The set of tabs is defined by the <code>dataProvider</code> property.
  9106. * The appearance of each tab is defined by the <code>ItemRenderer</code> class.</p>
  9107. * <p>You can use the TabBar control to set the active child of a ViewStack container,
  9108. * as the following example shows:</p>
  9109. * <pre>
  9110. * <s:TabBar dataProvider="{viewStack}"/>
  9111. * <s:ViewStack id="viewStack">
  9112. * <s:Group name="tab1"/>
  9113. * <s:Group name="tab2"/>
  9114. * <s:Group name="tab3"/>
  9115. * </s:ViewStack>
  9116. * </pre>
  9117. *
  9118. * @version Egret 2.4
  9119. * @version eui 1.0
  9120. * @platform Web,Native
  9121. * @includeExample extension/eui/components/TabBarExample.ts
  9122. * @language en_US
  9123. */
  9124. /**
  9125. * TabBar 类显示一组相同的选项卡。一次可以选择一个选项卡,且默认情况下选择第一个选项卡。
  9126. * <p>该组选项卡由 <code>dataProvider</code> 属性定义。
  9127. * 每个选项卡的外观由 <code>ItemRenderer</code> 定义。</p>
  9128. * <p>可以使用 TabBar 控件设置 ViewStack 容器的活动子代,如下例所示:</p>
  9129. * <pre>
  9130. * <s:TabBar dataProvider="{viewStack}"/>
  9131. * <s:ViewStack id="viewStack">
  9132. * <s:Group name="tab1"/>
  9133. * <s:Group name="tab2"/>
  9134. * <s:Group name="tab3"/>
  9135. * </s:ViewStack>
  9136. * </pre>
  9137. *
  9138. * @version Egret 2.4
  9139. * @version eui 1.0
  9140. * @platform Web,Native
  9141. * @includeExample extension/eui/components/TabBarExample.ts
  9142. * @language zh_CN
  9143. */
  9144. class TabBar extends ListBase {
  9145. /**
  9146. * Constructor.
  9147. *
  9148. * @version Egret 2.4
  9149. * @version eui 1.0
  9150. * @platform Web,Native
  9151. * @language en_US
  9152. */
  9153. /**
  9154. * 构造函数。
  9155. *
  9156. * @version Egret 2.4
  9157. * @version eui 1.0
  9158. * @platform Web,Native
  9159. * @language zh_CN
  9160. */
  9161. constructor();
  9162. /**
  9163. * @inheritDoc
  9164. *
  9165. * @version Egret 2.4
  9166. * @version eui 1.0
  9167. * @platform Web,Native
  9168. */
  9169. protected createChildren(): void;
  9170. /**
  9171. * @private
  9172. *
  9173. * @param value
  9174. */
  9175. $setDataProvider(value: ICollection): boolean;
  9176. /**
  9177. * @private
  9178. */
  9179. private indexBeingUpdated;
  9180. /**
  9181. * @private
  9182. * 触摸点击的选中项改变
  9183. */
  9184. private onIndexChanged(event);
  9185. /**
  9186. * @private
  9187. * ViewStack选中项发生改变
  9188. */
  9189. private onViewStackIndexChange(event);
  9190. }
  9191. }
  9192. declare namespace eui.sys {
  9193. /**
  9194. * @private
  9195. */
  9196. const enum TextInputKeys {
  9197. prompt = 0,
  9198. displayAsPassword = 1,
  9199. textColor = 2,
  9200. maxChars = 3,
  9201. maxWidth = 4,
  9202. maxHeight = 5,
  9203. text = 6,
  9204. restrict = 7,
  9205. inputType = 8,
  9206. }
  9207. }
  9208. declare namespace eui {
  9209. /**
  9210. *
  9211. */
  9212. /**
  9213. * The TextInput is a textfield input component, the user can input and edit the text.
  9214. *
  9215. * @version Egret 2.5.7
  9216. * @version eui 1.0
  9217. * @platform Web,Native
  9218. * @includeExample extension/eui/components/TextInputExample.ts
  9219. * @language en_US
  9220. */
  9221. /**
  9222. * TextInput 是一个文本输入控件,供用户输入和编辑统一格式文本
  9223. *
  9224. * @version Egret 2.5.7
  9225. * @version eui 1.0
  9226. * @platform Web,Native
  9227. * @includeExample extension/eui/components/TextInputExample.ts
  9228. * @language zh_CN
  9229. */
  9230. class TextInput extends Component {
  9231. constructor();
  9232. /**
  9233. * @private
  9234. */
  9235. $TextInput: Object;
  9236. /**
  9237. * [SkinPart] The TextInput display
  9238. * @skinPart
  9239. * @version Egret 2.5.7
  9240. * @version eui 1.0
  9241. * @platform Web,Native
  9242. * @language en_US
  9243. */
  9244. /**
  9245. * [SkinPart] 实体文本输入组件
  9246. * @skinPart
  9247. * @version Egret 2.5.7
  9248. * @version eui 1.0
  9249. * @platform Web,Native
  9250. * @language zh_CN
  9251. */
  9252. textDisplay: EditableText;
  9253. /**
  9254. * [SkinPart] When the property of the text is empty, it will show the defalut string.
  9255. * @skinPart
  9256. * @version Egret 2.4
  9257. * @version eui 1.0
  9258. * @platform Web,Native
  9259. * @language zh_CN
  9260. */
  9261. /**
  9262. * [SkinPart] 当text属性为空字符串时要显示的文本。
  9263. * @skinPart
  9264. * @version Egret 2.4
  9265. * @version eui 1.0
  9266. * @platform Web,Native
  9267. * @language zh_CN
  9268. */
  9269. promptDisplay: Label;
  9270. /**
  9271. * @copy eui.EditableText#prompt
  9272. *
  9273. * @version Egret 2.5.7
  9274. * @version eui 1.0
  9275. * @platform Web,Native
  9276. */
  9277. /**
  9278. * @copy eui.EditableText#prompt
  9279. *
  9280. * @version Egret 2.5.7
  9281. * @version eui 1.0
  9282. * @platform Web,Native
  9283. */
  9284. prompt: string;
  9285. /**
  9286. * @copy egret.TextField#displayAsPassword
  9287. *
  9288. * @version Egret 2.5.7
  9289. * @version eui 1.0
  9290. * @platform Web,Native
  9291. */
  9292. /**
  9293. * @copy egret.TextField#displayAsPassword
  9294. *
  9295. * @version Egret 2.5.7
  9296. * @version eui 1.0
  9297. * @platform Web,Native
  9298. */
  9299. displayAsPassword: boolean;
  9300. /**
  9301. * @copy egret.TextField#inputType
  9302. *
  9303. * @version Egret 3.1.6
  9304. * @version eui 1.0
  9305. * @platform Web,Native
  9306. */
  9307. /**
  9308. * @copy egret.TextField#inputType
  9309. *
  9310. * @version Egret 3.1.6
  9311. * @version eui 1.0
  9312. * @platform Web,Native
  9313. */
  9314. inputType: string;
  9315. /**
  9316. * @copy egret.TextField#textColor
  9317. *
  9318. * @version Egret 2.5.7
  9319. * @version eui 1.0
  9320. * @platform Web,Native
  9321. */
  9322. /**
  9323. * @copy egret.TextField#textColor
  9324. *
  9325. * @version Egret 2.5.7
  9326. * @version eui 1.0
  9327. * @platform Web,Native
  9328. */
  9329. textColor: number;
  9330. /**
  9331. * @copy egret.TextField#maxChars
  9332. *
  9333. * @version Egret 2.5.7
  9334. * @version eui 1.0
  9335. * @platform Web,Native
  9336. */
  9337. /**
  9338. * @copy egret.TextField#maxChars
  9339. *
  9340. * @version Egret 2.5.7
  9341. * @version eui 1.0
  9342. * @platform Web,Native
  9343. */
  9344. maxChars: number;
  9345. /**
  9346. * @inheritDoc
  9347. *
  9348. * @version Egret 2.5.7
  9349. * @version eui 1.0
  9350. * @platform Web,Native
  9351. */
  9352. /**
  9353. * @inheritDoc
  9354. *
  9355. * @version Egret 2.5.7
  9356. * @version eui 1.0
  9357. * @platform Web,Native
  9358. */
  9359. maxWidth: number;
  9360. /**
  9361. * @inheritDoc
  9362. *
  9363. * @version Egret 2.5.7
  9364. * @version eui 1.0
  9365. * @platform Web,Native
  9366. */
  9367. /**
  9368. * @inheritDoc
  9369. *
  9370. * @version Egret 2.5.7
  9371. * @version eui 1.0
  9372. * @platform Web,Native
  9373. */
  9374. maxHeight: number;
  9375. /**
  9376. * @copy egret.TextField#text
  9377. *
  9378. * @version Egret 2.5.7
  9379. * @version eui 1.0
  9380. * @platform Web,Native
  9381. */
  9382. /**
  9383. * @copy egret.TextField#text
  9384. *
  9385. * @version Egret 2.5.7
  9386. * @version eui 1.0
  9387. * @platform Web,Native
  9388. */
  9389. text: string;
  9390. /**
  9391. * @copy egret.TextField#restrict
  9392. *
  9393. * @version Egret 2.5.7
  9394. * @version eui 1.0
  9395. * @platform Web,Native
  9396. */
  9397. /**
  9398. * @copy egret.TextField#restrict
  9399. *
  9400. * @version Egret 2.5.7
  9401. * @version eui 1.0
  9402. * @platform Web,Native
  9403. */
  9404. restrict: string;
  9405. /**
  9406. * @private
  9407. */
  9408. private isFocus;
  9409. /**
  9410. * @private
  9411. * 焦点移入
  9412. */
  9413. private focusInHandler(event);
  9414. /**
  9415. * @private
  9416. * 焦点移出
  9417. */
  9418. private focusOutHandler(event);
  9419. /**
  9420. * @inheritDoc
  9421. *
  9422. * @version Egret 2.5.7
  9423. * @version eui 1.0
  9424. * @platform Web,Native
  9425. */
  9426. protected getCurrentState(): string;
  9427. /**
  9428. * @inheritDoc
  9429. *
  9430. * @version Egret 2.5.7
  9431. * @version eui 1.0
  9432. * @platform Web,Native
  9433. */
  9434. protected partAdded(partName: string, instance: any): void;
  9435. /**
  9436. * @inheritDoc
  9437. *
  9438. * @version Egret 2.5.7
  9439. * @version eui 1.0
  9440. * @platform Web,Native
  9441. */
  9442. protected partRemoved(partName: string, instance: any): void;
  9443. /**
  9444. * @private
  9445. */
  9446. private textDisplayAdded();
  9447. /**
  9448. * @private
  9449. */
  9450. private textDisplayRemoved();
  9451. }
  9452. }
  9453. declare namespace eui {
  9454. /**
  9455. * The CheckBox component consists of an optional label and a small box
  9456. * that can contain a check mark or not.<p/>
  9457. *
  9458. * When a user clicks a CheckBox component or its associated text,
  9459. * the CheckBox component sets its <code>selected</code> property
  9460. * to <code>true</code> for checked, and to <code>false</code> for unchecked.
  9461. *
  9462. * @version Egret 2.4
  9463. * @version eui 1.0
  9464. * @platform Web,Native
  9465. * @includeExample extension/eui/components/CheckboxExample.ts
  9466. * @language en_US
  9467. */
  9468. /**
  9469. * CheckBox 组件包含一个可选标签和一个小方框,该方框内可以包含/不包含复选标记。<p/>
  9470. * 用户单击 CheckBox 组件或其关联文本时,CheckBox 组件会将其 selected 属性设置为 true(表示选中)或 false(表示取消选中)。
  9471. *
  9472. * @version Egret 2.4
  9473. * @version eui 1.0
  9474. * @platform Web,Native
  9475. * @includeExample extension/eui/components/CheckboxExample.ts
  9476. * @language zh_CN
  9477. */
  9478. class CheckBox extends ToggleButton {
  9479. /**
  9480. * Constructor.
  9481. * @version Egret 2.4
  9482. * @version eui 1.0
  9483. * @platform Web,Native
  9484. * @language en_US
  9485. */
  9486. /**
  9487. * 创建一个CheckBox
  9488. * @version Egret 2.4
  9489. * @version eui 1.0
  9490. * @platform Web,Native
  9491. * @language zh_CN
  9492. */
  9493. constructor();
  9494. }
  9495. }
  9496. declare namespace eui {
  9497. /**
  9498. * The ToggleSwitch control defines an on-off control.
  9499. *
  9500. * @version Egret 2.4
  9501. * @version eui 1.0
  9502. * @platform Web,Native
  9503. * @includeExample extension/eui/components/ToggleSwitchExample.ts
  9504. * @language en_US
  9505. */
  9506. /**
  9507. * ToggleSwitch 表示一个开关组件。
  9508. *
  9509. * @version Egret 2.4
  9510. * @version eui 1.0
  9511. * @platform Web,Native
  9512. * @includeExample extension/eui/components/ToggleSwitchExample.ts
  9513. * @language zh_CN
  9514. */
  9515. class ToggleSwitch extends ToggleButton {
  9516. /**
  9517. * Constructor.
  9518. *
  9519. * @version Egret 2.4
  9520. * @version eui 1.0
  9521. * @platform Web,Native
  9522. * @language en_US
  9523. */
  9524. /**
  9525. * 构造函数。
  9526. *
  9527. * @version Egret 2.4
  9528. * @version eui 1.0
  9529. * @platform Web,Native
  9530. * @language zh_CN
  9531. */
  9532. constructor();
  9533. }
  9534. }
  9535. declare namespace eui {
  9536. /**
  9537. * The UILayer class is the subclass of the Group class.It not only has the standard function of the Group class,but also
  9538. * can keep its size the same to the stage size (Stage.stageWidth,Stage.stageHeight).Its size will changes as the stage size changes.
  9539. * like any normal container class,you can create multiple instance of the UILayer class,but it is usually used as the root of the UI display list.
  9540. * @version Egret 2.4
  9541. * @version eui 1.0
  9542. * @platform Web,Native
  9543. * @language en_US
  9544. */
  9545. /**
  9546. * UILayer 是 Group 的子类,它除了具有容器的所有标准功能,还能够自动保持自身尺寸始终与舞台尺寸相同(Stage.stageWidth,Stage.stageHeight)。
  9547. * 当舞台尺寸发生改变时,它会跟随舞台尺寸改变。UILayer 跟普通容器一样,允许创建多个实例,但通常都将它作为UI显示列表的根节点使用。
  9548. * @version Egret 2.4
  9549. * @version eui 1.0
  9550. * @platform Web,Native
  9551. * @language zh_CN
  9552. */
  9553. class UILayer extends Group {
  9554. /**
  9555. * Constructor.
  9556. *
  9557. * @version Egret 2.4
  9558. * @version eui 1.0
  9559. * @platform Web,Native
  9560. * @language en_US
  9561. */
  9562. /**
  9563. * 构造函数。
  9564. *
  9565. * @version Egret 2.4
  9566. * @version eui 1.0
  9567. * @platform Web,Native
  9568. * @language zh_CN
  9569. */
  9570. constructor();
  9571. /**
  9572. * @private
  9573. * 添加到舞台
  9574. */
  9575. private onAddToStage(event?);
  9576. /**
  9577. * @private
  9578. * 从舞台移除
  9579. */
  9580. private onRemoveFromStage(event);
  9581. /**
  9582. * @private
  9583. * 舞台尺寸改变
  9584. */
  9585. private onResize(event?);
  9586. }
  9587. }
  9588. declare namespace eui {
  9589. /**
  9590. * The VScrollBar (vertical scrollbar) control lets you control
  9591. * the portion of data that is displayed when there is too much data
  9592. * to fit vertically in a display area.
  9593. *
  9594. * <p>Although you can use the VScrollBar control as a stand-alone control,
  9595. * you usually combine it as part of another group of components to
  9596. * provide scrolling functionality.</p>
  9597. *
  9598. * @version Egret 2.4
  9599. * @version eui 1.0
  9600. * @platform Web,Native
  9601. * @includeExample extension/eui/components/VScrollBarExample.ts
  9602. * @language en_US
  9603. */
  9604. /**
  9605. * VScrollBar(垂直 ScrollBar)控件可以在因数据太多而不能在显示区域中以垂直方向完全显示时控制显示的数据部分。
  9606. * <p>虽然 VScrollBar 控件可以单独使用,但通常将它与其他组件一起使用来提供滚动功能。</p>
  9607. *
  9608. * @version Egret 2.4
  9609. * @version eui 1.0
  9610. * @platform Web,Native
  9611. * @includeExample extension/eui/components/VScrollBarExample.ts
  9612. * @language zh_CN
  9613. */
  9614. class VScrollBar extends ScrollBarBase {
  9615. /**
  9616. * @inheritDoc
  9617. *
  9618. * @version Egret 2.4
  9619. * @version eui 1.0
  9620. * @platform Web,Native
  9621. */
  9622. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  9623. /**
  9624. * @inheritDoc
  9625. *
  9626. * @version Egret 2.4
  9627. * @version eui 1.0
  9628. * @platform Web,Native
  9629. */
  9630. protected onPropertyChanged(event: eui.PropertyEvent): void;
  9631. }
  9632. }
  9633. declare namespace eui {
  9634. /**
  9635. * The VSlider (vertical slider) control lets users select a value
  9636. * by moving a slider thumb between the end points of the slider track.
  9637. * The current value of the slider is determined by the relative location of the thumb between
  9638. * the end points of the slider, corresponding to the slider's minimum and maximum values.
  9639. *
  9640. * @version Egret 2.4
  9641. * @version eui 1.0
  9642. * @platform Web,Native
  9643. * @includeExample extension/eui/components/VSliderExample.ts
  9644. * @language en_US
  9645. */
  9646. /**
  9647. * 使用 VSlider(垂直滑块)控件,用户可通过在滑块轨道的端点之间移动滑块来选择值。
  9648. * 滑块的当前值由滑块端点(对应于滑块的最小值和最大值)之间滑块的相对位置确定。
  9649. *
  9650. * @version Egret 2.4
  9651. * @version eui 1.0
  9652. * @platform Web,Native
  9653. * @includeExample extension/eui/components/VSliderExample.ts
  9654. * @language zh_CN
  9655. */
  9656. class VSlider extends SliderBase {
  9657. /**
  9658. * Constructor.
  9659. *
  9660. * @version Egret 2.4
  9661. * @version eui 1.0
  9662. * @platform Web,Native
  9663. * @language en_US
  9664. */
  9665. /**
  9666. * 构造函数。
  9667. *
  9668. * @version Egret 2.4
  9669. * @version eui 1.0
  9670. * @platform Web,Native
  9671. * @language zh_CN
  9672. */
  9673. constructor();
  9674. /**
  9675. * @inheritDoc
  9676. *
  9677. * @version Egret 2.4
  9678. * @version eui 1.0
  9679. * @platform Web,Native
  9680. */
  9681. protected pointToValue(x: number, y: number): number;
  9682. /**
  9683. * @private
  9684. *
  9685. * @returns
  9686. */
  9687. private getThumbRange();
  9688. /**
  9689. * @inheritDoc
  9690. *
  9691. * @version Egret 2.4
  9692. * @version eui 1.0
  9693. * @platform Web,Native
  9694. */
  9695. updateSkinDisplayList(): void;
  9696. }
  9697. }
  9698. declare namespace eui {
  9699. /**
  9700. * An ViewStack navigator container consists of a collection of child
  9701. * containers stacked on top of each other, where only one child
  9702. * at a time is visible.
  9703. * When a different child container is selected, it seems to replace
  9704. * the old one because it appears in the same location.
  9705. * However, the old child container still exists; it is just invisible.
  9706. *
  9707. * @event eui.CollectionEvent.COLLECTION_CHANGE Dispatched when the ICollection has been updated in some way.
  9708. *
  9709. * @version Egret 2.4
  9710. * @version eui 1.0
  9711. * @platform Web,Native
  9712. * @includeExample extension/eui/components/ViewStackExample.ts
  9713. * @language en_US
  9714. */
  9715. /**
  9716. * ViewStack 导航器容器由一组彼此上下堆叠的子容器组成,其中一次只可以显示一个子容器。
  9717. * 选择另一个子容器后,它将显示在原来子容器的位置处,所以看起来好像此子容器替换了原来的子容器。
  9718. * 但是,原来的子容器仍然存在,只不过它现在处于不可见状态。
  9719. *
  9720. * @event eui.CollectionEvent.COLLECTION_CHANGE 以某种方式更新 ICollection 后分派。
  9721. *
  9722. * @version Egret 2.4
  9723. * @version eui 1.0
  9724. * @platform Web,Native
  9725. * @includeExample extension/eui/components/ViewStackExample.ts
  9726. * @language zh_CN
  9727. */
  9728. class ViewStack extends Group implements ICollection {
  9729. /**
  9730. * Constructor.
  9731. *
  9732. * @version Egret 2.4
  9733. * @version eui 1.0
  9734. * @platform Web,Native
  9735. * @language en_US
  9736. */
  9737. /**
  9738. * 构造函数。
  9739. *
  9740. * @version Egret 2.4
  9741. * @version eui 1.0
  9742. * @platform Web,Native
  9743. * @language zh_CN
  9744. */
  9745. constructor();
  9746. /**
  9747. * The layout object for this container.
  9748. * This object is responsible for the measurement and layout of
  9749. * the visual elements in the container.
  9750. *
  9751. * @default eui.BasicLayout
  9752. *
  9753. * @version Egret 2.4
  9754. * @version eui 1.0
  9755. * @platform Web,Native
  9756. * @language en_US
  9757. */
  9758. /**
  9759. * 此容器的 layout 对象。此对象负责容器中可视元素的测量和布局。
  9760. *
  9761. * @default eui.BasicLayout
  9762. *
  9763. * @version Egret 2.4
  9764. * @version eui 1.0
  9765. * @platform Web,Native
  9766. * @language zh_CN
  9767. */
  9768. readonly layout: LayoutBase;
  9769. /**
  9770. * @private
  9771. */
  9772. private _selectedChild;
  9773. /**
  9774. * A reference to the currently visible child container.
  9775. * The default is a reference to the first child.
  9776. * If there are no children, this property is <code>null</code>.
  9777. *
  9778. * @version Egret 2.4
  9779. * @version eui 1.0
  9780. * @platform Web,Native
  9781. * @language en_US
  9782. */
  9783. /**
  9784. * 对当前可见子容器的引用。默认设置为对第一个子容器的引用。如果没有子项,则此属性为 <code>null</code>。
  9785. *
  9786. * @version Egret 2.4
  9787. * @version eui 1.0
  9788. * @platform Web,Native
  9789. * @language zh_CN
  9790. */
  9791. selectedChild: egret.DisplayObject;
  9792. /**
  9793. * @private
  9794. * 在属性提交前缓存选中项索引
  9795. */
  9796. private proposedSelectedIndex;
  9797. /**
  9798. * @private
  9799. */
  9800. _selectedIndex: number;
  9801. /**
  9802. * The zero-based index of the currently visible child container.
  9803. * Child indexes are in the range 0, 1, 2, ..., n - 1,
  9804. * where <code>n</code> is the number of children.
  9805. * The default value is 0, corresponding to the first child.
  9806. * If there are no children, the value of this property is <code>-1</code>.
  9807. *
  9808. * @version Egret 2.4
  9809. * @version eui 1.0
  9810. * @platform Web,Native
  9811. * @language en_US
  9812. */
  9813. /**
  9814. * 当前可见子容器的从零开始的索引。子索引的范围是 0、1、2、...、n - 1,其中 <code>n</code> 是子项的数目。
  9815. * 默认值是 0,对应于第一个子项。如果不存在子容器,则此属性的值为 -1。
  9816. *
  9817. * @version Egret 2.4
  9818. * @version eui 1.0
  9819. * @platform Web,Native
  9820. * @language zh_CN
  9821. */
  9822. selectedIndex: number;
  9823. /**
  9824. * @private
  9825. * 设置选中项索引
  9826. */
  9827. private setSelectedIndex(value);
  9828. /**
  9829. * @private
  9830. * 一个子项被添加到容器内,此方法不仅在操作addChild()时会被回调,在操作setChildIndex()或swapChildren时也会回调。
  9831. * 当子项索引发生改变时,会先触发$childRemoved()方法,然后触发$childAdded()方法。
  9832. */
  9833. $childAdded(child: egret.DisplayObject, index: number): void;
  9834. /**
  9835. * @private
  9836. * 一个子项从容器内移除,此方法不仅在操作removeChild()时会被回调,在操作setChildIndex()或swapChildren时也会回调。
  9837. * 当子项索引发生改变时,会先触发$childRemoved()方法,然后触发$childAdded()方法。
  9838. */
  9839. $childRemoved(child: egret.DisplayObject, index: number): void;
  9840. /**
  9841. * @inheritDoc
  9842. *
  9843. * @version Egret 2.4
  9844. * @version eui 1.0
  9845. * @platform Web,Native
  9846. */
  9847. protected commitProperties(): void;
  9848. /**
  9849. * @private
  9850. *
  9851. * @param newIndex
  9852. */
  9853. private commitSelection(newIndex);
  9854. /**
  9855. * @private
  9856. *
  9857. * @param child
  9858. * @param visible
  9859. */
  9860. private showOrHide(child, visible);
  9861. /**
  9862. * number of children
  9863. *
  9864. * @version Egret 2.4
  9865. * @version eui 1.0
  9866. * @platform Web,Native
  9867. * @language en_US
  9868. */
  9869. /**
  9870. * 子项数量
  9871. *
  9872. * @version Egret 2.4
  9873. * @version eui 1.0
  9874. * @platform Web,Native
  9875. * @language zh_CN
  9876. */
  9877. readonly length: number;
  9878. /**
  9879. * @inheritDoc
  9880. *
  9881. * @version Egret 2.4
  9882. * @version eui 1.0
  9883. * @platform Web,Native
  9884. */
  9885. getItemAt(index: number): any;
  9886. /**
  9887. * @inheritDoc
  9888. *
  9889. * @version Egret 2.4
  9890. * @version eui 1.0
  9891. * @platform Web,Native
  9892. */
  9893. getItemIndex(item: any): number;
  9894. }
  9895. }
  9896. declare namespace eui.sys {
  9897. /**
  9898. * @private
  9899. * 数值缓动工具类
  9900. */
  9901. class Animation {
  9902. /**
  9903. * @private
  9904. */
  9905. constructor(updateFunction: (animation: Animation) => void, thisObject: any);
  9906. /**
  9907. * @private
  9908. * 此动画的缓动行为。设置为null意味着不使用缓动,默认值为 sineInOut
  9909. */
  9910. easerFunction: (fraction: number) => number;
  9911. /**
  9912. * @private
  9913. */
  9914. private thisObject;
  9915. /**
  9916. * @private
  9917. * 是否正在播放动画,不包括延迟等待和暂停的阶段
  9918. */
  9919. isPlaying: boolean;
  9920. /**
  9921. * @private
  9922. * 动画持续时间,单位毫秒,默认值500
  9923. */
  9924. duration: number;
  9925. /**
  9926. * @private
  9927. * 动画到当前时间对应的值。
  9928. */
  9929. currentValue: number;
  9930. /**
  9931. * @private
  9932. * 起始值
  9933. */
  9934. from: number;
  9935. /**
  9936. * @private
  9937. * 终点值。
  9938. */
  9939. to: number;
  9940. /**
  9941. * @private
  9942. * 动画启动时刻
  9943. */
  9944. private startTime;
  9945. /**
  9946. * @private
  9947. * 动画播放结束时的回调函数
  9948. */
  9949. endFunction: (animation: Animation) => void;
  9950. /**
  9951. * @private
  9952. * 动画更新时的回调函数
  9953. */
  9954. updateFunction: Function;
  9955. /**
  9956. * @private
  9957. * 开始正向播放动画,无论何时调用都重新从零时刻开始,若设置了延迟会首先进行等待。
  9958. */
  9959. play(): void;
  9960. /**
  9961. * @private
  9962. * 开始播放动画
  9963. */
  9964. private start();
  9965. /**
  9966. * @private
  9967. * 停止播放动画
  9968. */
  9969. stop(): void;
  9970. /**
  9971. * @private
  9972. * 计算当前值并返回动画是否结束
  9973. */
  9974. private doInterval(currentTime);
  9975. }
  9976. }
  9977. declare namespace eui {
  9978. /**
  9979. * Default instance of interface <code>IThemeAdapter</code>.
  9980. * @version Egret 2.4
  9981. * @version eui 1.0
  9982. * @platform Web,Native
  9983. * @language en_US
  9984. */
  9985. /**
  9986. * 默认的IThemeAdapter接口实现。
  9987. * @version Egret 2.4
  9988. * @version eui 1.0
  9989. * @platform Web,Native
  9990. * @language zh_CN
  9991. */
  9992. class DefaultThemeAdapter implements IThemeAdapter {
  9993. /**
  9994. * 解析主题
  9995. * @param url 待解析的主题url
  9996. * @param compFunc 解析完成回调函数,示例:compFunc(e:egret.Event):void;
  9997. * @param errorFunc 解析失败回调函数,示例:errorFunc():void;
  9998. * @param thisObject 回调的this引用
  9999. */
  10000. getTheme(url: string, compFunc: Function, errorFunc: Function, thisObject: any): void;
  10001. }
  10002. }
  10003. declare namespace eui {
  10004. /**
  10005. * The Watcher class defines utility method that you can use with bindable properties.
  10006. * These methods let you define an event handler that is executed whenever a bindable property is updated.
  10007. *
  10008. * @version Egret 2.4
  10009. * @version eui 1.0
  10010. * @platform Web,Native
  10011. * @includeExample extension/eui/binding/WatcherExample.ts
  10012. * @language en_US
  10013. */
  10014. /**
  10015. * Watcher 类能够监视可绑定属性的改变,您可以定义一个事件处理函数作为 Watcher 的回调方法,在每次可绑定属性的值改变时都执行此函数。
  10016. *
  10017. * @version Egret 2.4
  10018. * @version eui 1.0
  10019. * @platform Web,Native
  10020. * @includeExample extension/eui/binding/WatcherExample.ts
  10021. * @language zh_CN
  10022. */
  10023. class Watcher {
  10024. /**
  10025. * Creates and starts a Watcher instance.
  10026. * The Watcher can only watch the property of a Object which host is instance of egret.IEventDispatcher.
  10027. * @param host The object that hosts the property or property chain to be watched.
  10028. * You can use the use the <code>reset()</code> method to change the value of the <code>host</code> argument
  10029. * after creating the Watcher instance.
  10030. * The <code>host</code> maintains a list of <code>handlers</code> to invoke when <code>prop</code> changes.
  10031. * @param chain A value specifying the property or chain to be watched.
  10032. * For example, to watch the property <code>host.a.b.c</code>,
  10033. * call the method as: <code>watch(host, ["a","b","c"], ...)</code>.
  10034. * @param handler An event handler function called when the value of the watched property
  10035. * (or any property in a watched chain) is modified.
  10036. * @param thisObject <code>this</code> object of which binding with handler
  10037. * @returns he ChangeWatcher instance, if at least one property name has been specified to
  10038. * the <code>chain</code> argument; null otherwise.
  10039. * @version Egret 2.4
  10040. * @version eui 1.0
  10041. * @platform Web,Native
  10042. * @language en_US
  10043. */
  10044. /**
  10045. * 创建并启动 Watcher 实例。注意:Watcher 只能监视 host 为 egret.IEventDispatcher 对象的属性改变。若属性链中某个属性所对应的实例不是 egret.IEventDispatcher,
  10046. * 则属性链中在它之后的属性改变将无法检测到。
  10047. * @param host 用于承载要监视的属性或属性链的对象。
  10048. * 创建Watcher实例后,您可以利用<code>reset()</code>方法更改<code>host</code>参数的值。
  10049. * 当<code>prop</code>改变的时候,会使得host对应的一系列<code>handlers</code>被触发。
  10050. * @param chain 用于指定要监视的属性链的值。例如,要监视属性 host.a.b.c,需按以下形式调用此方法:watch¬(host, ["a","b","c"], ...)。
  10051. * @param handler 在监视的目标属性链中任何属性的值发生改变时调用的事件处理函数。
  10052. * @param thisObject handler 方法绑定的this对象
  10053. * @returns 如果已为 chain 参数至少指定了一个属性名称,则返回 Watcher 实例;否则返回 null。
  10054. * @version Egret 2.4
  10055. * @version eui 1.0
  10056. * @platform Web,Native
  10057. * @language zh_CN
  10058. */
  10059. static watch(host: any, chain: string[], handler: (value: any) => void, thisObject: any): Watcher;
  10060. /**
  10061. * @private
  10062. * 检查属性是否可以绑定。若还未绑定,尝试添加绑定事件。若是只读或只写属性,返回false。
  10063. */
  10064. private static checkBindable(host, property);
  10065. /**
  10066. * Constructor.
  10067. * Not for public use. This method is called only from the <code>watch()</code> method.
  10068. * See the <code>watch()</code> method for parameter usage.
  10069. * @version Egret 2.4
  10070. * @version eui 1.0
  10071. * @platform Web,Native
  10072. * @language en_US
  10073. */
  10074. /**
  10075. * 构造函数,非公开。只能从 watch() 方法中调用此方法。有关参数用法,请参阅 watch() 方法。
  10076. * @version Egret 2.4
  10077. * @version eui 1.0
  10078. * @platform Web,Native
  10079. * @language zh_CN
  10080. */
  10081. constructor(property: string, handler: (value: any) => void, thisObject: any, next?: Watcher);
  10082. /**
  10083. * @private
  10084. */
  10085. private host;
  10086. /**
  10087. * @private
  10088. */
  10089. private property;
  10090. /**
  10091. * @private
  10092. */
  10093. private handler;
  10094. /**
  10095. * @private
  10096. */
  10097. private thisObject;
  10098. /**
  10099. * @private
  10100. */
  10101. private next;
  10102. /**
  10103. * @private
  10104. */
  10105. private isExecuting;
  10106. /**
  10107. * Detaches this Watcher instance, and its handler function, from the current host.
  10108. * @version Egret 2.4
  10109. * @version eui 1.0
  10110. * @platform Web,Native
  10111. * @language en_US
  10112. */
  10113. /**
  10114. * 从当前宿主中断开此 Watcher 实例及其处理函数。
  10115. * @version Egret 2.4
  10116. * @version eui 1.0
  10117. * @platform Web,Native
  10118. * @language zh_CN
  10119. */
  10120. unwatch(): void;
  10121. /**
  10122. * Retrieves the current value of the watched property or property chain, or null if the host object is null.
  10123. * @example
  10124. * <pre>
  10125. * watch(obj, ["a","b","c"], ...).getValue() === obj.a.b.c
  10126. * </pre>
  10127. * @version Egret 2.4
  10128. * @version eui 1.0
  10129. * @platform Web,Native
  10130. * @language en_US
  10131. */
  10132. /**
  10133. * 检索观察的属性或属性链的当前值,当宿主对象为空时此值为空。
  10134. * @example
  10135. * <pre>
  10136. * watch(obj, ["a","b","c"], ...).getValue() === obj.a.b.c
  10137. * </pre>
  10138. * @version Egret 2.4
  10139. * @version eui 1.0
  10140. * @platform Web,Native
  10141. * @language zh_CN
  10142. */
  10143. getValue(): any;
  10144. /**
  10145. * Sets the handler function.s
  10146. * @param handler The handler function. This argument must not be null.
  10147. * @version Egret 2.4
  10148. * @version eui 1.0
  10149. * @platform Web,Native
  10150. * @language en_US
  10151. */
  10152. /**
  10153. * 设置处理函数。
  10154. * @param handler 处理函数,此参数必须为非空。
  10155. * @version Egret 2.4
  10156. * @version eui 1.0
  10157. * @platform Web,Native
  10158. * @language zh_CN
  10159. */
  10160. setHandler(handler: (value: any) => void, thisObject: any): void;
  10161. /**
  10162. * Resets this ChangeWatcher instance to use a new host object.
  10163. * You can call this method to reuse a watcher instance on a different host.
  10164. * @version Egret 2.4
  10165. * @version eui 1.0
  10166. * @platform Web,Native
  10167. * @language en_US
  10168. */
  10169. /**
  10170. * 重置此 Watcher 实例使用新的宿主对象。
  10171. * 您可以通过该方法实现一个Watcher实例用于不同的宿主。
  10172. * @version Egret 2.4
  10173. * @version eui 1.0
  10174. * @platform Web,Native
  10175. * @language zh_CN
  10176. */
  10177. reset(newHost: egret.IEventDispatcher): void;
  10178. /**
  10179. * @private
  10180. *
  10181. * @returns
  10182. */
  10183. private getHostPropertyValue();
  10184. /**
  10185. * @private
  10186. */
  10187. private wrapHandler(event);
  10188. /**
  10189. * @private
  10190. */
  10191. private onPropertyChange(property);
  10192. }
  10193. }
  10194. declare namespace eui {
  10195. /**
  10196. * The Binding class defines utility methods for performing data binding.
  10197. * You can use the methods defined in this class to configure data bindings.
  10198. * @version Egret 2.4
  10199. * @version eui 1.0
  10200. * @platform Web,Native
  10201. * @includeExample extension/eui/binding/BindingExample.ts
  10202. * @language en_US
  10203. */
  10204. /**
  10205. * 绑定工具类,用于执行数据绑定用的方法集。您可以使用此类中定义的方法来配置数据绑定。
  10206. * @version Egret 2.4
  10207. * @version eui 1.0
  10208. * @platform Web,Native
  10209. * @includeExample extension/eui/binding/BindingExample.ts
  10210. * @language zh_CN
  10211. */
  10212. class Binding {
  10213. /**
  10214. * Binds a property, <prop>prop</code> on the <code>target</code> Object, to a bindable property or peoperty chain.
  10215. * @param host The object that hosts the property or property chain to be watched.
  10216. * The <code>host</code> maintains a list of <code>targets</code> to update theirs <code>prop</code> when <code>chain</code> changes.
  10217. * @param chain A value specifying the property or chain to be watched. For example, when watch the property <code>host.a.b.c</code>,
  10218. * you need call the method like this: <code>indProperty(host, ["a","b","c"], ...)</code>
  10219. * @param target The Object defining the property to be bound to <code>chain</code>.
  10220. * @param prop The name of the public property defined in the <code>site</code> Object to be bound.
  10221. * @returns A ChangeWatcher instance, if at least one property name has been specified
  10222. * to the <code>chain</code> argument; null otherwise.
  10223. * @version Egret 2.4
  10224. * @version eui 1.0
  10225. * @platform Web,Native
  10226. * @language en_US
  10227. */
  10228. /**
  10229. * 绑定一个对象的属性值到要监视的对象属性上。
  10230. * @param host 用于承载要监视的属性或属性链的对象。
  10231. * 当 <code>host</code>上<code>chain</code>所对应的值发生改变时,<code>target</code>上的<code>prop</code>属性将被自动更新。
  10232. * @param chain 用于指定要监视的属性链的值。例如,要监视属性 <code>host.a.b.c</code>,需按以下形式调用此方法:<code>bindProperty(host, ["a","b","c"], ...)。</code>
  10233. * @param target 本次绑定要更新的目标对象。
  10234. * @param prop 本次绑定要更新的目标属性名称。
  10235. * @returns 如果已为 chain 参数至少指定了一个属性名称,则返回 Watcher 实例;否则返回 null。
  10236. * @version Egret 2.4
  10237. * @version eui 1.0
  10238. * @platform Web,Native
  10239. * @language zh_CN
  10240. */
  10241. static bindProperty(host: any, chain: string[], target: any, prop: string): Watcher;
  10242. /**
  10243. * Binds a callback, <prop>handler</code> on the <code>target</code> Object, to a bindable property or peoperty chain.
  10244. * Callback method to invoke with an argument of the current value of <code>chain</code> when that value changes.
  10245. * @param host The object that hosts the property or property chain to be watched.
  10246. * @param chain A value specifying the property or chain to be watched. For example, when watch the property <code>host.a.b.c</code>,
  10247. * you need call the method like this: <code>indProperty(host, ["a","b","c"], ...)</code>
  10248. * @param handler method to invoke with an argument of the current value of <code>chain</code> when that value changes.
  10249. * @param thisObject <code>this</code> object of binding method
  10250. * @returns A ChangeWatcher instance, if at least one property name has been specified to the <code>chain</code> argument; null otherwise.
  10251. * @version Egret 2.4
  10252. * @version eui 1.0
  10253. * @platform Web,Native
  10254. * @language en_US
  10255. */
  10256. /**
  10257. * 绑定一个回调函数到要监视的对象属性上。当 host上 chain 所对应的值发生改变时,handler 方法将被自动调用。
  10258. * @param host 用于承载要监视的属性或属性链的对象。
  10259. * @param chain 用于指定要监视的属性链的值。例如,要监视属性 host.a.b.c,需按以下形式调用此方法:bindSetter(host, ["a","b","c"], ...)。
  10260. * @param handler 在监视的目标属性链中任何属性的值发生改变时调用的事件处理函数。
  10261. * @param thisObject handler 方法绑定的this对象
  10262. * @returns 如果已为 chain 参数至少指定了一个属性名称,则返回 Watcher 实例;否则返回 null。
  10263. * @version Egret 2.4
  10264. * @version eui 1.0
  10265. * @platform Web,Native
  10266. * @language zh_CN
  10267. */
  10268. static bindHandler(host: any, chain: string[], handler: (value: any) => void, thisObject: any): Watcher;
  10269. static $bindProperties(host: any, templates: any[], chainIndex: number[], target: any, prop: string): Watcher;
  10270. }
  10271. }
  10272. declare namespace eui {
  10273. /**
  10274. * The ArrayCollection class is a wrapper class that exposes an <code>any[]</code> as a collection that can be
  10275. * accessed and manipulated using the methods and properties of the <code>ICollection</code> interfaces.
  10276. * ArrayCollection can notify the view to update item when data source changed.
  10277. *
  10278. * @event eui.CollectionEvent.COLLECTION_CHANGE Dispatched when the ArrayCollection has been updated in some way.
  10279. *
  10280. * @defaultProperty source
  10281. * @version Egret 2.4
  10282. * @version eui 1.0
  10283. * @platform Web,Native
  10284. * @includeExample extension/eui/collections/ArrayCollectionExample.ts
  10285. * @language en_US
  10286. */
  10287. /**
  10288. * ArrayCollection 类是数组的集合类数据结构包装器,可使用<code>ICollection</code>接口的方法和属性对其进行访问和处理。
  10289. * 使用这种数据结构包装普通数组,能在数据源发生改变的时候主动通知视图刷新变更数据项。
  10290. *
  10291. * @event eui.CollectionEvent.COLLECTION_CHANGE 当 ArrayCollection 更新的的时候会派发此事件。
  10292. *
  10293. * @defaultProperty source
  10294. * @version Egret 2.4
  10295. * @version eui 1.0
  10296. * @platform Web,Native
  10297. * @includeExample extension/eui/collections/ArrayCollectionExample.ts
  10298. * @language zh_CN
  10299. */
  10300. class ArrayCollection extends egret.EventDispatcher implements ICollection {
  10301. /**
  10302. * Constructor. <p/>
  10303. * Creates a new ArrayCollection using the specified source array.
  10304. * If no array is specified an empty array will be used.
  10305. * @version Egret 2.4
  10306. * @version eui 1.0
  10307. * @platform Web,Native
  10308. * @language en_US
  10309. */
  10310. /**
  10311. * 构造函数。<p/>
  10312. * 用指定的原始数组创建一个 ArrayCollection 实例。
  10313. * @version Egret 2.4
  10314. * @version eui 1.0
  10315. * @platform Web,Native
  10316. * @language zh_CN
  10317. */
  10318. constructor(source?: any[]);
  10319. /**
  10320. * @private
  10321. */
  10322. private _source;
  10323. /**
  10324. * The source of data in the ArrayCollection.
  10325. * The ArrayCollection object does not represent any changes that you make
  10326. * directly to the source array. Always use the ICollection methods to view the collection.
  10327. * @version Egret 2.4
  10328. * @version eui 1.0
  10329. * @platform Web,Native
  10330. * @language en_US
  10331. */
  10332. /**
  10333. * 数据源
  10334. * 通常情况下请不要直接调用Array的方法操作数据源,否则对应的视图无法收到数据改变的通知。通常都是通过ICollection的接口方法来查看数据。
  10335. * 若对数据源进行了修改,请手动调用refresh()方法刷新数据。
  10336. * @version Egret 2.4
  10337. * @version eui 1.0
  10338. * @platform Web,Native
  10339. * @language zh_CN
  10340. */
  10341. source: any[];
  10342. /**
  10343. * Applies the sort and filter to the view.
  10344. * The ArrayCollection does not detect source data changes automatically,
  10345. * so you must call the <code>refresh()</code>
  10346. * method to update the view after changing the source data.
  10347. * @version Egret 2.4
  10348. * @version eui 1.0
  10349. * @platform Web,Native
  10350. * @language en_US
  10351. */
  10352. /**
  10353. * 在对数据源进行排序或过滤操作后可以手动调用此方法刷新所有数据,以更新视图。
  10354. * ArrayCollection 不会自动检原始数据进行了改变,所以你必须调用<code>refresh()</code>方法去更新显示。
  10355. * @version Egret 2.4
  10356. * @version eui 1.0
  10357. * @platform Web,Native
  10358. * @language zh_CN
  10359. */
  10360. refresh(): void;
  10361. /**
  10362. * @inheritDoc
  10363. *
  10364. * @version Egret 2.4
  10365. * @version eui 1.0
  10366. * @platform Web,Native
  10367. */
  10368. readonly length: number;
  10369. /**
  10370. * Adds the specified item to the end of the list.
  10371. * Equivalent to <code>addItemAt(item, length)</code>.
  10372. * @param item The item to add.
  10373. * @version Egret 2.4
  10374. * @version eui 1.0
  10375. * @platform Web,Native
  10376. * @language en_US
  10377. */
  10378. /**
  10379. * 向列表末尾添加指定项目。等效于 <code>addItemAt(item, length)</code>。
  10380. * @param item 要被添加的项。
  10381. * @version Egret 2.4
  10382. * @version eui 1.0
  10383. * @platform Web,Native
  10384. * @language zh_CN
  10385. */
  10386. addItem(item: any): void;
  10387. /**
  10388. * Adds the item at the specified index.
  10389. * The index of any item greater than the index of the added item is increased by one.
  10390. * If the the specified index is less than zero or greater than the length
  10391. * of the list, a Error which code is 1007 is thrown.
  10392. * @param item The item to place at the index.
  10393. * @param index The index at which to place the item.
  10394. * @version Egret 2.4
  10395. * @version eui 1.0
  10396. * @platform Web,Native
  10397. * @language en_US
  10398. */
  10399. /**
  10400. * 在指定的索引处添加项目。
  10401. * 任何大于已添加项目的索引的项目索引都会增加 1。
  10402. * 如果指定的索引比0小或者比最大长度要大。则会抛出1007异常。
  10403. * @param item 要添加的项
  10404. * @param index 要添加的指定索引位置
  10405. * @version Egret 2.4
  10406. * @version eui 1.0
  10407. * @platform Web,Native
  10408. * @language zh_CN
  10409. */
  10410. addItemAt(item: any, index: number): void;
  10411. /**
  10412. * @inheritDoc
  10413. *
  10414. * @version Egret 2.4
  10415. * @version eui 1.0
  10416. * @platform Web,Native
  10417. */
  10418. getItemAt(index: number): any;
  10419. /**
  10420. * @inheritDoc
  10421. *
  10422. * @version Egret 2.4
  10423. * @version eui 1.0
  10424. * @platform Web,Native
  10425. */
  10426. getItemIndex(item: any): number;
  10427. /**
  10428. * Notifies the view that an item has been updated.
  10429. * @param item The item within the view that was updated.
  10430. * @version Egret 2.4
  10431. * @version eui 1.0
  10432. * @platform Web,Native
  10433. * @language en_US
  10434. */
  10435. /**
  10436. * 通知视图,某个项目的属性已更新。
  10437. * @param item 视图中需要被更新的项。
  10438. * @version Egret 2.4
  10439. * @version eui 1.0
  10440. * @platform Web,Native
  10441. * @language zh_CN
  10442. */
  10443. itemUpdated(item: any): void;
  10444. /**
  10445. * Removes all items from the list.
  10446. * @version Egret 2.4
  10447. * @version eui 1.0
  10448. * @platform Web,Native
  10449. * @language en_US
  10450. */
  10451. /**
  10452. * 删除列表中的所有项目。
  10453. * @version Egret 2.4
  10454. * @version eui 1.0
  10455. * @platform Web,Native
  10456. * @language zh_CN
  10457. */
  10458. removeAll(): void;
  10459. /**
  10460. * Removes the item at the specified index and returns it.
  10461. * Any items that were after this index are now one index earlier.
  10462. * @param index The index from which to remove the item.
  10463. * @return The item that was removed.
  10464. * @version Egret 2.4
  10465. * @version eui 1.0
  10466. * @platform Web,Native
  10467. * @language en_US
  10468. */
  10469. /**
  10470. * 删除指定索引处的项目并返回该项目。原先位于此索引之后的所有项目的索引现在都向前移动一个位置。
  10471. * @param index 要被移除的项的索引。
  10472. * @return 被移除的项。
  10473. * @version Egret 2.4
  10474. * @version eui 1.0
  10475. * @platform Web,Native
  10476. * @language zh_CN
  10477. */
  10478. removeItemAt(index: number): any;
  10479. /**
  10480. * Replaces the item at the specified index.
  10481. * @param item The new item to be placed at the specified index.
  10482. * @param index The index at which to place the item.
  10483. * @return The item that was replaced, or <code>null</code> if none.
  10484. * @version Egret 2.4
  10485. * @version eui 1.0
  10486. * @platform Web,Native
  10487. * @language en_US
  10488. */
  10489. /**
  10490. * 替换在指定索引处的项目,并返回该项目。
  10491. * @param item 要在指定索引放置的新的项。
  10492. * @param index 要被替换的项的索引位置。
  10493. * @return 被替换的项目,如果没有该项则返回<code>null</code> 。
  10494. * @version Egret 2.4
  10495. * @version eui 1.0
  10496. * @platform Web,Native
  10497. * @language zh_CN
  10498. */
  10499. replaceItemAt(item: any, index: number): any;
  10500. /**
  10501. * Replaces all items with a new source data, this method can not reset the scroller position of view.
  10502. * @param newSource new source data.
  10503. * @version Egret 2.4
  10504. * @version eui 1.0
  10505. * @platform Web,Native
  10506. * @language en_US
  10507. */
  10508. /**
  10509. * 用新数据源替换原始数据源,此方法与直接设置source不同,它不会导致目标视图重置滚动位置。
  10510. * @param newSource 新数据。
  10511. * @version Egret 2.4
  10512. * @version eui 1.0
  10513. * @platform Web,Native
  10514. * @language zh_CN
  10515. */
  10516. replaceAll(newSource: any[]): void;
  10517. /**
  10518. * @private
  10519. * 抛出事件
  10520. */
  10521. private dispatchCoEvent(kind, location?, oldLocation?, items?, oldItems?);
  10522. }
  10523. }
  10524. declare namespace eui.sys {
  10525. /**
  10526. * @private
  10527. */
  10528. const enum EditableTextKeys {
  10529. promptText = 0,
  10530. textColorUser = 1,
  10531. asPassword = 2,
  10532. }
  10533. }
  10534. declare namespace eui {
  10535. /**
  10536. * Editable text for displaying,
  10537. * scrolling, selecting, and editing text.
  10538. * @includeExample extension/eui/components/EditablTextExample.ts
  10539. * @version Egret 2.4
  10540. * @version eui 1.0
  10541. * @platform Web,Native
  10542. * @language en_US
  10543. */
  10544. /**
  10545. * 可编辑文本,用于显示、滚动、选择和编辑文本。
  10546. * @includeExample extension/eui/components/EditablTextExample.ts
  10547. * @version Egret 2.4
  10548. * @version eui 1.0
  10549. * @platform Web,Native
  10550. * @language zh_CN
  10551. */
  10552. class EditableText extends egret.TextField implements UIComponent, IDisplayText {
  10553. /**
  10554. * Constructor.
  10555. * @version Egret 2.4
  10556. * @version eui 1.0
  10557. * @platform Web,Native
  10558. * @language en_US
  10559. */
  10560. /**
  10561. * 构造函数。
  10562. * @version Egret 2.4
  10563. * @version eui 1.0
  10564. * @platform Web,Native
  10565. * @language zh_CN
  10566. */
  10567. constructor();
  10568. $EditableText: Object;
  10569. /**
  10570. * @private
  10571. *
  10572. */
  10573. $invalidateTextField(): void;
  10574. /**
  10575. * @private
  10576. *
  10577. * @param value
  10578. */
  10579. $setWidth(value: number): boolean;
  10580. /**
  10581. * @private
  10582. *
  10583. * @param value
  10584. */
  10585. $setHeight(value: number): boolean;
  10586. /**
  10587. * @private
  10588. *
  10589. * @param value
  10590. */
  10591. $getText(): string;
  10592. /**
  10593. * @private
  10594. *
  10595. * @param value
  10596. */
  10597. $setText(value: string): boolean;
  10598. /**
  10599. * @private
  10600. */
  10601. private _widthConstraint;
  10602. /**
  10603. * @private
  10604. *
  10605. * @param stage
  10606. * @param nestLevel
  10607. */
  10608. $onAddToStage(stage: egret.Stage, nestLevel: number): void;
  10609. /**
  10610. * @private
  10611. *
  10612. */
  10613. $onRemoveFromStage(): void;
  10614. /**
  10615. * @private
  10616. */
  10617. private $isShowPrompt;
  10618. /**
  10619. * When the property of the text is empty, it will show the defalut string.
  10620. * @version Egret 2.5.5
  10621. * @version eui 1.0
  10622. * @platform Web,Native
  10623. * @language en_US
  10624. */
  10625. /**
  10626. * 当text属性为空字符串时要显示的文本内容。
  10627. * 先创建文本控件时将显示提示文本。控件获得焦点时或控件的 text 属性为非空字符串时,提示文本将消失。
  10628. * 控件失去焦点时提示文本将重新显示,但仅当未输入文本时(如果文本字段的值为空字符串)。<p/>
  10629. * 对于文本控件,如果用户输入文本,但随后又将其删除,则控件失去焦点后,提示文本将重新显示。
  10630. * 您还可以通过编程方式将文本控件的 text 属性设置为空字符串使提示文本重新显示。
  10631. * @version Egret 2.5.5
  10632. * @version eui 1.0
  10633. * @platform Web,Native
  10634. * @language zh_CN
  10635. */
  10636. prompt: string;
  10637. /**
  10638. * @private
  10639. */
  10640. private $promptColor;
  10641. /**
  10642. * @private
  10643. */
  10644. private $isFocusIn;
  10645. /**
  10646. * The color of the defalut string.
  10647. * @version Egret 2.5.5
  10648. * @version eui 1.0
  10649. * @platform Web,Native
  10650. * @language en_US
  10651. */
  10652. /**
  10653. * 默认文本的颜色
  10654. * @version Egret 2.5.5
  10655. * @version eui 1.0
  10656. * @platform Web,Native
  10657. * @language zh_CN
  10658. */
  10659. promptColor: number;
  10660. /**
  10661. * @private
  10662. */
  10663. private onfocusOut();
  10664. /**
  10665. * @private
  10666. */
  10667. private onfocusIn();
  10668. /**
  10669. * @private
  10670. */
  10671. private showPromptText();
  10672. /**
  10673. * @private
  10674. */
  10675. $setTextColor(value: number): boolean;
  10676. /**
  10677. * @private
  10678. */
  10679. $setDisplayAsPassword(value: boolean): boolean;
  10680. /**
  10681. * @private
  10682. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  10683. */
  10684. private initializeUIValues;
  10685. /**
  10686. * @copy eui.Component#createChildren()
  10687. *
  10688. * @version Egret 2.4
  10689. * @version eui 1.0
  10690. * @platform Web,Native
  10691. */
  10692. protected createChildren(): void;
  10693. /**
  10694. * @copy eui.Component#childrenCreated()
  10695. *
  10696. * @version Egret 2.4
  10697. * @version eui 1.0
  10698. * @platform Web,Native
  10699. */
  10700. protected childrenCreated(): void;
  10701. /**
  10702. * @copy eui.Component#commitProperties()
  10703. *
  10704. * @version Egret 2.4
  10705. * @version eui 1.0
  10706. * @platform Web,Native
  10707. */
  10708. protected commitProperties(): void;
  10709. /**
  10710. * @copy eui.Component#measure()
  10711. *
  10712. * @version Egret 2.4
  10713. * @version eui 1.0
  10714. * @platform Web,Native
  10715. */
  10716. protected measure(): void;
  10717. /**
  10718. * @copy eui.Component#updateDisplayList()
  10719. *
  10720. * @version Egret 2.4
  10721. * @version eui 1.0
  10722. * @platform Web,Native
  10723. */
  10724. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  10725. /**
  10726. * @copy eui.Component#invalidateParentLayout()
  10727. *
  10728. * @version Egret 2.4
  10729. * @version eui 1.0
  10730. * @platform Web,Native
  10731. */
  10732. protected invalidateParentLayout(): void;
  10733. /**
  10734. * @private
  10735. */
  10736. $UIComponent: Object;
  10737. /**
  10738. * @private
  10739. */
  10740. $includeInLayout: boolean;
  10741. /**
  10742. * @inheritDoc
  10743. *
  10744. * @version Egret 2.4
  10745. * @version eui 1.0
  10746. * @platform Web,Native
  10747. */
  10748. includeInLayout: boolean;
  10749. /**
  10750. * @inheritDoc
  10751. *
  10752. * @version Egret 2.4
  10753. * @version eui 1.0
  10754. * @platform Web,Native
  10755. */
  10756. left: any;
  10757. /**
  10758. * @inheritDoc
  10759. *
  10760. * @version Egret 2.4
  10761. * @version eui 1.0
  10762. * @platform Web,Native
  10763. */
  10764. right: any;
  10765. /**
  10766. * @inheritDoc
  10767. *
  10768. * @version Egret 2.4
  10769. * @version eui 1.0
  10770. * @platform Web,Native
  10771. */
  10772. top: any;
  10773. /**
  10774. * @inheritDoc
  10775. *
  10776. * @version Egret 2.4
  10777. * @version eui 1.0
  10778. * @platform Web,Native
  10779. */
  10780. bottom: any;
  10781. /**
  10782. * @inheritDoc
  10783. *
  10784. * @version Egret 2.4
  10785. * @version eui 1.0
  10786. * @platform Web,Native
  10787. */
  10788. horizontalCenter: any;
  10789. /**
  10790. * @inheritDoc
  10791. *
  10792. * @version Egret 2.4
  10793. * @version eui 1.0
  10794. * @platform Web,Native
  10795. */
  10796. verticalCenter: any;
  10797. /**
  10798. * @inheritDoc
  10799. *
  10800. * @version Egret 2.4
  10801. * @version eui 1.0
  10802. * @platform Web,Native
  10803. */
  10804. percentWidth: number;
  10805. /**
  10806. * @inheritDoc
  10807. *
  10808. * @version Egret 2.4
  10809. * @version eui 1.0
  10810. * @platform Web,Native
  10811. */
  10812. percentHeight: number;
  10813. /**
  10814. * @inheritDoc
  10815. *
  10816. * @version Egret 2.4
  10817. * @version eui 1.0
  10818. * @platform Web,Native
  10819. */
  10820. explicitWidth: number;
  10821. /**
  10822. * @inheritDoc
  10823. *
  10824. * @version Egret 2.4
  10825. * @version eui 1.0
  10826. * @platform Web,Native
  10827. */
  10828. explicitHeight: number;
  10829. /**
  10830. * @inheritDoc
  10831. *
  10832. * @version Egret 2.4
  10833. * @version eui 1.0
  10834. * @platform Web,Native
  10835. */
  10836. minWidth: number;
  10837. /**
  10838. * @inheritDoc
  10839. *
  10840. * @version Egret 2.4
  10841. * @version eui 1.0
  10842. * @platform Web,Native
  10843. */
  10844. maxWidth: number;
  10845. /**
  10846. * @inheritDoc
  10847. *
  10848. * @version Egret 2.4
  10849. * @version eui 1.0
  10850. * @platform Web,Native
  10851. */
  10852. minHeight: number;
  10853. /**
  10854. * @inheritDoc
  10855. *
  10856. * @version Egret 2.4
  10857. * @version eui 1.0
  10858. * @platform Web,Native
  10859. */
  10860. maxHeight: number;
  10861. /**
  10862. * @inheritDoc
  10863. *
  10864. * @version Egret 2.4
  10865. * @version eui 1.0
  10866. * @platform Web,Native
  10867. */
  10868. setMeasuredSize(width: number, height: number): void;
  10869. /**
  10870. * @inheritDoc
  10871. *
  10872. * @version Egret 2.4
  10873. * @version eui 1.0
  10874. * @platform Web,Native
  10875. */
  10876. invalidateProperties(): void;
  10877. /**
  10878. * @inheritDoc
  10879. *
  10880. * @version Egret 2.4
  10881. * @version eui 1.0
  10882. * @platform Web,Native
  10883. */
  10884. validateProperties(): void;
  10885. /**
  10886. * @inheritDoc
  10887. *
  10888. * @version Egret 2.4
  10889. * @version eui 1.0
  10890. * @platform Web,Native
  10891. */
  10892. invalidateSize(): void;
  10893. /**
  10894. * @inheritDoc
  10895. *
  10896. * @version Egret 2.4
  10897. * @version eui 1.0
  10898. * @platform Web,Native
  10899. */
  10900. validateSize(recursive?: boolean): void;
  10901. /**
  10902. * @inheritDoc
  10903. *
  10904. * @version Egret 2.4
  10905. * @version eui 1.0
  10906. * @platform Web,Native
  10907. */
  10908. invalidateDisplayList(): void;
  10909. /**
  10910. * @inheritDoc
  10911. *
  10912. * @version Egret 2.4
  10913. * @version eui 1.0
  10914. * @platform Web,Native
  10915. */
  10916. validateDisplayList(): void;
  10917. /**
  10918. * @inheritDoc
  10919. *
  10920. * @version Egret 2.4
  10921. * @version eui 1.0
  10922. * @platform Web,Native
  10923. */
  10924. validateNow(): void;
  10925. /**
  10926. * @inheritDoc
  10927. *
  10928. * @version Egret 2.4
  10929. * @version eui 1.0
  10930. * @platform Web,Native
  10931. */
  10932. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  10933. /**
  10934. * @inheritDoc
  10935. *
  10936. * @version Egret 2.4
  10937. * @version eui 1.0
  10938. * @platform Web,Native
  10939. */
  10940. setLayoutBoundsPosition(x: number, y: number): void;
  10941. /**
  10942. * @inheritDoc
  10943. *
  10944. * @version Egret 2.4
  10945. * @version eui 1.0
  10946. * @platform Web,Native
  10947. */
  10948. getLayoutBounds(bounds: egret.Rectangle): void;
  10949. /**
  10950. * @inheritDoc
  10951. *
  10952. * @version Egret 2.4
  10953. * @version eui 1.0
  10954. * @platform Web,Native
  10955. */
  10956. getPreferredBounds(bounds: egret.Rectangle): void;
  10957. }
  10958. }
  10959. declare namespace eui.sys {
  10960. /**
  10961. * @private
  10962. * 一个工具类,用于容器的滚屏拖动操作,计算在一段时间持续滚动后释放,应该继续滚动到的值和缓动时间。
  10963. * 使用此工具类,您需要创建一个 ScrollThrown 实例,并在滚动发生时调用start()方法,然后在触摸移动过程中调用update()更新当前舞台坐标。
  10964. * 内部将会启动一个计时器定时根据当前位置计算出速度值,并缓存下来最后4个值。当停止滚动时,再调用finish()方法,
  10965. * 将立即停止记录位移,并将计算出的最终结果存储到 Thrown.scrollTo 和 Thrown.duration 属性上。
  10966. */
  10967. class TouchScroll {
  10968. /**
  10969. * @private
  10970. * 创建一个 TouchScroll 实例
  10971. * @param updateFunction 滚动位置更新回调函数
  10972. */
  10973. constructor(updateFunction: (scrollPos: number) => void, endFunction: () => void, target: egret.IEventDispatcher);
  10974. /**
  10975. * @private
  10976. * 当前容器滚动外界可调节的系列
  10977. */
  10978. $scrollFactor: number;
  10979. /**
  10980. * @private
  10981. */
  10982. private target;
  10983. /**
  10984. * @private
  10985. */
  10986. private updateFunction;
  10987. /**
  10988. * @private
  10989. */
  10990. private endFunction;
  10991. /**
  10992. * @private
  10993. */
  10994. private previousTime;
  10995. /**
  10996. * @private
  10997. */
  10998. private velocity;
  10999. /**
  11000. * @private
  11001. */
  11002. private previousVelocity;
  11003. /**
  11004. * @private
  11005. */
  11006. private currentPosition;
  11007. /**
  11008. * @private
  11009. */
  11010. private previousPosition;
  11011. /**
  11012. * @private
  11013. */
  11014. private currentScrollPos;
  11015. /**
  11016. * @private
  11017. */
  11018. private maxScrollPos;
  11019. /**
  11020. * @private
  11021. * 触摸按下时的偏移量
  11022. */
  11023. private offsetPoint;
  11024. /**
  11025. * @private
  11026. * 停止触摸时继续滚动的动画实例
  11027. */
  11028. private animation;
  11029. $bounces: boolean;
  11030. /**
  11031. * @private
  11032. * 正在播放缓动动画的标志。
  11033. */
  11034. isPlaying(): boolean;
  11035. /**
  11036. * @private
  11037. * 如果正在执行缓动滚屏,停止缓动。
  11038. */
  11039. stop(): void;
  11040. private started;
  11041. /**
  11042. * @private
  11043. * true表示已经调用过start方法。
  11044. */
  11045. isStarted(): boolean;
  11046. /**
  11047. * @private
  11048. * 开始记录位移变化。注意:当使用完毕后,必须调用 finish() 方法结束记录,否则该对象将无法被回收。
  11049. * @param touchPoint 起始触摸位置,以像素为单位,通常是stageX或stageY。
  11050. */
  11051. start(touchPoint: number): void;
  11052. /**
  11053. * @private
  11054. * 更新当前移动到的位置
  11055. * @param touchPoint 当前触摸位置,以像素为单位,通常是stageX或stageY。
  11056. */
  11057. update(touchPoint: number, maxScrollValue: number, scrollValue: any): void;
  11058. /**
  11059. * @private
  11060. * 停止记录位移变化,并计算出目标值和继续缓动的时间。
  11061. * @param currentScrollPos 容器当前的滚动值。
  11062. * @param maxScrollPos 容器可以滚动的最大值。当目标值不在 0~maxValue之间时,将会应用更大的摩擦力,从而影响缓动时间的长度。
  11063. */
  11064. finish(currentScrollPos: number, maxScrollPos: number): void;
  11065. /**
  11066. * @private
  11067. *
  11068. * @param timeStamp
  11069. * @returns
  11070. */
  11071. private onTick(timeStamp);
  11072. /**
  11073. * @private
  11074. *
  11075. * @param animation
  11076. */
  11077. private finishScrolling(animation?);
  11078. /**
  11079. * @private
  11080. * 缓动到水平滚动位置
  11081. */
  11082. private throwTo(hspTo, duration?);
  11083. /**
  11084. * @private
  11085. * 更新水平滚动位置
  11086. */
  11087. private onScrollingUpdate(animation);
  11088. }
  11089. }
  11090. declare namespace eui {
  11091. /**
  11092. * Defines values for setting the <code>direction</code> property
  11093. * of the <code>ProgressBar</code> class.
  11094. * @version Egret 2.4
  11095. * @version eui 1.0
  11096. * @platform Web,Native
  11097. * @includeExample extension/eui/core/DirectionExample.ts
  11098. * @language en_US
  11099. */
  11100. /**
  11101. * 定义进度条等控件增长方向的常量
  11102. * @version Egret 2.4
  11103. * @version eui 1.0
  11104. * @platform Web,Native
  11105. * @includeExample extension/eui/core/DirectionExample.ts
  11106. * @language zh_CN
  11107. */
  11108. class Direction {
  11109. /**
  11110. * Specifies left-to-right direction.
  11111. * @version Egret 2.4
  11112. * @version eui 1.0
  11113. * @platform Web,Native
  11114. * @language en_US
  11115. */
  11116. /**
  11117. * 水平从左到右增长
  11118. * @version Egret 2.4
  11119. * @version eui 1.0
  11120. * @platform Web,Native
  11121. * @language zh_CN
  11122. */
  11123. static LTR: string;
  11124. /**
  11125. * Specifies right-to-left direction.
  11126. * @version Egret 2.4
  11127. * @version eui 1.0
  11128. * @platform Web,Native
  11129. * @language en_US
  11130. */
  11131. /**
  11132. * 水平从右到左增长
  11133. * @version Egret 2.4
  11134. * @version eui 1.0
  11135. * @platform Web,Native
  11136. * @language zh_CN
  11137. */
  11138. static RTL: string;
  11139. /**
  11140. * Specifies top-to-bottom direction.
  11141. * @version Egret 2.4
  11142. * @version eui 1.0
  11143. * @platform Web,Native
  11144. * @language en_US
  11145. */
  11146. /**
  11147. * 竖直从上到下增长
  11148. * @version Egret 2.4
  11149. * @version eui 1.0
  11150. * @platform Web,Native
  11151. * @language zh_CN
  11152. */
  11153. static TTB: string;
  11154. /**
  11155. * Specifies bottom-to-top direction.
  11156. * @version Egret 2.4
  11157. * @version eui 1.0
  11158. * @platform Web,Native
  11159. * @language en_US
  11160. */
  11161. /**
  11162. * 竖直从下到上增长
  11163. * @version Egret 2.4
  11164. * @version eui 1.0
  11165. * @platform Web,Native
  11166. * @language zh_CN
  11167. */
  11168. static BTT: string;
  11169. }
  11170. }
  11171. declare namespace eui {
  11172. interface IAssetAdapter {
  11173. getAsset(source: string, callBack: (content: any, source: string) => void, thisObject: any): void;
  11174. }
  11175. }
  11176. declare namespace eui {
  11177. /**
  11178. * The IDisplayText interface defines the properties
  11179. * for simple text display.。
  11180. * @version Egret 2.4
  11181. * @version eui 1.0
  11182. * @platform Web,Native
  11183. * @language en_US
  11184. */
  11185. /**
  11186. * IDisplayText 接口定义简单文本显示的属性.
  11187. * @version Egret 2.4
  11188. * @version eui 1.0
  11189. * @platform Web,Native
  11190. * @language zh_CN
  11191. */
  11192. interface IDisplayText {
  11193. /**
  11194. * The text displayed by this text component.
  11195. * @readOnly
  11196. * @version Egret 2.4
  11197. * @version eui 1.0
  11198. * @platform Web,Native
  11199. * @language en_US
  11200. */
  11201. /**
  11202. * 此文本组件所显示的文本。
  11203. * @readOnly
  11204. * @version Egret 2.4
  11205. * @version eui 1.0
  11206. * @platform Web,Native
  11207. * @language zh_CN
  11208. */
  11209. text: string;
  11210. }
  11211. }
  11212. declare namespace eui {
  11213. /**
  11214. * The IItemRenderer interface defines the basic set of APIs
  11215. * that used for List class.
  11216. * @version Egret 2.4
  11217. * @version eui 1.0
  11218. * @platform Web,Native
  11219. * @language en_US
  11220. */
  11221. /**
  11222. * 列表类组件的项呈示器接口。
  11223. * @version Egret 2.4
  11224. * @version eui 1.0
  11225. * @platform Web,Native
  11226. * @language zh_CN
  11227. */
  11228. interface IItemRenderer extends UIComponent {
  11229. /**
  11230. * The data to render or edit.
  11231. * @version Egret 2.4
  11232. * @version eui 1.0
  11233. * @platform Web,Native
  11234. * @language en_US
  11235. */
  11236. /**
  11237. * 要呈示或编辑的数据。
  11238. * @version Egret 2.4
  11239. * @version eui 1.0
  11240. * @platform Web,Native
  11241. * @language zh_CN
  11242. */
  11243. data: any;
  11244. /**
  11245. * Contains <code>true</code> if the item renderer
  11246. * can show itself as selected.
  11247. * @version Egret 2.4
  11248. * @version eui 1.0
  11249. * @platform Web,Native
  11250. * @language en_US
  11251. */
  11252. /**
  11253. * 如果项呈示器可以将其自身显示为已选中,则为 true。
  11254. * @version Egret 2.4
  11255. * @version eui 1.0
  11256. * @platform Web,Native
  11257. * @language zh_CN
  11258. */
  11259. selected: boolean;
  11260. /**
  11261. * The index of the item in the data provider
  11262. * of the host component of the item renderer.
  11263. * @version Egret 2.4
  11264. * @version eui 1.0
  11265. * @platform Web,Native
  11266. * @language en_US
  11267. */
  11268. /**
  11269. * 项呈示器的数据提供程序中的项目索引。
  11270. * @version Egret 2.4
  11271. * @version eui 1.0
  11272. * @platform Web,Native
  11273. * @language zh_CN
  11274. */
  11275. itemIndex: number;
  11276. }
  11277. }
  11278. declare namespace eui {
  11279. interface IThemeAdapter {
  11280. getTheme(url: string, compFunc: Function, errorFunc: Function, thisObject: any): void;
  11281. }
  11282. }
  11283. declare namespace eui {
  11284. /**
  11285. * The IViewport interface is implemented by components that support a viewport.
  11286. *
  11287. * If a component's children are larger than the component,
  11288. * and you want to clip the children to the component boundaries, you can define a viewport.
  11289. *
  11290. * A viewport is a rectangular subset of the area of a component that you want to display,
  11291. * rather than displaying the entire component.
  11292. *
  11293. * @see eui.Scroller
  11294. *
  11295. * @version Egret 2.4
  11296. * @version eui 1.0
  11297. * @platform Web,Native
  11298. * @language en_US
  11299. */
  11300. /**
  11301. * 支持视区的组件接口。
  11302. *
  11303. * 如果组件的内容子项比组件要大,而且您向往子项可以在父级组件的边缘处被裁减,您可以定义一个视区。
  11304. *
  11305. * 视区是您希望显示的组件的区域的矩形子集,而不是显示整个组件。
  11306. *
  11307. * @see eui.Scroller
  11308. *
  11309. * @version Egret 2.4
  11310. * @version eui 1.0
  11311. * @platform Web,Native
  11312. * @language zh_CN
  11313. */
  11314. interface IViewport extends UIComponent {
  11315. /**
  11316. * The width of the viewport's contents.
  11317. *
  11318. * If <code>scrollEnabled</code> is true, the viewport's
  11319. * <code>contentWidth</code> defines the limit for horizontal scrolling
  11320. * and the viewport's actual width defines how much of the content is visible.
  11321. *
  11322. * To scroll through the content horizontally, vary the
  11323. * <code>scrollH</code> between 0 and
  11324. * <code>contentWidth - width</code>.
  11325. *
  11326. * @readOnly
  11327. * @version Egret 2.4
  11328. * @version eui 1.0
  11329. * @platform Web,Native
  11330. * @language en_US
  11331. */
  11332. /**
  11333. * 视域的内容的宽度。
  11334. *
  11335. * 如果 <code>scrollEnabled</code> 为 true, 则视域的 <code>contentWidth</code> 为水平滚动定义限制,
  11336. * 且视域的实际宽度定义可见的内容量。
  11337. *
  11338. * 要在内容中水平滚动, 请在 0 和 contentWidth - width 之间更改 <code>scrollH</code> 。
  11339. *
  11340. * @readOnly
  11341. * @version Egret 2.4
  11342. * @version eui 1.0
  11343. * @platform Web,Native
  11344. * @language zh_CN
  11345. */
  11346. contentWidth: number;
  11347. /**
  11348. * The height of the viewport's content.
  11349. *
  11350. * If <code>scrollEnabled</code> is true, the viewport's
  11351. * <code>contentHeight</code> defines the limit for vertical scrolling
  11352. * and the viewport's actual height defines how much of the content is visible.
  11353. *
  11354. * To scroll through the content vertically, vary the
  11355. * <code>scrollV</code> between 0 and
  11356. * <code>contentHeight - height</code>.
  11357. *
  11358. * @readOnly
  11359. * @version Egret 2.4
  11360. * @version eui 1.0
  11361. * @platform Web,Native
  11362. * @language en_US
  11363. */
  11364. /**
  11365. * 视域的内容的高度。
  11366. *
  11367. * 如果 <code>scrollEnabled</code> 为 true,则视域的 <code>contentHeight</code> 为垂直滚动定义限制,
  11368. * 且视域的实际高度定义可见的内容量。要在内容中垂直滚动,请在 0 和 contentHeight - height
  11369. * 之间更改 <code>scrollV</code>。
  11370. *
  11371. * @readOnly
  11372. * @version Egret 2.4
  11373. * @version eui 1.0
  11374. * @platform Web,Native
  11375. * @language zh_CN
  11376. */
  11377. contentHeight: number;
  11378. /**
  11379. * The x coordinate of the origin of the viewport in the component's coordinate system,
  11380. * where the default value is (0,0) corresponding to the upper-left corner of the component.
  11381. * @version Egret 2.4
  11382. * @version eui 1.0
  11383. * @platform Web,Native
  11384. * @language en_US
  11385. */
  11386. /**
  11387. * 可视区域水平方向起始点。
  11388. * @version Egret 2.4
  11389. * @version eui 1.0
  11390. * @platform Web,Native
  11391. * @language zh_CN
  11392. */
  11393. scrollH: number;
  11394. /**
  11395. * The y coordinate of the origin of the viewport in the component's coordinate system,
  11396. * where the default value is (0,0) corresponding to the upper-left corner of the component.
  11397. * @version Egret 2.4
  11398. * @version eui 1.0
  11399. * @platform Web,Native
  11400. * @language en_US
  11401. */
  11402. /**
  11403. * 可视区域竖直方向起始点。
  11404. * @version Egret 2.4
  11405. * @version eui 1.0
  11406. * @platform Web,Native
  11407. * @language zh_CN
  11408. */
  11409. scrollV: number;
  11410. /**
  11411. * If <code>true</code>, specifies to clip the children to the boundaries of the viewport.
  11412. * If <code>false</code>, the container children extend past the container boundaries,
  11413. * regardless of the size specification of the component.
  11414. *
  11415. * @default false
  11416. * @version Egret 2.4
  11417. * @version eui 1.0
  11418. * @platform Web,Native
  11419. * @language en_US
  11420. */
  11421. /**
  11422. * 是否启用容器滚动。如果为 true,则将子项剪切到视区的边界,配合设置scrollH和scrollV属性将能滚动视区。
  11423. * 如果为 false,则容器子代会从容器边界扩展过去,而设置scrollH和scrollV也无效。默认false。
  11424. *
  11425. * @default false
  11426. * @version Egret 2.4
  11427. * @version eui 1.0
  11428. * @platform Web,Native
  11429. * @language zh_CN
  11430. */
  11431. scrollEnabled: boolean;
  11432. }
  11433. }
  11434. declare namespace eui {
  11435. /**
  11436. * Values for the <code>horizontalCanScroll</code> and
  11437. * <code>verticalCanScroll</code> properties of the Scroller classes.
  11438. *
  11439. * @version Egret 2.4
  11440. * @version eui 1.0
  11441. * @platform Web,Native
  11442. * @includeExample extension/eui/core/ScrollPolicyExample.ts
  11443. * @language en_US
  11444. */
  11445. /**
  11446. * 滚动条显示策略常量。
  11447. * Scroller 类的 <code>horizontalCanScroll</code> 和 <code>verticalCanScroll</code> 属性的值。
  11448. *
  11449. * @version Egret 2.4
  11450. * @version eui 1.0
  11451. * @platform Web,Native
  11452. * @includeExample extension/eui/core/ScrollPolicyExample.ts
  11453. * @language zh_CN
  11454. */
  11455. class ScrollPolicy {
  11456. /**
  11457. * Show the scrollbar if the children exceed the owner's dimension.
  11458. * @version Egret 2.4
  11459. * @version eui 1.0
  11460. * @platform Web,Native
  11461. * @language en_US
  11462. */
  11463. /**
  11464. * 如果子项超出父级的尺寸,则允许滚动,反之不允许滚动。
  11465. * @version Egret 2.4
  11466. * @version eui 1.0
  11467. * @platform Web,Native
  11468. * @language zh_CN
  11469. */
  11470. static AUTO: string;
  11471. /**
  11472. * Never show the scrollbar.
  11473. * @version Egret 2.4
  11474. * @version eui 1.0
  11475. * @platform Web,Native
  11476. * @language en_US
  11477. */
  11478. /**
  11479. * 从不允许滚动。
  11480. * @version Egret 2.4
  11481. * @version eui 1.0
  11482. * @platform Web,Native
  11483. * @language zh_CN
  11484. */
  11485. static OFF: string;
  11486. /**
  11487. * Always show the scrollbar.
  11488. * @version Egret 2.4
  11489. * @version eui 1.0
  11490. * @platform Web,Native
  11491. * @language en_US
  11492. */
  11493. /**
  11494. * 总是允许滚动。
  11495. * @version Egret 2.4
  11496. * @version eui 1.0
  11497. * @platform Web,Native
  11498. * @language zh_CN
  11499. */
  11500. static ON: string;
  11501. }
  11502. }
  11503. declare namespace eui {
  11504. /**
  11505. * Note: The skin name values in the skin theme are used as default values,which can not be changed while running.
  11506. * You can change the skin of a component with the skinName property.
  11507. * @event egret.Event.COMPLETE Dispatch when EXML used in this theme is loaded and parsed.
  11508. * @version Egret 2.4
  11509. * @version eui 1.0
  11510. * @platform Web,Native
  11511. * @includeExample extension/eui/core/ThemeExample.ts
  11512. * @language en_US
  11513. */
  11514. /**
  11515. * 皮肤主题。注意:皮肤主题是一次性设置的默认值,并不能运行时切换所有组件默认皮肤。切换单个皮肤您可以自行对Component.skinName赋值来修改。
  11516. * @event egret.Event.COMPLETE 当主题关联的EXML加载解析完成时派发
  11517. * @version Egret 2.4
  11518. * @version eui 1.0
  11519. * @platform Web,Native
  11520. * @includeExample extension/eui/core/ThemeExample.ts
  11521. * @language zh_CN
  11522. */
  11523. class Theme extends egret.EventDispatcher {
  11524. private $configURL;
  11525. /**
  11526. * Create an instance of Theme
  11527. * @param configURL the external theme path. if null, you need to register the default skin name with
  11528. * mapSkin() manually.
  11529. * @param stage current stage.
  11530. * If null, you need to register with egret.registerImplementation("eui.Theme",theme)
  11531. * manually.
  11532. * @version Egret 2.4
  11533. * @version eui 1.0
  11534. * @platform Web,Native
  11535. * @language en_US
  11536. */
  11537. /**
  11538. * 创建一个主题实例
  11539. * @param configURL 要加载并解析的外部主题配置文件路径。若传入 null,将不进行配置文件加载,
  11540. * 之后需要在外部以代码方式手动调用 mapSkin() 方法完成每条默认皮肤名的注册。
  11541. * @param stage 当前舞台引用。
  11542. * 若传入null,需要在外部手动调用 egret.registerImplementation("eui.Theme",theme) 来完成主题的注册。
  11543. * @version Egret 2.4
  11544. * @version eui 1.0
  11545. * @platform Web,Native
  11546. * @language zh_CN
  11547. */
  11548. constructor(configURL: string, stage?: egret.Stage);
  11549. /**
  11550. * @private
  11551. */
  11552. private initialized;
  11553. /**
  11554. * @private
  11555. *
  11556. * @param url
  11557. */
  11558. private load(url);
  11559. /**
  11560. * @private
  11561. *
  11562. * @param str
  11563. */
  11564. private onConfigLoaded(str);
  11565. private onLoaded(classes?, urls?);
  11566. /**
  11567. * @private
  11568. */
  11569. private delayList;
  11570. /**
  11571. * @private
  11572. *
  11573. */
  11574. private handleDelayList();
  11575. /**
  11576. * @private
  11577. */
  11578. private skinMap;
  11579. /**
  11580. * According to the host component to get the default skin name.
  11581. * Search rules are as follows:
  11582. * <li>1. Use the <code>hostComponentKey</code> of client to search.</li>
  11583. * <li>2. Use the class name of client to search.</li>
  11584. * <li>3. Use the parent class name of client to search.</li>
  11585. * <li>4. Repeat step 3 until find the skin name or the parent is <code>eui.Component</code>.</li>
  11586. * @param client the component need to get the default skin.
  11587. * @version Egret 2.4
  11588. * @version eui 1.0
  11589. * @platform Web,Native
  11590. * @language en_US
  11591. */
  11592. /**
  11593. * 根据主机组件,获取对应的默认皮肤名。查询规则如下:
  11594. * <li>1.使用client的hostComponentKey作为键查询默认皮肤名。</li>
  11595. * <li>2.使用client的类名作为键查询默认皮肤名。</li>
  11596. * <li>3.使用client的父类名作为键查询默认皮肤名。</li>
  11597. * <li>4.不断重复3直到查询到皮肤名或父类为eui.Component时停止。</li>
  11598. * @param client 要获取默认皮肤的组件。
  11599. * @version Egret 2.4
  11600. * @version eui 1.0
  11601. * @platform Web,Native
  11602. * @language zh_CN
  11603. */
  11604. getSkinName(client: Component): string;
  11605. /**
  11606. * @private
  11607. */
  11608. private findSkinName(prototype);
  11609. /**
  11610. * Map a default skin for the specified host component.
  11611. * @param hostComponentKey the name of host component, such as "eui.Button".
  11612. * @param skinName the name of skin, such as "app.MyButtonSkin".
  11613. * @version Egret 2.4
  11614. * @version eui 1.0
  11615. * @platform Web,Native
  11616. * @language en_US
  11617. */
  11618. /**
  11619. * 为指定的主机组件映射一个默认皮肤。
  11620. * @param hostComponentKey 主机组件名称,例如:“eui.Button”。
  11621. * @param skinName 皮肤名称 例如:"app.MyButtonSkin"。
  11622. * @version Egret 2.4
  11623. * @version eui 1.0
  11624. * @platform Web,Native
  11625. * @language zh_CN
  11626. */
  11627. mapSkin(hostComponentKey: string, skinName: string): void;
  11628. /**
  11629. * @private
  11630. * styles 配置信息
  11631. */
  11632. private $styles;
  11633. $getStyleConfig(style: string): any;
  11634. }
  11635. }
  11636. declare namespace eui {
  11637. /**
  11638. * The eui.CollectionEvent class represents an event that is
  11639. * dispatched when the associated collection changes.
  11640. * @version Egret 2.4
  11641. * @version eui 1.0
  11642. * @platform Web,Native
  11643. * @includeExample extension/eui/events/CollectionEventExample.ts
  11644. * @language en_US
  11645. */
  11646. /**
  11647. * 集合类型数据改变事件
  11648. * @version Egret 2.4
  11649. * @version eui 1.0
  11650. * @platform Web,Native
  11651. * @includeExample extension/eui/events/CollectionEventExample.ts
  11652. * @language zh_CN
  11653. */
  11654. class CollectionEvent extends egret.Event {
  11655. /**
  11656. * Dispatched when a collection has changed.
  11657. * @version Egret 2.4
  11658. * @version eui 1.0
  11659. * @platform Web,Native
  11660. * @language en_US
  11661. */
  11662. /**
  11663. * 集合类数据发生改变
  11664. * @version Egret 2.4
  11665. * @version eui 1.0
  11666. * @platform Web,Native
  11667. * @language zh_CN
  11668. */
  11669. static COLLECTION_CHANGE: string;
  11670. /**
  11671. * Constructor.
  11672. *
  11673. * @param type The event type; indicates the action that triggered the event.
  11674. * @param bubbles Specifies whether the event can bubble
  11675. * up the display list hierarchy.
  11676. * @param cancelable Specifies whether the behavior
  11677. * associated with the event can be prevented.
  11678. * @param kind Indicates the kind of event that occured.
  11679. * The parameter value can be one of the values in the CollectionEventKind
  11680. * class, or <code>null</code>, which indicates that the kind is unknown.
  11681. * @param location When the <code>kind</code> is
  11682. * <code>CollectionEventKind.ADD</code>,
  11683. * <code>CollectionEventKind.REMOVE</code>,
  11684. * <code>CollectionEventKind.REPLACE</code>,or
  11685. * <code>CollectionEventKind.UPDATE</code>
  11686. * this value indicates at what location the item(s) specified
  11687. * in the <code>items property</code> can be found
  11688. * within the target collection.
  11689. * @param oldLocation this value indicates
  11690. * the old location within the target collection
  11691. * of the item(s) specified in the <code>items</code> property.
  11692. * @param items Array of objects with information about the items
  11693. * affected by the event.
  11694. * @param oldItems When the <code>kine</code> is <code>CollectionEventKind.REPLACE</code> the value represents
  11695. * a list of items before replaced.
  11696. *
  11697. * @version Egret 2.4
  11698. * @version eui 1.0
  11699. * @platform Web,Native
  11700. * @language en_US
  11701. */
  11702. /**
  11703. * 创建一个 CollectionEvent 实例
  11704. *
  11705. * @param type 事件类型;指示触发事件的动作。
  11706. * @param bubbles 指定该事件是否可以在显示列表层次结构得到冒泡处理。
  11707. * @param cancelable 指定是否可以防止与事件相关联的行为。
  11708. * @param kind 指示发生的事件类型。此属性值可以是 CollectionEventKind 类中的一个值,也可以是 null,用于指示类型未知。
  11709. * @param location 如果 kind 值为 <code>CollectionEventKind.ADD</code>,
  11710. * <code>CollectionEventKind.REMOVE</code>,
  11711. * <code>CollectionEventKind.REPLACE</code>,或
  11712. * <code>CollectionEventKind.UPDATE</code>
  11713. * 则此属性为 items 属性中指定的项目集合中零号元素的的索引。
  11714. * @param oldLocation 此值指示 <code>items</code> 属性中指定的项目在目标集合中的原位置。
  11715. * @param items 受事件影响的项目的列表。
  11716. * @param oldItems 仅当kind的值为CollectionEventKind.REPLACE时,表示替换前的项目列表。
  11717. *
  11718. * @version Egret 2.4
  11719. * @version eui 1.0
  11720. * @platform Web,Native
  11721. * @language zh_CN
  11722. */
  11723. constructor(type: string, bubbles?: boolean, cancelable?: boolean, kind?: string, location?: number, oldLocation?: number, items?: any[], oldItems?: any[]);
  11724. /**
  11725. * @private
  11726. *
  11727. * @param kind
  11728. * @param location
  11729. * @param oldLocation
  11730. * @param items
  11731. * @param oldItems
  11732. */
  11733. $initTo(kind?: string, location?: number, oldLocation?: number, items?: any[], oldItems?: any[]): void;
  11734. /**
  11735. * Indicates the kind of event that occured.
  11736. * The parameter value can be one of the values in the CollectionEventKind
  11737. * class, or <code>null</code>, which indicates that the kind is unknown.
  11738. * @version Egret 2.4
  11739. * @version eui 1.0
  11740. * @platform Web,Native
  11741. * @language en_US
  11742. */
  11743. /**
  11744. * 指示发生的事件类型。此属性值可以是 CollectionEventKind 类中的一个值,也可以是 null,用于指示类型未知。
  11745. * @version Egret 2.4
  11746. * @version eui 1.0
  11747. * @platform Web,Native
  11748. * @language zh_CN
  11749. */
  11750. kind: string;
  11751. /**
  11752. * Array of objects with information about the items.
  11753. * affected by the event.
  11754. * @version Egret 2.4
  11755. * @version eui 1.0
  11756. * @platform Web,Native
  11757. * @language en_US
  11758. */
  11759. /**
  11760. * 受事件影响的项目的列表。
  11761. * @version Egret 2.4
  11762. * @version eui 1.0
  11763. * @platform Web,Native
  11764. * @language zh_CN
  11765. */
  11766. items: any[];
  11767. /**
  11768. * When the <code>kine</code> is <code>CollectionEventKind.REPLACE</code> the value represents
  11769. * a list of items before replaced.
  11770. * @version Egret 2.4
  11771. * @version eui 1.0
  11772. * @platform Web,Native
  11773. * @language en_US
  11774. */
  11775. /**
  11776. * 仅当kind的值为CollectionEventKind.REPLACE时,表示替换前的项目列表。
  11777. * @version Egret 2.4
  11778. * @version eui 1.0
  11779. * @platform Web,Native
  11780. * @language zh_CN
  11781. */
  11782. oldItems: any[];
  11783. /**
  11784. * When the <code>kind</code> is
  11785. * <code>CollectionEventKind.ADD</code>,
  11786. * <code>CollectionEventKind.REMOVE</code>,
  11787. * <code>CollectionEventKind.REPLACE</code>,or
  11788. * <code>CollectionEventKind.UPDATE</code>
  11789. * this value indicates at what location the item(s) specified
  11790. * in the <code>items property</code> can be found
  11791. * within the target collection.
  11792. * @version Egret 2.4
  11793. * @version eui 1.0
  11794. * @platform Web,Native
  11795. * @language en_US
  11796. */
  11797. /**
  11798. * 如果 kind 值为 CollectionEventKind.ADD、
  11799. * CollectionEventKind.REMOVE 或 CollectionEventKind.REPLACE,
  11800. * CollectionEventKind.UPDATE
  11801. * 则此属性为 items 属性中指定的项目集合中零号元素的的索引。
  11802. * @version Egret 2.4
  11803. * @version eui 1.0
  11804. * @platform Web,Native
  11805. * @language zh_CN
  11806. */
  11807. location: number;
  11808. /**
  11809. * this value indicates
  11810. * the old location within the target collection
  11811. * of the item(s) specified in the <code>items</code> property.
  11812. * @version Egret 2.4
  11813. * @version eui 1.0
  11814. * @platform Web,Native
  11815. * @language en_US
  11816. */
  11817. /**
  11818. * 此属性为 items 属性中指定的项目在目标集合中原来位置的从零开始的索引。
  11819. * @version Egret 2.4
  11820. * @version eui 1.0
  11821. * @platform Web,Native
  11822. * @language zh_CN
  11823. */
  11824. oldLocation: number;
  11825. /**
  11826. * @inheritDoc
  11827. *
  11828. * @version Egret 2.4
  11829. * @version eui 1.0
  11830. * @platform Web,Native
  11831. */
  11832. protected clean(): void;
  11833. /**
  11834. * Dispatch an event with specified EventDispatcher. The dispatched event will be cached in the object pool,
  11835. * for the next cycle of reuse.
  11836. *
  11837. * @param target the target of event dispatcher.
  11838. * @param eventType The event type; indicates the action that triggered the event.
  11839. * @param kind Indicates the kind of event that occured.
  11840. * The parameter value can be one of the values in the CollectionEventKind
  11841. * class, or <code>null</code>, which indicates that the kind is unknown.
  11842. * @param location When the <code>kind</code> is
  11843. * <code>CollectionEventKind.ADD</code>,
  11844. * <code>CollectionEventKind.REMOVE</code>,
  11845. * <code>CollectionEventKind.REPLACE</code>,or
  11846. * <code>CollectionEventKind.UPDATE</code>
  11847. * this value indicates at what location the item(s) specified
  11848. * in the <code>items property</code> can be found
  11849. * within the target collection.
  11850. * @param oldLocation this value indicates
  11851. * the old location within the target collection
  11852. * of the item(s) specified in the <code>items</code> property.
  11853. * @param items Array of objects with information about the items
  11854. * affected by the event.
  11855. * @param oldItems When the <code>kine</code> is <code>CollectionEventKind.REPLACE</code> the value represents
  11856. * a list of items before replaced.
  11857. *
  11858. * @version Egret 2.4
  11859. * @version eui 1.0
  11860. * @platform Web,Native
  11861. * @language en_US
  11862. */
  11863. /**
  11864. * 使用指定的EventDispatcher对象来抛出事件对象。抛出的对象将会缓存在对象池上,供下次循环复用。
  11865. *
  11866. * @param target 事件派发目标。
  11867. * @param eventType 事件类型;指示触发事件的动作。
  11868. * @param kind 指示发生的事件类型。此属性值可以是 CollectionEventKind 类中的一个值,也可以是 null,用于指示类型未知。
  11869. * @param location 如果 kind 值为 <code>CollectionEventKind.ADD</code>,
  11870. * <code>CollectionEventKind.REMOVE</code>,
  11871. * <code>CollectionEventKind.REPLACE</code>,或
  11872. * <code>CollectionEventKind.UPDATE</code>
  11873. * 则此属性为 items 属性中指定的项目集合中零号元素的的索引。
  11874. * @param oldLocation 此值指示 <code>items</code> 属性中指定的项目在目标集合中的原位置。
  11875. * @param items 受事件影响的项目的列表。
  11876. * @param oldItems 仅当kind的值为CollectionEventKind.REPLACE时,表示替换前的项目列表。
  11877. *
  11878. * @version Egret 2.4
  11879. * @version eui 1.0
  11880. * @platform Web,Native
  11881. * @language zh_CN
  11882. */
  11883. static dispatchCollectionEvent(target: egret.IEventDispatcher, eventType: string, kind?: string, location?: number, oldLocation?: number, items?: any[], oldItems?: any[]): boolean;
  11884. }
  11885. }
  11886. declare namespace eui {
  11887. /**
  11888. * The CollectionEventKind class contains constants for the valid values
  11889. * of the <code>CollectionEvent</code> class <code>kind</code> property.
  11890. * These constants indicate the kind of change that was made to the collection.
  11891. *
  11892. * @version Egret 2.4
  11893. * @version eui 1.0
  11894. * @platform Web,Native
  11895. * @language en_US
  11896. */
  11897. /**
  11898. * 定义 <code>CollectionEvent</code> 类 <code>kind</code> 属性的有效值的常量。
  11899. * 这些常量指示对集合进行的更改类型。
  11900. * @version Egret 2.4
  11901. * @version eui 1.0
  11902. * @platform Web,Native
  11903. * @language zh_CN
  11904. */
  11905. class CollectionEventKind {
  11906. /**
  11907. * Indicates that the collection added an item or items.
  11908. * @version Egret 2.4
  11909. * @version eui 1.0
  11910. * @platform Web,Native
  11911. * @language en_US
  11912. */
  11913. /**
  11914. * 指示集合添加了一个或多个项目。
  11915. * @version Egret 2.4
  11916. * @version eui 1.0
  11917. * @platform Web,Native
  11918. * @language zh_CN
  11919. */
  11920. static ADD: string;
  11921. /**
  11922. * Indicates that the collection applied a sort, a filter, or both.
  11923. * This change can potentially be easier to handle than a RESET.
  11924. * @version Egret 2.4
  11925. * @version eui 1.0
  11926. * @platform Web,Native
  11927. * @language en_US
  11928. */
  11929. /**
  11930. * 指示集合应用了排序或/和筛选。
  11931. * @version Egret 2.4
  11932. * @version eui 1.0
  11933. * @platform Web,Native
  11934. * @language zh_CN
  11935. */
  11936. static REFRESH: string;
  11937. /**
  11938. * Indicates that the collection removed an item or items.
  11939. * @version Egret 2.4
  11940. * @version eui 1.0
  11941. * @platform Web,Native
  11942. * @language en_US
  11943. */
  11944. /**
  11945. * 指示集合删除了一个或多个项目。
  11946. * @version Egret 2.4
  11947. * @version eui 1.0
  11948. * @platform Web,Native
  11949. * @language zh_CN
  11950. */
  11951. static REMOVE: string;
  11952. /**
  11953. * Indicates that the item at the position identified by the
  11954. * CollectionEvent <code>location</code> property has been replaced.
  11955. * @version Egret 2.4
  11956. * @version eui 1.0
  11957. * @platform Web,Native
  11958. * @language en_US
  11959. */
  11960. /**
  11961. * 指示已替换由 CollectionEvent.location 属性确定的位置处的项目。
  11962. * @version Egret 2.4
  11963. * @version eui 1.0
  11964. * @platform Web,Native
  11965. * @language zh_CN
  11966. */
  11967. static REPLACE: string;
  11968. /**
  11969. * Indicates that the collection has changed so drastically that
  11970. * a reset is required.
  11971. * @version Egret 2.4
  11972. * @version eui 1.0
  11973. * @platform Web,Native
  11974. * @language en_US
  11975. */
  11976. /**
  11977. * 指示集合已彻底更改,需要进行重置。
  11978. * @version Egret 2.4
  11979. * @version eui 1.0
  11980. * @platform Web,Native
  11981. * @language zh_CN
  11982. */
  11983. static RESET: string;
  11984. /**
  11985. * Indicates that one or more items were updated within the collection.
  11986. * The affected item(s)
  11987. * are stored in the <code>CollectionEvent.items</code> property.
  11988. * @version Egret 2.4
  11989. * @version eui 1.0
  11990. * @platform Web,Native
  11991. * @language en_US
  11992. */
  11993. /**
  11994. * 指示集合中一个或多个项目进行了更新。受影响的项目将存储在 CollectionEvent.items 属性中。
  11995. * @version Egret 2.4
  11996. * @version eui 1.0
  11997. * @platform Web,Native
  11998. * @language zh_CN
  11999. */
  12000. static UPDATE: string;
  12001. }
  12002. }
  12003. declare namespace eui {
  12004. /**
  12005. * Represents events that are dispatched when a item has been touched.
  12006. * @version Egret 2.4
  12007. * @version eui 1.0
  12008. * @platform Web,Native
  12009. * @includeExample extension/eui/events/ItemTapEventExample.ts
  12010. * @language en_US
  12011. */
  12012. /**
  12013. * 列表项触碰事件
  12014. * @version Egret 2.4
  12015. * @version eui 1.0
  12016. * @platform Web,Native
  12017. * @includeExample extension/eui/events/ItemTapEventExample.ts
  12018. * @language zh_CN
  12019. */
  12020. class ItemTapEvent extends egret.Event {
  12021. /**
  12022. * The type of the event object for an <code>itemTap</code> event.
  12023. * @version Egret 2.4
  12024. * @version eui 1.0
  12025. * @platform Web,Native
  12026. * @language en_US
  12027. */
  12028. /**
  12029. * <code>itemTap</code> 事件的对象类型。
  12030. * @version Egret 2.4
  12031. * @version eui 1.0
  12032. * @platform Web,Native
  12033. * @language zh_CN
  12034. */
  12035. static ITEM_TAP: string;
  12036. /**
  12037. * The item in the data provider of the associated item.
  12038. * @version Egret 2.4
  12039. * @version eui 1.0
  12040. * @platform Web,Native
  12041. * @language en_US
  12042. */
  12043. /**
  12044. * 触发触摸事件的项呈示器数据源项。
  12045. * @version Egret 2.4
  12046. * @version eui 1.0
  12047. * @platform Web,Native
  12048. * @language zh_CN
  12049. */
  12050. item: any;
  12051. /**
  12052. * The item renderer in the list of the associated item.
  12053. * @version Egret 2.4
  12054. * @version eui 1.0
  12055. * @platform Web,Native
  12056. * @language en_US
  12057. */
  12058. /**
  12059. * 触发触摸事件的项呈示器。
  12060. * @version Egret 2.4
  12061. * @version eui 1.0
  12062. * @platform Web,Native
  12063. * @language zh_CN
  12064. */
  12065. itemRenderer: IItemRenderer;
  12066. /**
  12067. * The index of the associated navigation item.
  12068. * @version Egret 2.4
  12069. * @version eui 1.0
  12070. * @platform Web,Native
  12071. * @language en_US
  12072. */
  12073. /**
  12074. * 触发触摸事件的项索引
  12075. * @version Egret 2.4
  12076. * @version eui 1.0
  12077. * @platform Web,Native
  12078. * @language zh_CN
  12079. */
  12080. itemIndex: number;
  12081. /**
  12082. * @inheritDoc
  12083. *
  12084. * @version Egret 2.4
  12085. * @version eui 1.0
  12086. * @platform Web,Native
  12087. */
  12088. protected clean(): void;
  12089. /**
  12090. * Dispatch an event with specified EventDispatcher. The dispatched event will be cached in the object pool,
  12091. * for the next cycle of reuse.
  12092. *
  12093. * @param target the target of event dispatcher.
  12094. * @param eventType The event type; indicates the action that triggered the event.
  12095. * @param itemRenderer The item renderer in the list of the associated item.
  12096. *
  12097. * @version Egret 2.4
  12098. * @version eui 1.0
  12099. * @platform Web,Native
  12100. * @language en_US
  12101. */
  12102. /**
  12103. * 使用指定的 EventDispatcher 对象来抛出事件对象。抛出的对象将会缓存在对象池上,供下次循环复用。
  12104. *
  12105. * @param target 事件派发目标
  12106. * @param eventType 事件类型;指示触发事件的动作。
  12107. * @param itemRenderer 触发触摸事件的项呈示器。
  12108. *
  12109. * @version Egret 2.4
  12110. * @version eui 1.0
  12111. * @platform Web,Native
  12112. * @language zh_CN
  12113. */
  12114. static dispatchItemTapEvent(target: egret.IEventDispatcher, eventType: string, itemRenderer?: IItemRenderer): boolean;
  12115. }
  12116. }
  12117. declare namespace eui {
  12118. /**
  12119. * The PropertyChangeEvent class represents the event object
  12120. * passed to the event listener when one of the properties of
  12121. * an object has changed, and provides information about the change.
  12122. *
  12123. * @version Egret 2.4
  12124. * @version eui 1.0
  12125. * @platform Web,Native
  12126. * @includeExample extension/eui/events/PropertyEventExample.ts
  12127. * @language en_US
  12128. */
  12129. /**
  12130. * 对象的一个属性发生更改时传递到事件侦听器的事件。
  12131. *
  12132. * @version Egret 2.4
  12133. * @version eui 1.0
  12134. * @platform Web,Native
  12135. * @includeExample extension/eui/events/PropertyEventExample.ts
  12136. * @language zh_CN
  12137. */
  12138. class PropertyEvent extends egret.Event {
  12139. /**
  12140. * Dispatch when a property changed.
  12141. * @version Egret 2.4
  12142. * @version eui 1.0
  12143. * @platform Web,Native
  12144. * @language en_US
  12145. */
  12146. /**
  12147. * 属性改变。
  12148. * @version Egret 2.4
  12149. * @version eui 1.0
  12150. * @platform Web,Native
  12151. * @language zh_CN
  12152. */
  12153. static PROPERTY_CHANGE: string;
  12154. /**
  12155. * Constructor.
  12156. *
  12157. * @param type The event type; indicates the action that triggered the event.
  12158. * @param bubbles Specifies whether the event can bubble
  12159. * up the display list hierarchy.
  12160. * @param cancelable Specifies whether the behavior
  12161. * associated with the event can be prevented.
  12162. * @param property Name of the property that changed.
  12163. *
  12164. * @version Egret 2.4
  12165. * @version eui 1.0
  12166. * @platform Web,Native
  12167. * @language en_US
  12168. */
  12169. /**
  12170. * 创建一个属性改变事件。
  12171. *
  12172. * @param type 事件类型;指示触发事件的动作。
  12173. * @param bubbles 指定该事件是否可以在显示列表层次结构得到冒泡处理。
  12174. * @param cancelable 指定是否可以防止与事件相关联的行为。
  12175. * @param property 发生改变的属性名称。
  12176. *
  12177. * @version Egret 2.4
  12178. * @version eui 1.0
  12179. * @platform Web,Native
  12180. * @language zh_CN
  12181. */
  12182. constructor(type: string, bubbles?: boolean, cancelable?: boolean, property?: string);
  12183. /**
  12184. * Name of the property that changed.
  12185. * @version Egret 2.4
  12186. * @version eui 1.0
  12187. * @platform Web,Native
  12188. * @language en_US
  12189. */
  12190. /**
  12191. * 发生改变的属性名称。
  12192. * @version Egret 2.4
  12193. * @version eui 1.0
  12194. * @platform Web,Native
  12195. * @language zh_CN
  12196. */
  12197. property: string;
  12198. /**
  12199. * Dispatch an event with specified EventDispatcher. The dispatched event will be cached in the object pool,
  12200. * for the next cycle of reuse.
  12201. *
  12202. * @param target the target of event dispatcher.
  12203. * @param eventType The event type; indicates the action that triggered the event.
  12204. * @param property Name of the property that changed.
  12205. *
  12206. * @version Egret 2.4
  12207. * @version eui 1.0
  12208. * @platform Web,Native
  12209. * @language en_US
  12210. */
  12211. /**
  12212. * 使用指定的 EventDispatcher 对象来抛出事件对象。抛出的对象将会缓存在对象池上,供下次循环复用。
  12213. *
  12214. * @param target 事件派发目标
  12215. * @param eventType 事件类型;指示触发事件的动作。
  12216. * @param property 发生改变的属性名称。
  12217. *
  12218. * @version Egret 2.4
  12219. * @version eui 1.0
  12220. * @platform Web,Native
  12221. * @language zh_CN
  12222. */
  12223. static dispatchPropertyEvent(target: egret.IEventDispatcher, eventType: string, property?: string): boolean;
  12224. }
  12225. }
  12226. declare namespace eui {
  12227. /**
  12228. * @private
  12229. */
  12230. class ScrollerThrowEvent extends egret.Event {
  12231. static THROW: string;
  12232. /**
  12233. * 滚动区域当前滚动位置
  12234. */
  12235. currentPos: number;
  12236. /**
  12237. * 要滚动到的位置
  12238. * 修改当前值会修改要滚动到得位置,但是当 moveFlag 为 false 时修改此值依然不会滚动,若此时依然要调整滚动区域的位置可以自己设置
  12239. */
  12240. toPos: number;
  12241. /**
  12242. * 动画信息,可调节或修改
  12243. */
  12244. constructor(type: string, bubbles?: boolean, cancelable?: boolean, currentPos?: number, toPos?: number);
  12245. }
  12246. }
  12247. declare namespace eui {
  12248. /**
  12249. * The UIEvent class represents the event object passed to
  12250. * the event listener for many UI events.
  12251. * @version Egret 2.4
  12252. * @version eui 1.0
  12253. * @platform Web,Native
  12254. * @includeExample extension/eui/events/UIEventExample.ts
  12255. * @language en_US
  12256. */
  12257. /**
  12258. * UI事件
  12259. * @version Egret 2.4
  12260. * @version eui 1.0
  12261. * @platform Web,Native
  12262. * @includeExample extension/eui/events/UIEventExample.ts
  12263. * @language zh_CN
  12264. */
  12265. class UIEvent extends egret.Event {
  12266. /**
  12267. * Constructor.
  12268. *
  12269. * @param type The event type; indicates the action that triggered the event.
  12270. * @param bubbles Specifies whether the event can bubble
  12271. * up the display list hierarchy.
  12272. * @param cancelable Specifies whether the behavior
  12273. * associated with the event can be prevented.
  12274. *
  12275. * @version Egret 2.4
  12276. * @version eui 1.0
  12277. * @platform Web,Native
  12278. * @language en_US
  12279. */
  12280. /**
  12281. * 创建一个 UIEvent 实例
  12282. *
  12283. * @param type 事件类型;指示触发事件的动作。
  12284. * @param bubbles 指定该事件是否可以在显示列表层次结构得到冒泡处理。
  12285. * @param cancelable 指定是否可以防止与事件相关联的行为。
  12286. *
  12287. * @version Egret 2.4
  12288. * @version eui 1.0
  12289. * @platform Web,Native
  12290. * @language zh_CN
  12291. */
  12292. constructor(type: string, bubbles?: boolean, cancelable?: boolean);
  12293. /**
  12294. * creation complete of component.
  12295. * @version Egret 2.4
  12296. * @version eui 1.0
  12297. * @platform Web,Native
  12298. * @language en_US
  12299. */
  12300. /**
  12301. * 组件创建完成
  12302. * @version Egret 2.4
  12303. * @version eui 1.0
  12304. * @platform Web,Native
  12305. * @language zh_CN
  12306. */
  12307. static CREATION_COMPLETE: string;
  12308. /**
  12309. * the ending of change.
  12310. * @version Egret 2.4
  12311. * @version eui 1.0
  12312. * @platform Web,Native
  12313. * @language en_US
  12314. */
  12315. /**
  12316. * 改变结束
  12317. * @version Egret 2.4
  12318. * @version eui 1.0
  12319. * @platform Web,Native
  12320. * @language zh_CN
  12321. */
  12322. static CHANGE_END: string;
  12323. /**
  12324. * The beginning of change.
  12325. * @version Egret 2.4
  12326. * @version eui 1.0
  12327. * @platform Web,Native
  12328. * @language en_US
  12329. */
  12330. /**
  12331. * 改变开始
  12332. * @version Egret 2.4
  12333. * @version eui 1.0
  12334. * @platform Web,Native
  12335. * @language zh_CN
  12336. */
  12337. static CHANGE_START: string;
  12338. /**
  12339. * Before close the panel.
  12340. * @version Egret 2.4
  12341. * @version eui 1.0
  12342. * @platform Web,Native
  12343. * @language en_US
  12344. */
  12345. /**
  12346. * 即将关闭面板事件
  12347. * @version Egret 2.4
  12348. * @version eui 1.0
  12349. * @platform Web,Native
  12350. * @language zh_CN
  12351. */
  12352. static CLOSING: string;
  12353. /**
  12354. * The coordinates of the UI components changed in it's parent.
  12355. * @version Egret 2.4
  12356. * @version eui 1.0
  12357. * @platform Web,Native
  12358. * @language en_US
  12359. */
  12360. /**
  12361. * UI组件在父级容器中的坐标发生改变事件
  12362. * @version Egret 2.4
  12363. * @version eui 1.0
  12364. * @platform Web,Native
  12365. * @language zh_CN
  12366. */
  12367. static MOVE: string;
  12368. /**
  12369. * Dispatch an event with specified EventDispatcher. The dispatched event will be cached in the object pool,
  12370. * for the next cycle of reuse.
  12371. *
  12372. * @param target the target of event dispatcher.
  12373. * @param eventType The event type; indicates the action that triggered the event.
  12374. * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.
  12375. * @param cancelable Determines whether the Event object can be canceled. The default values is false.
  12376. *
  12377. * @version Egret 2.4
  12378. * @version eui 1.0
  12379. * @platform Web,Native
  12380. * @language en_US
  12381. */
  12382. /**
  12383. * 使用指定的EventDispatcher对象来抛出事件对象。抛出的对象将会缓存在对象池上,供下次循环复用。
  12384. *
  12385. * @param target 事件派发目标。
  12386. * @param eventType 事件类型;指示触发事件的动作。
  12387. * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。
  12388. * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。
  12389. *
  12390. * @version Egret 2.4
  12391. * @version eui 1.0
  12392. * @platform Web,Native
  12393. * @language zh_CN
  12394. */
  12395. static dispatchUIEvent(target: egret.IEventDispatcher, eventType: string, bubbles?: boolean, cancelable?: boolean): boolean;
  12396. }
  12397. }
  12398. declare namespace eui.sys {
  12399. /**
  12400. * @private
  12401. * 代码生成工具基类
  12402. */
  12403. class CodeBase {
  12404. /**
  12405. * @private
  12406. *
  12407. * @returns
  12408. */
  12409. toCode(): string;
  12410. /**
  12411. * @private
  12412. */
  12413. indent: number;
  12414. /**
  12415. * @private
  12416. * 获取缩进字符串
  12417. */
  12418. getIndent(indent?: number): string;
  12419. }
  12420. /**
  12421. * @private
  12422. */
  12423. class EXClass extends CodeBase {
  12424. /**
  12425. * @private
  12426. * 构造函数代码块
  12427. */
  12428. constructCode: EXCodeBlock;
  12429. /**
  12430. * @private
  12431. * 类名,不包括模块名
  12432. */
  12433. className: string;
  12434. /**
  12435. * @private
  12436. * 父类类名,包括完整模块名
  12437. */
  12438. superClass: string;
  12439. /**
  12440. * @private
  12441. * 内部类区块
  12442. */
  12443. private innerClassBlock;
  12444. /**
  12445. * @private
  12446. * 添加一个内部类
  12447. */
  12448. addInnerClass(clazz: EXClass): void;
  12449. /**
  12450. * @private
  12451. * 变量定义区块
  12452. */
  12453. private variableBlock;
  12454. /**
  12455. * @private
  12456. * 添加变量
  12457. */
  12458. addVariable(variableItem: EXVariable): void;
  12459. /**
  12460. * @private
  12461. * 根据变量名获取变量定义
  12462. */
  12463. getVariableByName(name: string): EXVariable;
  12464. /**
  12465. * @private
  12466. * 函数定义区块
  12467. */
  12468. private functionBlock;
  12469. /**
  12470. * @private
  12471. * 添加函数
  12472. */
  12473. addFunction(functionItem: EXFunction): void;
  12474. /**
  12475. * @private
  12476. * 根据函数名返回函数定义块
  12477. */
  12478. getFuncByName(name: string): EXFunction;
  12479. /**
  12480. * @private
  12481. *
  12482. * @returns
  12483. */
  12484. toCode(): string;
  12485. }
  12486. /**
  12487. * @private
  12488. */
  12489. class EXCodeBlock extends CodeBase {
  12490. /**
  12491. * @private
  12492. * 添加变量声明语句
  12493. * @param name 变量名
  12494. * @param value 变量初始值
  12495. */
  12496. addVar(name: string, value?: string): void;
  12497. /**
  12498. * @private
  12499. * 添加赋值语句
  12500. * @param target 要赋值的目标
  12501. * @param value 值
  12502. * @param prop 目标的属性(用“.”访问),不填则是对目标赋值
  12503. */
  12504. addAssignment(target: string, value: string, prop?: string): void;
  12505. /**
  12506. * @private
  12507. * 添加返回值语句
  12508. */
  12509. addReturn(data: string): void;
  12510. /**
  12511. * @private
  12512. * 添加一条空行
  12513. */
  12514. addEmptyLine(): void;
  12515. /**
  12516. * @private
  12517. * 开始添加if语句块,自动调用startBlock();
  12518. */
  12519. startIf(expression: string): void;
  12520. /**
  12521. * @private
  12522. * 开始else语句块,自动调用startBlock();
  12523. */
  12524. startElse(): void;
  12525. /**
  12526. * @private
  12527. * 开始else if语句块,自动调用startBlock();
  12528. */
  12529. startElseIf(expression: string): void;
  12530. /**
  12531. * @private
  12532. * 添加一个左大括号,开始新的语句块
  12533. */
  12534. startBlock(): void;
  12535. /**
  12536. * @private
  12537. * 添加一个右大括号,结束当前的语句块
  12538. */
  12539. endBlock(): void;
  12540. /**
  12541. * @private
  12542. * 添加执行函数语句块
  12543. * @param functionName 要执行的函数名称
  12544. * @param args 函数参数列表
  12545. */
  12546. doFunction(functionName: string, args: string[]): void;
  12547. /**
  12548. * @private
  12549. */
  12550. private lines;
  12551. /**
  12552. * @private
  12553. * 添加一行代码
  12554. */
  12555. addCodeLine(code: string): void;
  12556. /**
  12557. * @private
  12558. * 添加一行代码到指定行
  12559. */
  12560. addCodeLineAt(code: string, index: number): void;
  12561. /**
  12562. * @private
  12563. * 是否存在某行代码内容
  12564. */
  12565. containsCodeLine(code: string): boolean;
  12566. /**
  12567. * @private
  12568. * 在结尾追加另一个代码块的内容
  12569. */
  12570. concat(cb: EXCodeBlock): void;
  12571. /**
  12572. * @private
  12573. *
  12574. * @returns
  12575. */
  12576. toCode(): string;
  12577. }
  12578. /**
  12579. * @private
  12580. */
  12581. class EXFunction extends CodeBase {
  12582. /**
  12583. * @private
  12584. * 代码块
  12585. */
  12586. codeBlock: EXCodeBlock;
  12587. /**
  12588. * @private
  12589. */
  12590. isGet: boolean;
  12591. /**
  12592. * @private
  12593. * 函数名
  12594. */
  12595. name: string;
  12596. /**
  12597. * @private
  12598. *
  12599. * @returns
  12600. */
  12601. toCode(): string;
  12602. }
  12603. /**
  12604. * @private
  12605. */
  12606. class EXVariable extends CodeBase {
  12607. /**
  12608. * @private
  12609. */
  12610. constructor(name: string, defaultValue?: string);
  12611. /**
  12612. * @private
  12613. * 变量名
  12614. */
  12615. name: string;
  12616. /**
  12617. * @private
  12618. * 默认值
  12619. */
  12620. defaultValue: string;
  12621. /**
  12622. * @private
  12623. *
  12624. * @returns
  12625. */
  12626. toCode(): string;
  12627. }
  12628. /**
  12629. * @private
  12630. */
  12631. class EXState extends CodeBase {
  12632. /**
  12633. * @private
  12634. */
  12635. constructor(name: string, stateGroups?: any[]);
  12636. /**
  12637. * @private
  12638. * 视图状态名称
  12639. */
  12640. name: string;
  12641. /**
  12642. * @private
  12643. */
  12644. stateGroups: any[];
  12645. /**
  12646. * @private
  12647. */
  12648. addItems: any[];
  12649. /**
  12650. * @private
  12651. */
  12652. setProperty: any[];
  12653. /**
  12654. * @private
  12655. * 添加一个覆盖
  12656. */
  12657. addOverride(item: CodeBase): void;
  12658. /**
  12659. * @private
  12660. *
  12661. * @returns
  12662. */
  12663. toCode(): string;
  12664. }
  12665. /**
  12666. * @private
  12667. */
  12668. class EXAddItems extends CodeBase {
  12669. /**
  12670. * @private
  12671. */
  12672. constructor(target: string, property: string, position: number, relativeTo: string);
  12673. /**
  12674. * @private
  12675. * 要添加的实例
  12676. */
  12677. target: string;
  12678. /**
  12679. * @private
  12680. * 要添加到的属性
  12681. */
  12682. property: string;
  12683. /**
  12684. * @private
  12685. * 添加的位置
  12686. */
  12687. position: number;
  12688. /**
  12689. * @private
  12690. * 相对的显示元素
  12691. */
  12692. relativeTo: string;
  12693. /**
  12694. * @private
  12695. *
  12696. * @returns
  12697. */
  12698. toCode(): string;
  12699. }
  12700. /**
  12701. * @private
  12702. */
  12703. class EXSetProperty extends CodeBase {
  12704. /**
  12705. * @private
  12706. */
  12707. constructor(target: string, name: string, value: string);
  12708. /**
  12709. * @private
  12710. * 要修改的属性名
  12711. */
  12712. name: string;
  12713. /**
  12714. * @private
  12715. * 目标实例名
  12716. */
  12717. target: string;
  12718. /**
  12719. * @private
  12720. * 属性值
  12721. */
  12722. value: string;
  12723. /**
  12724. * @private
  12725. *
  12726. * @returns
  12727. */
  12728. toCode(): string;
  12729. }
  12730. /**
  12731. * @private
  12732. */
  12733. class EXSetStateProperty extends CodeBase {
  12734. /**
  12735. * @private
  12736. */
  12737. constructor(target: string, property: string, templates: string[], chainIndex: number[]);
  12738. /**
  12739. * @private
  12740. * 目标实例名
  12741. */
  12742. target: string;
  12743. /**
  12744. * @private
  12745. * 目标属性名
  12746. */
  12747. property: string;
  12748. /**
  12749. * @private
  12750. * 绑定的模板列表
  12751. */
  12752. templates: string[];
  12753. /**
  12754. * @private
  12755. * chainIndex是一个索引列表,每个索引指向templates中的一个值,该值是代表属性链。
  12756. */
  12757. chainIndex: number[];
  12758. /**
  12759. * @private
  12760. *
  12761. * @returns
  12762. */
  12763. toCode(): string;
  12764. }
  12765. /**
  12766. * @private
  12767. */
  12768. class EXBinding extends CodeBase {
  12769. /**
  12770. * @private
  12771. */
  12772. constructor(target: string, property: string, templates: string[], chainIndex: number[]);
  12773. /**
  12774. * @private
  12775. * 目标实例名
  12776. */
  12777. target: string;
  12778. /**
  12779. * @private
  12780. * 目标属性名
  12781. */
  12782. property: string;
  12783. /**
  12784. * @private
  12785. * 绑定的模板列表
  12786. */
  12787. templates: string[];
  12788. /**
  12789. * @private
  12790. * chainIndex是一个索引列表,每个索引指向templates中的一个值,该值是代表属性链。
  12791. */
  12792. chainIndex: number[];
  12793. /**
  12794. * @private
  12795. *
  12796. * @returns
  12797. */
  12798. toCode(): string;
  12799. }
  12800. }
  12801. declare namespace eui {
  12802. /**
  12803. * BitmapLabel is one line or multiline uneditable BitmapText
  12804. * @version Egret 2.5.3
  12805. * @version eui 1.0
  12806. * @platform Web,Native
  12807. * @language en_US
  12808. */
  12809. /**
  12810. * BitmapLabel 组件是一行或多行不可编辑的位图文本
  12811. * @version Egret 2.5.3
  12812. * @version eui 1.0
  12813. * @platform Web,Native
  12814. * @language zh_CN
  12815. */
  12816. class BitmapLabel extends egret.BitmapText implements UIComponent, IDisplayText {
  12817. constructor(text?: string);
  12818. /**
  12819. * @private
  12820. */
  12821. $invalidateContentBounds(): void;
  12822. /**
  12823. * @private
  12824. *
  12825. * @param value
  12826. */
  12827. $setWidth(value: number): boolean;
  12828. /**
  12829. * @private
  12830. *
  12831. * @param value
  12832. */
  12833. $setHeight(value: number): boolean;
  12834. /**
  12835. * @private
  12836. *
  12837. * @param value
  12838. */
  12839. $setText(value: string): boolean;
  12840. private $fontForBitmapLabel;
  12841. $setFont(value: any): boolean;
  12842. private $createChildrenCalled;
  12843. private $fontChanged;
  12844. /**
  12845. * 解析source
  12846. */
  12847. private $parseFont();
  12848. $setFontData(value: egret.BitmapFont, font?: string): boolean;
  12849. /**
  12850. * @private
  12851. */
  12852. private _widthConstraint;
  12853. /**
  12854. * @private
  12855. */
  12856. private _heightConstraint;
  12857. /**
  12858. * @private
  12859. * UIComponentImpl 定义的所有变量请不要添加任何初始值,必须统一在此处初始化。
  12860. */
  12861. private initializeUIValues;
  12862. /**
  12863. * @copy eui.UIComponent#createChildren
  12864. *
  12865. * @version Egret 2.4
  12866. * @version eui 1.0
  12867. * @platform Web,Native
  12868. */
  12869. protected createChildren(): void;
  12870. /**
  12871. * @copy eui.UIComponent#childrenCreated
  12872. *
  12873. * @version Egret 2.4
  12874. * @version eui 1.0
  12875. * @platform Web,Native
  12876. */
  12877. protected childrenCreated(): void;
  12878. /**
  12879. * @copy eui.UIComponent#commitProperties
  12880. *
  12881. * @version Egret 2.4
  12882. * @version eui 1.0
  12883. * @platform Web,Native
  12884. */
  12885. protected commitProperties(): void;
  12886. /**
  12887. * @copy eui.UIComponent#measure
  12888. *
  12889. * @version Egret 2.4
  12890. * @version eui 1.0
  12891. * @platform Web,Native
  12892. */
  12893. protected measure(): void;
  12894. /**
  12895. * @copy eui.UIComponent#updateDisplayList
  12896. *
  12897. * @version Egret 2.4
  12898. * @version eui 1.0
  12899. * @platform Web,Native
  12900. */
  12901. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  12902. /**
  12903. * @copy eui.UIComponent#invalidateParentLayout
  12904. *
  12905. * @version Egret 2.4
  12906. * @version eui 1.0
  12907. * @platform Web,Native
  12908. */
  12909. protected invalidateParentLayout(): void;
  12910. /**
  12911. * @private
  12912. */
  12913. $UIComponent: Object;
  12914. /**
  12915. * @private
  12916. */
  12917. $includeInLayout: boolean;
  12918. /**
  12919. * @copy eui.UIComponent#includeInLayout
  12920. *
  12921. * @version Egret 2.4
  12922. * @version eui 1.0
  12923. * @platform Web,Native
  12924. */
  12925. includeInLayout: boolean;
  12926. /**
  12927. * @copy eui.UIComponent#left
  12928. *
  12929. * @version Egret 2.4
  12930. * @version eui 1.0
  12931. * @platform Web,Native
  12932. */
  12933. left: any;
  12934. /**
  12935. * @copy eui.UIComponent#right
  12936. *
  12937. * @version Egret 2.4
  12938. * @version eui 1.0
  12939. * @platform Web,Native
  12940. */
  12941. right: any;
  12942. /**
  12943. * @copy eui.UIComponent#top
  12944. *
  12945. * @version Egret 2.4
  12946. * @version eui 1.0
  12947. * @platform Web,Native
  12948. */
  12949. top: any;
  12950. /**
  12951. * @copy eui.UIComponent#bottom
  12952. *
  12953. * @version Egret 2.4
  12954. * @version eui 1.0
  12955. * @platform Web,Native
  12956. */
  12957. bottom: any;
  12958. /**
  12959. * @copy eui.UIComponent#horizontalCenter
  12960. *
  12961. * @version Egret 2.4
  12962. * @version eui 1.0
  12963. * @platform Web,Native
  12964. */
  12965. horizontalCenter: any;
  12966. /**
  12967. * @copy eui.UIComponent#verticalCenter
  12968. *
  12969. * @version Egret 2.4
  12970. * @version eui 1.0
  12971. * @platform Web,Native
  12972. */
  12973. verticalCenter: any;
  12974. /**
  12975. * @copy eui.UIComponent#percentWidth
  12976. *
  12977. * @version Egret 2.4
  12978. * @version eui 1.0
  12979. * @platform Web,Native
  12980. */
  12981. percentWidth: number;
  12982. /**
  12983. * @copy eui.UIComponent#percentHeight
  12984. *
  12985. * @version Egret 2.4
  12986. * @version eui 1.0
  12987. * @platform Web,Native
  12988. */
  12989. percentHeight: number;
  12990. /**
  12991. * @copy eui.UIComponent#explicitWidth
  12992. *
  12993. * @version Egret 2.4
  12994. * @version eui 1.0
  12995. * @platform Web,Native
  12996. */
  12997. explicitWidth: number;
  12998. /**
  12999. * @copy eui.UIComponent#explicitHeight
  13000. *
  13001. * @version Egret 2.4
  13002. * @version eui 1.0
  13003. * @platform Web,Native
  13004. */
  13005. explicitHeight: number;
  13006. /**
  13007. * @copy eui.UIComponent#minWidth
  13008. *
  13009. * @version Egret 2.4
  13010. * @version eui 1.0
  13011. * @platform Web,Native
  13012. */
  13013. minWidth: number;
  13014. /**
  13015. * @copy eui.UIComponent#maxWidth
  13016. *
  13017. * @version Egret 2.4
  13018. * @version eui 1.0
  13019. * @platform Web,Native
  13020. */
  13021. maxWidth: number;
  13022. /**
  13023. * @copy eui.UIComponent#minHeight
  13024. *
  13025. * @version Egret 2.4
  13026. * @version eui 1.0
  13027. * @platform Web,Native
  13028. */
  13029. minHeight: number;
  13030. /**
  13031. * @copy eui.UIComponent#maxHeight
  13032. *
  13033. * @version Egret 2.4
  13034. * @version eui 1.0
  13035. * @platform Web,Native
  13036. */
  13037. maxHeight: number;
  13038. /**
  13039. * @inheritDoc
  13040. *
  13041. * @version Egret 2.4
  13042. * @version eui 1.0
  13043. * @platform Web,Native
  13044. */
  13045. setMeasuredSize(width: number, height: number): void;
  13046. /**
  13047. * @inheritDoc
  13048. *
  13049. * @version Egret 2.4
  13050. * @version eui 1.0
  13051. * @platform Web,Native
  13052. */
  13053. invalidateProperties(): void;
  13054. /**
  13055. * @inheritDoc
  13056. *
  13057. * @version Egret 2.4
  13058. * @version eui 1.0
  13059. * @platform Web,Native
  13060. */
  13061. validateProperties(): void;
  13062. /**
  13063. * @inheritDoc
  13064. *
  13065. * @version Egret 2.4
  13066. * @version eui 1.0
  13067. * @platform Web,Native
  13068. */
  13069. invalidateSize(): void;
  13070. /**
  13071. * @inheritDoc
  13072. *
  13073. * @version Egret 2.4
  13074. * @version eui 1.0
  13075. * @platform Web,Native
  13076. */
  13077. validateSize(recursive?: boolean): void;
  13078. /**
  13079. * @inheritDoc
  13080. *
  13081. * @version Egret 2.4
  13082. * @version eui 1.0
  13083. * @platform Web,Native
  13084. */
  13085. invalidateDisplayList(): void;
  13086. /**
  13087. * @inheritDoc
  13088. *
  13089. * @version Egret 2.4
  13090. * @version eui 1.0
  13091. * @platform Web,Native
  13092. */
  13093. validateDisplayList(): void;
  13094. /**
  13095. * @inheritDoc
  13096. *
  13097. * @version Egret 2.4
  13098. * @version eui 1.0
  13099. * @platform Web,Native
  13100. */
  13101. validateNow(): void;
  13102. /**
  13103. * @inheritDoc
  13104. *
  13105. * @version Egret 2.4
  13106. * @version eui 1.0
  13107. * @platform Web,Native
  13108. */
  13109. setLayoutBoundsSize(layoutWidth: number, layoutHeight: number): void;
  13110. /**
  13111. * @inheritDoc
  13112. *
  13113. * @version Egret 2.4
  13114. * @version eui 1.0
  13115. * @platform Web,Native
  13116. */
  13117. setLayoutBoundsPosition(x: number, y: number): void;
  13118. /**
  13119. * @inheritDoc
  13120. *
  13121. * @version Egret 2.4
  13122. * @version eui 1.0
  13123. * @platform Web,Native
  13124. */
  13125. getLayoutBounds(bounds: egret.Rectangle): void;
  13126. /**
  13127. * @inheritDoc
  13128. *
  13129. * @version Egret 2.4
  13130. * @version eui 1.0
  13131. * @platform Web,Native
  13132. */
  13133. getPreferredBounds(bounds: egret.Rectangle): void;
  13134. }
  13135. }
  13136. declare namespace EXML {
  13137. /**
  13138. * Set a prefix url.
  13139. * The prefix url will add to the front of the Exml file path when it’s loading.
  13140. * @param text the text of a EXML file.
  13141. *
  13142. * @version Egret 2.5.3
  13143. * @version eui 1.0
  13144. * @platform Web,Native
  13145. * @language en_US
  13146. */
  13147. /**
  13148. * 设置 EXML 文件加载的根路径。
  13149. * 设置后,再加载 EXML 文件时会自动把根路径加到文件路径前面
  13150. * @version Egret 2.5.3
  13151. * @version eui 1.0
  13152. * @platform Web,Native
  13153. * @language zh_CN
  13154. */
  13155. let prefixURL: string;
  13156. /**
  13157. * Parsing a text of EXML file for a definition of class. You can declare the <code>class</code> property in the root
  13158. * node of the EXML to register to the global as a class name.
  13159. *
  13160. * It will be fail to register and output a warning if the specified name already exists. You can get a definition
  13161. * of a class through <code>egret.getDefinitionByName(className)</code>.
  13162. *
  13163. * @param text the text of a EXML file.
  13164. *
  13165. * @version Egret 2.4
  13166. * @version eui 1.0
  13167. * @platform Web,Native
  13168. * @language en_US
  13169. */
  13170. /**
  13171. * 解析一个 EXML 文件的文本内容为一个类定义。您可以在 EXML 文件的根节点上声明 class 属性作为要注册到全局的类名。
  13172. * 若指定的类名已经存在,将会注册失败,并输出一个警告。注册成功后,您也可以通过 egret.getDefinitionByName(className) 方法获取这个 EXML 文件对应的类定义。
  13173. *
  13174. * @param text 要解析的 EXML 文件内容。
  13175. *
  13176. * @version Egret 2.4
  13177. * @version eui 1.0
  13178. * @platform Web,Native
  13179. * @language zh_CN
  13180. */
  13181. function parse(text: string): {
  13182. new (): any;
  13183. };
  13184. /**
  13185. * Load and parse an external EXML file for a class definition. You can declare the <code>class</code> property in the root
  13186. * node of the EXML to register to the global as a class name.
  13187. *
  13188. * It will be fail to register and output a warning if the specified name already exists. You can get a definition
  13189. * of a class through <code>egret.getDefinitionByName(className)</code>.
  13190. *
  13191. * @param url the path of an EXML file
  13192. * @param callBack method to invoke with an argument of the result when load and parse completed or failed. The argument will be
  13193. * <code>undefined</code> if load or parse failed.
  13194. * @param thisObject <code>this</code> object of callBack
  13195. * @param useCache use cached EXML
  13196. *
  13197. * @version Egret 2.4
  13198. * @version eui 1.0
  13199. * @platform Web,Native
  13200. * @language en_US
  13201. */
  13202. /**
  13203. * 加载并解析一个外部的 EXML 文件为一个类定义。您可以在 EXML 文件的根节点上声明 class 属性作为要注册到全局的类名。
  13204. * 若指定的类名已经存在,将会注册失败,并输出一个警告。注册成功后,您也可以通过 egret.getDefinitionByName(className) 方法获取这个 EXML 文件对应的类定义。
  13205. *
  13206. * @param url 要加载的 EXML 文件路径
  13207. * @param callBack 加载并解析完成后的回调函数,无论加载成功还是失败,此函数均会被回调。失败时将传入 undefined 作为回调函数参数。
  13208. * @param thisObject 回调函数的 this 引用。
  13209. * @param useCache 使用缓存的EXML
  13210. *
  13211. * @version Egret 2.4
  13212. * @version eui 1.0
  13213. * @platform Web,Native
  13214. * @language zh_CN
  13215. */
  13216. function load(url: string, callBack?: (clazz: any, url: string) => void, thisObject?: any, useCache?: boolean): void;
  13217. /**
  13218. * @private
  13219. */
  13220. function $loadAll(urls: string[], callBack?: (clazz: any[], url: string[]) => void, thisObject?: any, useCache?: boolean): void;
  13221. function update(url: string, clazz: any): void;
  13222. /**
  13223. * @private
  13224. * @param url
  13225. * @param text
  13226. */
  13227. function $parseURLContentAsJs(url: string, text: string, className: string): void;
  13228. /**
  13229. * @private
  13230. */
  13231. function $parseURLContent(url: string, text: string | any): any;
  13232. }
  13233. declare namespace eui.sys {
  13234. /**
  13235. * @private
  13236. * EUI 命名空间
  13237. */
  13238. let NS_S: string;
  13239. /**
  13240. * @private
  13241. * Wing命名空间
  13242. */
  13243. let NS_W: string;
  13244. /**
  13245. * @private
  13246. */
  13247. class EXMLConfig {
  13248. /**
  13249. * @private
  13250. */
  13251. $describe(instance: any): any;
  13252. /**
  13253. * @private
  13254. * 根据类的短名ID和命名空间获取完整类名(以"."分隔)
  13255. * @param id 类的短名ID
  13256. * @param ns 命名空间
  13257. */
  13258. getClassNameById(id: string, ns: string): string;
  13259. /**
  13260. * @private
  13261. * 根据ID获取对应的默认属性
  13262. * @param id 类的短名ID
  13263. * @param ns 命名空间
  13264. * @return 默认属性名
  13265. */
  13266. getDefaultPropById(id: string, ns: string): string;
  13267. /**
  13268. * @private
  13269. * 获取指定属性的类型,返回基本数据类型:"boolean","string","number","any"。
  13270. * @param property 属性名
  13271. * @param className 要查询的完整类名
  13272. */
  13273. getPropertyType(property: string, className: string): string;
  13274. }
  13275. }
  13276. declare namespace eui {
  13277. }
  13278. declare namespace eui {
  13279. }
  13280. declare namespace eui {
  13281. /**
  13282. * The BasicLayout class arranges the layout elements according to their individual settings,
  13283. * independent of each-other. BasicLayout, also called absolute layout, requires that you
  13284. * explicitly position each container child.
  13285. * You can use the <code>x</code> and <code>y</code> properties of the child,
  13286. * or constraints to position each child.
  13287. *
  13288. * @version Egret 2.4
  13289. * @version eui 1.0
  13290. * @platform Web,Native
  13291. * @includeExample extension/eui/layout/BasicLayoutExample.ts
  13292. * @language en_US
  13293. */
  13294. /**
  13295. * BasicLayout 类根据其各个设置彼此独立地排列布局元素。
  13296. * BasicLayout(也称为绝对布局)要求显式定位每个容器子代。
  13297. * 可以使用子代的 <code>x</code> 和 <code>y</code> 属性,或使用约束来定位每个子代。
  13298. *
  13299. * @version Egret 2.4
  13300. * @version eui 1.0
  13301. * @platform Web,Native
  13302. * @includeExample extension/eui/layout/BasicLayoutExample.ts
  13303. * @language zh_CN
  13304. */
  13305. class BasicLayout extends LayoutBase {
  13306. /**
  13307. * Constructor.
  13308. * @version Egret 2.4
  13309. * @version eui 1.0
  13310. * @platform Web,Native
  13311. * @language en_US
  13312. */
  13313. /**
  13314. * 构造函数。
  13315. * @version Egret 2.4
  13316. * @version eui 1.0
  13317. * @platform Web,Native
  13318. * @language zh_CN
  13319. */
  13320. constructor();
  13321. /**
  13322. * BasicLayout does not support virtual layout, setting this property is invalid.
  13323. *
  13324. * @version Egret 2.4
  13325. * @version eui 1.0
  13326. * @platform Web,Native
  13327. * @language en_US
  13328. */
  13329. /**
  13330. * BasicLayout不支持虚拟布局,设置这个属性无效。
  13331. *
  13332. * @version Egret 2.4
  13333. * @version eui 1.0
  13334. * @platform Web,Native
  13335. * @language zh_CN
  13336. */
  13337. useVirtualLayout: boolean;
  13338. /**
  13339. * @inheritDoc
  13340. *
  13341. * @version Egret 2.4
  13342. * @version eui 1.0
  13343. * @platform Web,Native
  13344. */
  13345. measure(): void;
  13346. /**
  13347. * @inheritDoc
  13348. *
  13349. * @version Egret 2.4
  13350. * @version eui 1.0
  13351. * @platform Web,Native
  13352. */
  13353. updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  13354. }
  13355. }
  13356. declare namespace eui.sys {
  13357. /**
  13358. * @private
  13359. * 一个工具方法,使用BasicLayout规则测量目标对象。
  13360. */
  13361. function measure(target: eui.Group | eui.Component): void;
  13362. /**
  13363. * @private
  13364. * 一个工具方法,使用BasicLayout规则布局目标对象。
  13365. */
  13366. function updateDisplayList(target: eui.Group | eui.Component, unscaledWidth: number, unscaledHeight: number): egret.Point;
  13367. }
  13368. declare namespace eui {
  13369. /**
  13370. * The ColumnAlign class defines the possible values for the
  13371. * <code>columnAlign</code> property of the TileLayout class.
  13372. *
  13373. * @version Egret 2.4
  13374. * @version eui 1.0
  13375. * @platform Web,Native
  13376. * @includeExample extension/eui/layout/ColumnAlignExample.ts
  13377. * @language en_US
  13378. */
  13379. /**
  13380. * ColumnAlign 类为 TileLayout 类的 <code>columnAlign</code> 属性定义可能的值。
  13381. *
  13382. * @version Egret 2.4
  13383. * @version eui 1.0
  13384. * @platform Web,Native
  13385. * @includeExample extension/eui/layout/ColumnAlignExample.ts
  13386. * @language zh_CN
  13387. */
  13388. class ColumnAlign {
  13389. /**
  13390. * Do not justify the rows.
  13391. *
  13392. * @version Egret 2.4
  13393. * @version eui 1.0
  13394. * @platform Web,Native
  13395. * @language en_US
  13396. */
  13397. /**
  13398. * 不将行两端对齐。
  13399. *
  13400. * @version Egret 2.4
  13401. * @version eui 1.0
  13402. * @platform Web,Native
  13403. * @language zh_CN
  13404. */
  13405. static LEFT: string;
  13406. /**
  13407. * Justify the rows by increasing the vertical gap.
  13408. *
  13409. * @version Egret 2.4
  13410. * @version eui 1.0
  13411. * @platform Web,Native
  13412. * @language en_US
  13413. */
  13414. /**
  13415. * 通过增大水平间隙将行两端对齐。
  13416. *
  13417. * @version Egret 2.4
  13418. * @version eui 1.0
  13419. * @platform Web,Native
  13420. * @language zh_CN
  13421. */
  13422. static JUSTIFY_USING_GAP: string;
  13423. /**
  13424. * Justify the rows by increasing the row height.
  13425. *
  13426. * @version Egret 2.4
  13427. * @version eui 1.0
  13428. * @platform Web,Native
  13429. * @language en_US
  13430. */
  13431. /**
  13432. * 通过增大行高度将行两端对齐。
  13433. *
  13434. * @version Egret 2.4
  13435. * @version eui 1.0
  13436. * @platform Web,Native
  13437. * @language zh_CN
  13438. */
  13439. static JUSTIFY_USING_WIDTH: string;
  13440. }
  13441. }
  13442. declare namespace eui {
  13443. /**
  13444. * The HorizontalLayout class arranges the layout elements in a horizontal sequence,
  13445. * left to right, with optional gaps between the elements and optional padding
  13446. * around the elements.
  13447. *
  13448. * @version Egret 2.4
  13449. * @version eui 1.0
  13450. * @platform Web,Native
  13451. * @includeExample extension/eui/layout/HorizontalLayoutExample.ts
  13452. * @language en_US
  13453. */
  13454. /**
  13455. * HorizontalLayout 类按水平顺序从左到右排列布局元素,在元素和围绕元素的可选填充之间带有可选间隙。
  13456. *
  13457. * @version Egret 2.4
  13458. * @version eui 1.0
  13459. * @platform Web,Native
  13460. * @includeExample extension/eui/layout/HorizontalLayoutExample.ts
  13461. * @language zh_CN
  13462. */
  13463. class HorizontalLayout extends LinearLayoutBase {
  13464. /**
  13465. * @inheritDoc
  13466. *
  13467. * @version Egret 2.4
  13468. * @version eui 1.0
  13469. * @platform Web,Native
  13470. */
  13471. protected measureReal(): void;
  13472. /**
  13473. * @inheritDoc
  13474. *
  13475. * @version Egret 2.4
  13476. * @version eui 1.0
  13477. * @platform Web,Native
  13478. */
  13479. protected measureVirtual(): void;
  13480. /**
  13481. * @inheritDoc
  13482. *
  13483. * @version Egret 2.4
  13484. * @version eui 1.0
  13485. * @platform Web,Native
  13486. */
  13487. protected updateDisplayListReal(width: number, height: number): void;
  13488. /**
  13489. * @inheritDoc
  13490. *
  13491. * @version Egret 2.4
  13492. * @version eui 1.0
  13493. * @platform Web,Native
  13494. */
  13495. protected updateDisplayListVirtual(width: number, height: number): void;
  13496. /**
  13497. * @inheritDoc
  13498. *
  13499. * @version Egret 2.4
  13500. * @version eui 1.0
  13501. * @platform Web,Native
  13502. */
  13503. protected getStartPosition(index: number): number;
  13504. /**
  13505. * @inheritDoc
  13506. *
  13507. * @version Egret 2.4
  13508. * @version eui 1.0
  13509. * @platform Web,Native
  13510. */
  13511. protected getElementSize(index: number): number;
  13512. /**
  13513. * @inheritDoc
  13514. *
  13515. * @version Egret 2.4
  13516. * @version eui 1.0
  13517. * @platform Web,Native
  13518. */
  13519. protected getElementTotalSize(): number;
  13520. /**
  13521. * @inheritDoc
  13522. *
  13523. * @version Egret 2.4
  13524. * @version eui 1.0
  13525. * @platform Web,Native
  13526. */
  13527. elementAdded(index: number): void;
  13528. /**
  13529. * @inheritDoc
  13530. *
  13531. * @version Egret 2.4
  13532. * @version eui 1.0
  13533. * @platform Web,Native
  13534. */
  13535. protected getIndexInView(): boolean;
  13536. }
  13537. }
  13538. declare namespace eui {
  13539. /**
  13540. * The JustifyAlign class defines the possible values for the
  13541. * <code>horizontalAlign</code> 和 <code>verticalAlign</code> property of
  13542. * Layout class.
  13543. *
  13544. * @version Egret 2.4
  13545. * @version eui 1.0
  13546. * @platform Web,Native
  13547. * @includeExample extension/eui/layout/JustifyAlignExample.ts
  13548. * @language en_US
  13549. */
  13550. /**
  13551. * JustifyAlign 定义布局类中 horizontalAlign 与 verticalAlign 属性需要的两端对齐常量值。
  13552. *
  13553. * @version Egret 2.4
  13554. * @version eui 1.0
  13555. * @platform Web,Native
  13556. * @includeExample extension/eui/layout/JustifyAlignExample.ts
  13557. * @language zh_CN
  13558. */
  13559. class JustifyAlign {
  13560. /**
  13561. * Justify the children with respect to the container.
  13562. * This uniformly sizes all children to be the same size as the
  13563. * container.
  13564. *
  13565. * @version Egret 2.4
  13566. * @version eui 1.0
  13567. * @platform Web,Native
  13568. * @language en_US
  13569. */
  13570. /**
  13571. * 相对于容器对齐子代。这会将所有子代的大小统一调整为与容器相同的尺寸。
  13572. *
  13573. * @version Egret 2.4
  13574. * @version eui 1.0
  13575. * @platform Web,Native
  13576. * @language zh_CN
  13577. */
  13578. static JUSTIFY: string;
  13579. /**
  13580. * Content justify the children width/height respect to the container.
  13581. * This uniformly sizes all children to be the content width/height of the container.
  13582. * The content width/height of the container is the size of the largest child.
  13583. * If all children are smaller than the width/height of the container, then
  13584. * all the children will be sized to the width/height of the container.
  13585. *
  13586. * @version Egret 2.4
  13587. * @version eui 1.0
  13588. * @platform Web,Native
  13589. * @language en_US
  13590. */
  13591. /**
  13592. * 相对于容器对子代进行内容对齐。这会将所有子代的大小统一调整为容器的内容宽度/高度。
  13593. * 容器的内容宽度/高度是最大子代的大小。如果所有子代都小于容器的宽度/高度,则会将所有子代的大小调整为容器的宽度/高度。
  13594. *
  13595. * @version Egret 2.4
  13596. * @version eui 1.0
  13597. * @platform Web,Native
  13598. * @language zh_CN
  13599. */
  13600. static CONTENT_JUSTIFY: string;
  13601. }
  13602. }
  13603. declare namespace eui {
  13604. /**
  13605. * The RowAlign class defines the possible values for the
  13606. * <code>rowAlign</code> property of the TileLayout class.
  13607. *
  13608. * @version Egret 2.4
  13609. * @version eui 1.0
  13610. * @platform Web,Native
  13611. * @includeExample extension/eui/layout/RowAlignExample.ts
  13612. * @language en_US
  13613. */
  13614. /**
  13615. * RowAlign 类为 TileLayout 类的 <code>rowAlign</code> 属性定义可能的值。
  13616. *
  13617. * @version Egret 2.4
  13618. * @version eui 1.0
  13619. * @platform Web,Native
  13620. * @includeExample extension/eui/layout/RowAlignExample.ts
  13621. * @language zh_CN
  13622. */
  13623. class RowAlign {
  13624. /**
  13625. * Do not justify the rows.
  13626. *
  13627. * @version Egret 2.4
  13628. * @version eui 1.0
  13629. * @platform Web,Native
  13630. * @language en_US
  13631. */
  13632. /**
  13633. * 不进行两端对齐。
  13634. *
  13635. * @version Egret 2.4
  13636. * @version eui 1.0
  13637. * @platform Web,Native
  13638. * @language zh_CN
  13639. */
  13640. static TOP: string;
  13641. /**
  13642. * Justify the rows by increasing the vertical gap.
  13643. *
  13644. * @version Egret 2.4
  13645. * @version eui 1.0
  13646. * @platform Web,Native
  13647. * @language en_US
  13648. */
  13649. /**
  13650. * 通过增大垂直间隙将行两端对齐。
  13651. *
  13652. * @version Egret 2.4
  13653. * @version eui 1.0
  13654. * @platform Web,Native
  13655. * @language zh_CN
  13656. */
  13657. static JUSTIFY_USING_GAP: string;
  13658. /**
  13659. * Justify the rows by increasing the row height.
  13660. *
  13661. * @version Egret 2.4
  13662. * @version eui 1.0
  13663. * @platform Web,Native
  13664. * @language en_US
  13665. */
  13666. /**
  13667. * 通过增大行高度将行两端对齐。
  13668. *
  13669. * @version Egret 2.4
  13670. * @version eui 1.0
  13671. * @platform Web,Native
  13672. * @language zh_CN
  13673. */
  13674. static JUSTIFY_USING_HEIGHT: string;
  13675. }
  13676. }
  13677. declare namespace eui {
  13678. /**
  13679. * The TileLayout class arranges layout elements in columns and rows
  13680. * of equally-sized cells.
  13681. * The TileLayout class uses a number of properties that control orientation,
  13682. * count, size, gap and justification of the columns and the rows
  13683. * as well as element alignment within the cells.
  13684. *
  13685. * @version Egret 2.4
  13686. * @version eui 1.0
  13687. * @platform Web,Native
  13688. * @includeExample extension/eui/layout/TileLayoutExample.ts
  13689. * @language en_US
  13690. */
  13691. /**
  13692. * TileLayout 类在单元格大小相等的列和行中排列布局元素。
  13693. * TileLayout 类使用许多属性来控制列和行的方向、计数、大小、间隙和两端对齐以及单元格内的元素对齐。
  13694. *
  13695. * @version Egret 2.4
  13696. * @version eui 1.0
  13697. * @platform Web,Native
  13698. * @includeExample extension/eui/layout/TileLayoutExample.ts
  13699. * @language zh_CN
  13700. */
  13701. class TileLayout extends LayoutBase {
  13702. /**
  13703. * Constructor.
  13704. * @version Egret 2.4
  13705. * @version eui 1.0
  13706. * @platform Web,Native
  13707. * @language en_US
  13708. */
  13709. /**
  13710. * 构造函数。
  13711. * @version Egret 2.4
  13712. * @version eui 1.0
  13713. * @platform Web,Native
  13714. * @language zh_CN
  13715. */
  13716. constructor();
  13717. /**
  13718. * @private
  13719. * 标记horizontalGap被显式指定过
  13720. */
  13721. private explicitHorizontalGap;
  13722. /**
  13723. * @private
  13724. */
  13725. private _horizontalGap;
  13726. /**
  13727. * Horizontal space between columns, in pixels.
  13728. *
  13729. * @default 6
  13730. *
  13731. * @version Egret 2.4
  13732. * @version eui 1.0
  13733. * @platform Web,Native
  13734. * @language en_US
  13735. */
  13736. /**
  13737. * 列之间的水平空间(以像素为单位)。
  13738. *
  13739. * @default 6
  13740. *
  13741. * @version Egret 2.4
  13742. * @version eui 1.0
  13743. * @platform Web,Native
  13744. * @language zh_CN
  13745. */
  13746. horizontalGap: number;
  13747. /**
  13748. * @private
  13749. * 标记verticalGap被显式指定过
  13750. */
  13751. private explicitVerticalGap;
  13752. /**
  13753. * @private
  13754. */
  13755. private _verticalGap;
  13756. /**
  13757. * Vertical space between rows, in pixels.
  13758. *
  13759. * @default 6
  13760. *
  13761. * @version Egret 2.4
  13762. * @version eui 1.0
  13763. * @platform Web,Native
  13764. * @language en_US
  13765. */
  13766. /**
  13767. * 行之间的垂直空间(以像素为单位)。
  13768. *
  13769. * @default 6
  13770. *
  13771. * @version Egret 2.4
  13772. * @version eui 1.0
  13773. * @platform Web,Native
  13774. * @language zh_CN
  13775. */
  13776. verticalGap: number;
  13777. /**
  13778. * @private
  13779. */
  13780. private _columnCount;
  13781. /**
  13782. * Contain the actual column count.
  13783. *
  13784. * @default -1
  13785. *
  13786. * @version Egret 2.4
  13787. * @version eui 1.0
  13788. * @platform Web,Native
  13789. * @language en_US
  13790. */
  13791. /**
  13792. * 实际列计数。
  13793. *
  13794. * @default -1
  13795. *
  13796. * @version Egret 2.4
  13797. * @version eui 1.0
  13798. * @platform Web,Native
  13799. * @language zh_CN
  13800. */
  13801. readonly columnCount: number;
  13802. /**
  13803. * @private
  13804. */
  13805. private _requestedColumnCount;
  13806. /**
  13807. * Number of columns to be displayed.
  13808. * <p>Set to 0 to allow the TileLayout to determine
  13809. * the column count automatically.</p>
  13810. * <p>If the <code>orientation</code> property is set to <code>TileOrientation.ROWS</code>,
  13811. * then setting this property has no effect
  13812. * In this case, the <code>rowCount</code> is explicitly set, and the
  13813. * container width is explicitly set. </p>
  13814. *
  13815. * @default 0
  13816. *
  13817. * @version Egret 2.4
  13818. * @version eui 1.0
  13819. * @platform Web,Native
  13820. * @language en_US
  13821. */
  13822. /**
  13823. * 要显示的列数。
  13824. * <p>设置为 0 会允许 TileLayout 自动确定列计数。</p>
  13825. * <p>如果将 <code>orientation</code> 属性设置为 <code>TileOrientation.ROWS</code>,
  13826. * 则设置此属性不会产生任何效果。这种情况下,会显式设置 code>rowCount</code>,并显式设置容器宽度。</p>
  13827. *
  13828. * @default 0
  13829. *
  13830. * @version Egret 2.4
  13831. * @version eui 1.0
  13832. * @platform Web,Native
  13833. * @language zh_CN
  13834. */
  13835. requestedColumnCount: number;
  13836. /**
  13837. * @private
  13838. */
  13839. private _rowCount;
  13840. /**
  13841. * The row count.
  13842. *
  13843. * @version Egret 2.4
  13844. * @version eui 1.0
  13845. * @platform Web,Native
  13846. * @language en_US
  13847. */
  13848. /**
  13849. * 行计数。
  13850. *
  13851. * @version Egret 2.4
  13852. * @version eui 1.0
  13853. * @platform Web,Native
  13854. * @language zh_CN
  13855. */
  13856. readonly rowCount: number;
  13857. /**
  13858. * @private
  13859. */
  13860. private _requestedRowCount;
  13861. /**
  13862. * Number of rows to be displayed.
  13863. * <p>Set to 0 to remove explicit override and allow the TileLayout to determine
  13864. * the row count automatically.</p>
  13865. * <p>If the <code>orientation</code> property is set to
  13866. * <code>TileOrientation.COLUMNS</code>, setting this property has no effect.
  13867. * in this case, <code>columnCount</code> is explicitly set, and the
  13868. * container height is explicitly set.</p>
  13869. *
  13870. * @default 0
  13871. *
  13872. * @version Egret 2.4
  13873. * @version eui 1.0
  13874. * @platform Web,Native
  13875. * @language en_US
  13876. */
  13877. /**
  13878. * 要显示的行数。
  13879. * <code>设置为 -1 会删除显式覆盖并允许 TileLayout 自动确定行计数。</code>
  13880. * <code>如果将 <code>orientation</code> 属性设置为 <code>TileOrientation.COLUMNS</code>,
  13881. * 则设置此属性不会产生任何效果。这种情况下,会显式设置 <code>columnCount</code>,并显式设置容器高度。</code>
  13882. *
  13883. * @default 0
  13884. *
  13885. * @version Egret 2.4
  13886. * @version eui 1.0
  13887. * @platform Web,Native
  13888. * @language zh_CN
  13889. */
  13890. requestedRowCount: number;
  13891. /**
  13892. * @private
  13893. * 外部显式指定的列宽
  13894. */
  13895. private explicitColumnWidth;
  13896. /**
  13897. * @private
  13898. */
  13899. private _columnWidth;
  13900. /**
  13901. * Contain the actual column width, in pixels.
  13902. * <p>If not explicitly set, the column width is
  13903. * determined from the width of the widest element. </p>
  13904. *
  13905. * @default NaN
  13906. *
  13907. * @version Egret 2.4
  13908. * @version eui 1.0
  13909. * @platform Web,Native
  13910. * @language en_US
  13911. */
  13912. /**
  13913. * 包含实际列宽(以像素为单位)。
  13914. * <p>若未显式设置,则从根据最宽的元素的宽度确定列宽度。</p>
  13915. *
  13916. * @default NaN
  13917. *
  13918. * @version Egret 2.4
  13919. * @version eui 1.0
  13920. * @platform Web,Native
  13921. * @language zh_CN
  13922. */
  13923. columnWidth: number;
  13924. /**
  13925. * @private
  13926. * 外部显式指定的行高
  13927. */
  13928. private explicitRowHeight;
  13929. /**
  13930. * @private
  13931. */
  13932. private _rowHeight;
  13933. /**
  13934. * The row height, in pixels.
  13935. * <p>If not explicitly set, the row height is
  13936. * determined from the maximum of elements' height.</p>
  13937. *
  13938. * @default NaN
  13939. *
  13940. * @version Egret 2.4
  13941. * @version eui 1.0
  13942. * @platform Web,Native
  13943. * @language en_US
  13944. */
  13945. /**
  13946. * 行高(以像素为单位)。
  13947. * <p>如果未显式设置,则从元素的高度的最大值确定行高度。<p>
  13948. *
  13949. * @default NaN
  13950. *
  13951. * @version Egret 2.4
  13952. * @version eui 1.0
  13953. * @platform Web,Native
  13954. * @language zh_CN
  13955. */
  13956. rowHeight: number;
  13957. /**
  13958. * @private
  13959. */
  13960. private _paddingLeft;
  13961. /**
  13962. * @copy eui.LinearLayoutBase#paddingLeft
  13963. *
  13964. * @version Egret 2.4
  13965. * @version eui 1.0
  13966. * @platform Web,Native
  13967. */
  13968. paddingLeft: number;
  13969. /**
  13970. * @private
  13971. */
  13972. private _paddingRight;
  13973. /**
  13974. * @copy eui.LinearLayoutBase#paddingRight
  13975. *
  13976. * @version Egret 2.4
  13977. * @version eui 1.0
  13978. * @platform Web,Native
  13979. */
  13980. paddingRight: number;
  13981. /**
  13982. * @private
  13983. */
  13984. private _paddingTop;
  13985. /**
  13986. * @copy eui.LinearLayoutBase#paddingTop
  13987. *
  13988. * @version Egret 2.4
  13989. * @version eui 1.0
  13990. * @platform Web,Native
  13991. */
  13992. paddingTop: number;
  13993. /**
  13994. * @private
  13995. */
  13996. private _paddingBottom;
  13997. /**
  13998. * @copy eui.LinearLayoutBase#paddingBottom
  13999. *
  14000. * @version Egret 2.4
  14001. * @version eui 1.0
  14002. * @platform Web,Native
  14003. */
  14004. paddingBottom: number;
  14005. /**
  14006. * @private
  14007. */
  14008. private _horizontalAlign;
  14009. /**
  14010. * Specifies how to align the elements within the cells in the horizontal direction.
  14011. * Supported values are
  14012. * HorizontalAlign.LEFT、HorizontalAlign.CENTER、
  14013. * HorizontalAlign.RIGHT、JustifyAlign.JUSTIFY。
  14014. *
  14015. * @default <code>JustifyAlign.JUSTIFY</code>
  14016. *
  14017. * @version Egret 2.4
  14018. * @version eui 1.0
  14019. * @platform Web,Native
  14020. * @language en_US
  14021. */
  14022. /**
  14023. * 指定如何在水平方向上对齐单元格内的元素。支持的值有
  14024. * HorizontalAlign.LEFT、HorizontalAlign.CENTER、
  14025. * HorizontalAlign.RIGHT、JustifyAlign.JUSTIFY。
  14026. *
  14027. * @default <code>JustifyAlign.JUSTIFY</code>
  14028. *
  14029. * @version Egret 2.4
  14030. * @version eui 1.0
  14031. * @platform Web,Native
  14032. * @language zh_CN
  14033. */
  14034. horizontalAlign: string;
  14035. /**
  14036. * @private
  14037. */
  14038. private _verticalAlign;
  14039. /**
  14040. * 指定如何在垂直方向上对齐单元格内的元素。
  14041. * 支持的值有 VerticalAlign.TOP、VerticalAlign.MIDDLE、
  14042. * VerticalAlign.BOTTOM、JustifyAlign.JUSTIFY。
  14043. * 默认值:JustifyAlign.JUSTIFY。
  14044. *
  14045. * @default <code>eui.JustifyAlign.JUSTIFY</code>
  14046. *
  14047. * @version Egret 2.4
  14048. * @version eui 1.0
  14049. * @platform Web,Native
  14050. * @language en_US
  14051. */
  14052. /**
  14053. * Specifies how to align the elements within the cells in the vertical direction.
  14054. * Supported values are
  14055. * VerticalAlign.TOP、VerticalAlign.MIDDLE、
  14056. * VerticalAlign.BOTTOM、JustifyAlign.JUSTIFY。
  14057. *
  14058. * @default <code>eui.JustifyAlign.JUSTIFY</code>
  14059. *
  14060. * @version Egret 2.4
  14061. * @version eui 1.0
  14062. * @platform Web,Native
  14063. * @language zh_CN
  14064. */
  14065. verticalAlign: string;
  14066. /**
  14067. * @private
  14068. */
  14069. private _columnAlign;
  14070. /**
  14071. * Specifies how to justify the fully visible columns to the container width.
  14072. *
  14073. * <p>When set to <code>ColumnAlign.LEFT</code> it turns column justification off.
  14074. * There may be partially visible columns or whitespace between the last column and
  14075. * the right edge of the container. This is the default value.</p>
  14076. *
  14077. * <p>When set to <code>ColumnAlign.JUSTIFY_USING_GAP</code> the <code>horizontalGap</code>
  14078. * actual value increases so that
  14079. * the last fully visible column right edge aligns with the container's right edge.
  14080. * In case there is only a single fully visible column, the <code>horizontalGap</code> actual value
  14081. * increases so that it pushes any partially visible column beyond the right edge
  14082. * of the container.
  14083. * Note that explicitly setting the <code>horizontalGap</code> property does not turn off
  14084. * justification. It only determines the initial gap value.
  14085. * Justification may increases it.</p>
  14086. *
  14087. * <p>When set to <code>ColumnAlign.JUSTIFY_USING_WIDTH</code> the <code>columnWidth</code>
  14088. * actual value increases so that
  14089. * the last fully visible column right edge aligns with the container's right edge.
  14090. * Note that explicitly setting the <code>columnWidth</code> property does not turn off justification.
  14091. * It only determines the initial column width value.
  14092. * Justification may increases it.</p>
  14093. *
  14094. * @default ColumnAlign.LEFT
  14095. *
  14096. * @version Egret 2.4
  14097. * @version eui 1.0
  14098. * @platform Web,Native
  14099. * @language en_US
  14100. */
  14101. /**
  14102. * 指定如何将完全可见列与容器宽度对齐。
  14103. *
  14104. * <p>设置为 <code>ColumnAlign.LEFT</code> 时,它会关闭列两端对齐。
  14105. * 在容器的最后一列和右边缘之间可能存在部分可见的列或空白。这是默认值。</p>
  14106. *
  14107. * <p>设置为 <code>ColumnAlign.JUSTIFY_USING_GAP</code> 时,<code>horizontalGap</code> 的实际值将增大,
  14108. * 这样最后一个完全可见列右边缘会与容器的右边缘对齐。仅存在一个完全可见列时,
  14109. * <code>horizontalGap</code> 的实际值将增大,这样它会将任何部分可见列推到容器的右边缘之外。
  14110. * 请注意显式设置 <code>horizontalGap</code> 属性不会关闭两端对齐。它仅确定初始间隙值。两端对齐可能会增大它。</p>
  14111. *
  14112. * <p>设置为 <code>ColumnAlign.JUSTIFY_USING_WIDTH</code> 时,<code>columnWidth</code> 的实际值将增大,
  14113. * 这样最后一个完全可见列右边缘会与容器的右边缘对齐。请注意显式设置 <code>columnWidth</code> 属性不会关闭两端对齐。
  14114. * 它仅确定初始列宽度值。两端对齐可能会增大它。</p>
  14115. *
  14116. * @default ColumnAlign.LEFT
  14117. *
  14118. * @version Egret 2.4
  14119. * @version eui 1.0
  14120. * @platform Web,Native
  14121. * @language zh_CN
  14122. */
  14123. columnAlign: string;
  14124. /**
  14125. * @private
  14126. */
  14127. private _rowAlign;
  14128. /**
  14129. * Specifies how to justify the fully visible rows to the container height.
  14130. *
  14131. * <p>When set to <code>RowAlign.TOP</code> it turns column justification off.
  14132. * There might be partially visible rows or whitespace between the last row and
  14133. * the bottom edge of the container. This is the default value.</p>
  14134. *
  14135. * <p>When set to <code>RowAlign.JUSTIFY_USING_GAP</code> the <code>verticalGap</code>
  14136. * actual value increases so that
  14137. * the last fully visible row bottom edge aligns with the container's bottom edge.
  14138. * In case there is only a single fully visible row, the value of <code>verticalGap</code>
  14139. * increases so that it pushes any partially visible row beyond the bottom edge
  14140. * of the container. Note that explicitly setting the <code>verticalGap</code> does not turn off
  14141. * justification, but just determines the initial gap value.
  14142. * Justification can then increases it.</p>
  14143. *
  14144. * <p>When set to <code>RowAlign.JUSTIFY_USING_HEIGHT</code> the <code>rowHeight</code>
  14145. * actual value increases so that
  14146. * the last fully visible row bottom edge aligns with the container's bottom edge. Note that
  14147. * explicitly setting the <code>rowHeight</code> does not turn off justification, but
  14148. * determines the initial row height value.
  14149. * Justification can then increase it.</p>
  14150. *
  14151. * @default RowAlign.TOP
  14152. *
  14153. * @version Egret 2.4
  14154. * @version eui 1.0
  14155. * @platform Web,Native
  14156. * @language en_US
  14157. */
  14158. /**
  14159. * 指定如何将完全可见行与容器高度对齐。
  14160. *
  14161. * <p>设置为 <code>RowAlign.TOP</code> 时,它会关闭列两端对齐。
  14162. * 在容器的最后一行和底边缘之间可能存在部分可见的行或空白。这是默认值。</p>
  14163. *
  14164. * <p>设置为 <code>RowAlign.JUSTIFY_USING_GAP</code> 时,<code>verticalGap</code> 的实际值会增大,
  14165. * 这样最后一个完全可见行底边缘会与容器的底边缘对齐。仅存在一个完全可见行时,<code>verticalGap</code> 的值会增大,
  14166. * 这样它会将任何部分可见行推到容器的底边缘之外。请注意,显式设置 <code>verticalGap</code>
  14167. * 不会关闭两端对齐,而只是确定初始间隙值。两端对齐接着可以增大它。</p>
  14168. *
  14169. * <p>设置为 <code>RowAlign.JUSTIFY_USING_HEIGHT</code> 时,<code>rowHeight</code> 的实际值会增大,
  14170. * 这样最后一个完全可见行底边缘会与容器的底边缘对齐。请注意,显式设置 <code>rowHeight</code>
  14171. * 不会关闭两端对齐,而只是确定初始行高度值。两端对齐接着可以增大它。</p>
  14172. *
  14173. * @default RowAlign.TOP
  14174. *
  14175. * @version Egret 2.4
  14176. * @version eui 1.0
  14177. * @platform Web,Native
  14178. * @language zh_CN
  14179. */
  14180. rowAlign: string;
  14181. /**
  14182. * @private
  14183. */
  14184. private _orientation;
  14185. /**
  14186. * Specifies whether elements are arranged row by row or
  14187. * column by column.
  14188. *
  14189. * @default TileOrientation.ROWS
  14190. *
  14191. * @version Egret 2.4
  14192. * @version eui 1.0
  14193. * @platform Web,Native
  14194. * @language en_US
  14195. */
  14196. /**
  14197. * 指定是逐行还是逐列排列元素。
  14198. *
  14199. * @default TileOrientation.ROWS
  14200. *
  14201. * @version Egret 2.4
  14202. * @version eui 1.0
  14203. * @platform Web,Native
  14204. * @language zh_CN
  14205. */
  14206. orientation: string;
  14207. /**
  14208. * @private
  14209. * 标记目标容器的尺寸和显示列表失效
  14210. */
  14211. private invalidateTargetLayout();
  14212. /**
  14213. * @inheritDoc
  14214. *
  14215. * @version Egret 2.4
  14216. * @version eui 1.0
  14217. * @platform Web,Native
  14218. */
  14219. measure(): void;
  14220. /**
  14221. * @private
  14222. * 计算行和列的尺寸及数量
  14223. */
  14224. private calculateRowAndColumn(explicitWidth, explicitHeight);
  14225. /**
  14226. * @private
  14227. * 缓存的最大子对象宽度
  14228. */
  14229. private maxElementWidth;
  14230. /**
  14231. * @private
  14232. * 缓存的最大子对象高度
  14233. */
  14234. private maxElementHeight;
  14235. /**
  14236. * @private
  14237. * 更新最大子对象尺寸
  14238. */
  14239. private updateMaxElementSize();
  14240. /**
  14241. * @private
  14242. * 更新虚拟布局的最大子对象尺寸
  14243. */
  14244. private doUpdateMaxElementSize(startIndex, endIndex);
  14245. /**
  14246. * @inheritDoc
  14247. *
  14248. * @version Egret 2.4
  14249. * @version eui 1.0
  14250. * @platform Web,Native
  14251. */
  14252. clearVirtualLayoutCache(): void;
  14253. /**
  14254. * @private
  14255. * 当前视图中的第一个元素索引
  14256. */
  14257. private startIndex;
  14258. /**
  14259. * @private
  14260. * 当前视图中的最后一个元素的索引
  14261. */
  14262. private endIndex;
  14263. /**
  14264. * @private
  14265. * 视图的第一个和最后一个元素的索引值已经计算好的标志
  14266. */
  14267. private indexInViewCalculated;
  14268. /**
  14269. * @inheritDoc
  14270. *
  14271. * @version Egret 2.4
  14272. * @version eui 1.0
  14273. * @platform Web,Native
  14274. */
  14275. scrollPositionChanged(): void;
  14276. /**
  14277. * @private
  14278. * 获取视图中第一个和最后一个元素的索引,返回是否发生改变
  14279. */
  14280. private getIndexInView();
  14281. /**
  14282. * @inheritDoc
  14283. *
  14284. * @version Egret 2.4
  14285. * @version eui 1.0
  14286. * @platform Web,Native
  14287. */
  14288. updateDisplayList(width: number, height: number): void;
  14289. /**
  14290. * @private
  14291. * 为单个元素布局
  14292. */
  14293. private sizeAndPositionElement(element, cellX, cellY, cellWidth, cellHeight);
  14294. /**
  14295. * @private
  14296. * 为两端对齐调整间隔或格子尺寸
  14297. */
  14298. private adjustForJustify(width, height);
  14299. }
  14300. }
  14301. declare namespace eui {
  14302. /**
  14303. * The TileOrientation class defines the possible values for the
  14304. * <code>orientation</code> property of the TileLayout class.
  14305. *
  14306. * @version Egret 2.4
  14307. * @version eui 1.0
  14308. * @platform Web,Native
  14309. * @includeExample extension/eui/layout/TileOrientationExample.ts
  14310. * @language en_US
  14311. */
  14312. /**
  14313. * TileOrientation 类为 TileLayout 类的 <code>orientation</code> 属性定义可能的值。
  14314. *
  14315. * @version Egret 2.4
  14316. * @version eui 1.0
  14317. * @platform Web,Native
  14318. * @includeExample extension/eui/layout/TileOrientationExample.ts
  14319. * @language zh_CN
  14320. */
  14321. class TileOrientation {
  14322. /**
  14323. * Arranges elements row by row.
  14324. *
  14325. * @version Egret 2.4
  14326. * @version eui 1.0
  14327. * @platform Web,Native
  14328. * @language en_US
  14329. */
  14330. /**
  14331. * 逐行排列元素。
  14332. *
  14333. * @version Egret 2.4
  14334. * @version eui 1.0
  14335. * @platform Web,Native
  14336. * @language zh_CN
  14337. */
  14338. static ROWS: string;
  14339. /**
  14340. * Arranges elements column by column.
  14341. *
  14342. * @version Egret 2.4
  14343. * @version eui 1.0
  14344. * @platform Web,Native
  14345. * @language en_US
  14346. */
  14347. /**
  14348. * 逐列排列元素。
  14349. *
  14350. * @version Egret 2.4
  14351. * @version eui 1.0
  14352. * @platform Web,Native
  14353. * @language zh_CN
  14354. */
  14355. static COLUMNS: string;
  14356. }
  14357. }
  14358. declare namespace eui {
  14359. /**
  14360. * The VerticalLayout class arranges the layout elements in a vertical sequence,
  14361. * top to bottom, with optional gaps between the elements and optional padding
  14362. * around the sequence of elements.
  14363. *
  14364. * @version Egret 2.4
  14365. * @version eui 1.0
  14366. * @platform Web,Native
  14367. * @includeExample extension/eui/layout/VerticalLayoutExample.ts
  14368. * @language en_US
  14369. */
  14370. /**
  14371. * VerticalLayout 类按垂直顺序从上向下排列布局元素,在元素和围绕元素顺序的可选填充之间带有可选间隙。
  14372. *
  14373. * @version Egret 2.4
  14374. * @version eui 1.0
  14375. * @platform Web,Native
  14376. * @includeExample extension/eui/layout/VerticalLayoutExample.ts
  14377. * @language zh_CN
  14378. */
  14379. class VerticalLayout extends LinearLayoutBase {
  14380. /**
  14381. * @inheritDoc
  14382. *
  14383. * @version Egret 2.4
  14384. * @version eui 1.0
  14385. * @platform Web,Native
  14386. */
  14387. protected measureReal(): void;
  14388. /**
  14389. * @inheritDoc
  14390. *
  14391. * @version Egret 2.4
  14392. * @version eui 1.0
  14393. * @platform Web,Native
  14394. */
  14395. protected measureVirtual(): void;
  14396. /**
  14397. * @inheritDoc
  14398. *
  14399. * @version Egret 2.4
  14400. * @version eui 1.0
  14401. * @platform Web,Native
  14402. */
  14403. protected updateDisplayListReal(width: number, height: number): void;
  14404. /**
  14405. * @inheritDoc
  14406. *
  14407. * @version Egret 2.4
  14408. * @version eui 1.0
  14409. * @platform Web,Native
  14410. */
  14411. protected updateDisplayListVirtual(width: number, height: number): void;
  14412. /**
  14413. * @inheritDoc
  14414. *
  14415. * @version Egret 2.4
  14416. * @version eui 1.0
  14417. * @platform Web,Native
  14418. */
  14419. protected getStartPosition(index: number): number;
  14420. /**
  14421. * @inheritDoc
  14422. *
  14423. * @version Egret 2.4
  14424. * @version eui 1.0
  14425. * @platform Web,Native
  14426. */
  14427. protected getElementSize(index: number): number;
  14428. /**
  14429. * @inheritDoc
  14430. *
  14431. * @version Egret 2.4
  14432. * @version eui 1.0
  14433. * @platform Web,Native
  14434. */
  14435. protected getElementTotalSize(): number;
  14436. /**
  14437. * @inheritDoc
  14438. *
  14439. * @version Egret 2.4
  14440. * @version eui 1.0
  14441. * @platform Web,Native
  14442. */
  14443. elementAdded(index: number): void;
  14444. /**
  14445. * @inheritDoc
  14446. *
  14447. * @version Egret 2.4
  14448. * @version eui 1.0
  14449. * @platform Web,Native
  14450. */
  14451. protected getIndexInView(): boolean;
  14452. }
  14453. }
  14454. declare namespace eui {
  14455. /**
  14456. * An <code>ICollectionView</code> is a view onto a collection of data.
  14457. * @version Egret 2.4
  14458. * @version eui 1.0
  14459. * @platform Web,Native
  14460. * @language en_US
  14461. */
  14462. /**
  14463. *
  14464. * <code>ICollection</code>是一个列表的集合类数据源对象的查看接口。
  14465. * @version Egret 2.4
  14466. * @version eui 1.0
  14467. * @platform Web,Native
  14468. * @language zh_CN
  14469. */
  14470. interface ICollection extends egret.IEventDispatcher {
  14471. /**
  14472. * The number of items in this view.
  14473. * 0 means no items, while -1 means that the length is unknown.
  14474. * @readOnly
  14475. * @version Egret 2.4
  14476. * @version eui 1.0
  14477. * @platform Web,Native
  14478. * @language en_US
  14479. */
  14480. /**
  14481. * 此集合中的项目数。0 表示不包含项目。
  14482. * @readOnly
  14483. * @version Egret 2.4
  14484. * @version eui 1.0
  14485. * @platform Web,Native
  14486. * @language zh_CN
  14487. */
  14488. length: number;
  14489. /**
  14490. * Gets the item at the specified index.
  14491. * @param index The index in the list from which to retrieve the item.
  14492. * @return The item at that index, or <code>null</code> if there is none.
  14493. * @version Egret 2.4
  14494. * @version eui 1.0
  14495. * @platform Web,Native
  14496. * @language en_US
  14497. */
  14498. /**
  14499. * 获取指定索引处的项目。
  14500. * @param index 要得到的项的指定位置。
  14501. * @return 在索引位置的项,如果没有该项则返回null。
  14502. * @version Egret 2.4
  14503. * @version eui 1.0
  14504. * @platform Web,Native
  14505. * @language zh_CN
  14506. */
  14507. getItemAt(index: number): any;
  14508. /**
  14509. * Returns the index of the item if it is in the list。-1 otherwise.
  14510. * @param item The item to find.
  14511. * @return The index of the item, or -1 if the item is not in the list.
  14512. * @version Egret 2.4
  14513. * @version eui 1.0
  14514. * @platform Web,Native
  14515. * @language en_US
  14516. */
  14517. /**
  14518. * 如果项目位于列表中,返回该项目的索引。否则返回-1。
  14519. * @param item 要查找的项。
  14520. * @return 项的索引,如果该项没有在列表中将返回-1.
  14521. * @version Egret 2.4
  14522. * @version eui 1.0
  14523. * @platform Web,Native
  14524. * @language zh_CN
  14525. */
  14526. getItemIndex(item: any): number;
  14527. }
  14528. }
  14529. declare namespace eui {
  14530. /**
  14531. * The HScrollBar (horizontal scrollbar) control lets you control
  14532. * the portion of data that is displayed when there is too much data
  14533. * to fit horizontally in a display area.
  14534. *
  14535. * <p>Although you can use the HScrollBar control as a stand-alone control,
  14536. * you usually combine it as part of another group of components to
  14537. * provide scrolling functionality.</p>
  14538. *
  14539. * @includeExample extension/eui/components/HScrollBarExample.ts
  14540. * @version Egret 2.4
  14541. * @version eui 1.0
  14542. * @platform Web,Native
  14543. * @language en_US
  14544. */
  14545. /**
  14546. * HScrollBar(水平 ScrollBar)控件可以在因数据太多而不能在显示区域中以水平方向完全显示时控制显示的数据部分。
  14547. * <p>虽然 HScrollBar 控件可以单独使用,但通常将它与其他组件一起使用来提供滚动功能。</p>
  14548. *
  14549. * @includeExample extension/eui/components/HScrollBarExample.ts
  14550. * @version Egret 2.4
  14551. * @version eui 1.0
  14552. * @platform Web,Native
  14553. * @language zh_CN
  14554. */
  14555. class HScrollBar extends ScrollBarBase {
  14556. /**
  14557. * @inheritDoc
  14558. *
  14559. * @version Egret 2.4
  14560. * @version eui 1.0
  14561. * @platform Web,Native
  14562. */
  14563. protected updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
  14564. /**
  14565. * @inheritDoc
  14566. *
  14567. * @version Egret 2.4
  14568. * @version eui 1.0
  14569. * @platform Web,Native
  14570. */
  14571. protected onPropertyChanged(event: eui.PropertyEvent): void;
  14572. }
  14573. }
  14574. declare namespace eui.sys {
  14575. /**
  14576. * @private
  14577. */
  14578. const enum AddPosition {
  14579. /**
  14580. * @private
  14581. * 添加父级容器的底层
  14582. */
  14583. FIRST = 0,
  14584. /**
  14585. * @private
  14586. * 添加在父级容器的顶层
  14587. */
  14588. LAST = 1,
  14589. /**
  14590. * @private
  14591. * 添加在相对对象之前
  14592. */
  14593. BEFORE = 2,
  14594. /**
  14595. * @private
  14596. * 添加在相对对象之后
  14597. */
  14598. AFTER = 3,
  14599. }
  14600. }
  14601. declare namespace eui {
  14602. /**
  14603. * The operation of adding a state to view.
  14604. * @version Egret 2.4
  14605. * @version eui 1.0
  14606. * @platform Web,Native
  14607. * @language en_US
  14608. */
  14609. /**
  14610. * 视图添加状态显示元素操作
  14611. * @version Egret 2.4
  14612. * @version eui 1.0
  14613. * @platform Web,Native
  14614. * @language zh_CN
  14615. */
  14616. class AddItems implements IOverride {
  14617. /**
  14618. * Constructor.
  14619. * @version Egret 2.4
  14620. * @version eui 1.0
  14621. * @platform Web,Native
  14622. * @language en_US
  14623. */
  14624. /**
  14625. * 创建一个AddItems实例
  14626. * @version Egret 2.4
  14627. * @version eui 1.0
  14628. * @platform Web,Native
  14629. * @language zh_CN
  14630. */
  14631. constructor(target: string, propertyName: string, position: number, relativeTo: string);
  14632. /**
  14633. * The name of the property that is being added.
  14634. * @version Egret 2.4
  14635. * @version eui 1.0
  14636. * @platform Web,Native
  14637. * @language en_US
  14638. */
  14639. /**
  14640. * 要添加到的属性
  14641. * @version Egret 2.4
  14642. * @version eui 1.0
  14643. * @platform Web,Native
  14644. * @language zh_CN
  14645. */
  14646. propertyName: string;
  14647. /**
  14648. * The position to be added. Valid values: "first","last","before","after"
  14649. * @version Egret 2.4
  14650. * @version eui 1.0
  14651. * @platform Web,Native
  14652. * @language en_US
  14653. */
  14654. /**
  14655. * 添加的位置,有效值为: "first","last","before","after"
  14656. * @version Egret 2.4
  14657. * @version eui 1.0
  14658. * @platform Web,Native
  14659. * @language zh_CN
  14660. */
  14661. position: number;
  14662. /**
  14663. * an instance name of relative visual element.
  14664. * @version Egret 2.4
  14665. * @version eui 1.0
  14666. * @platform Web,Native
  14667. * @language en_US
  14668. */
  14669. /**
  14670. * 相对的显示元素的实例名
  14671. * @version Egret 2.4
  14672. * @version eui 1.0
  14673. * @platform Web,Native
  14674. * @language zh_CN
  14675. */
  14676. relativeTo: string;
  14677. /**
  14678. * The target instance name.
  14679. * @version Egret 2.4
  14680. * @version eui 1.0
  14681. * @platform Web,Native
  14682. * @language en_US
  14683. */
  14684. /**
  14685. * 目标实例名
  14686. * @version Egret 2.4
  14687. * @version eui 1.0
  14688. * @platform Web,Native
  14689. * @language zh_CN
  14690. */
  14691. target: string;
  14692. /**
  14693. * @inheritDoc
  14694. *
  14695. * @version Egret 2.4
  14696. * @version eui 1.0
  14697. * @platform Web,Native
  14698. */
  14699. apply(host: any, parent: egret.DisplayObjectContainer): void;
  14700. /**
  14701. * @inheritDoc
  14702. *
  14703. * @version Egret 2.4
  14704. * @version eui 1.0
  14705. * @platform Web,Native
  14706. */
  14707. remove(host: any, parent: egret.DisplayObjectContainer): void;
  14708. }
  14709. }
  14710. declare namespace eui {
  14711. /**
  14712. * The IOverride interface is used for view state overrides.
  14713. * All entries in the State class <code>overrides</code>
  14714. * property array must implement this interface.
  14715. *
  14716. * @version Egret 2.4
  14717. * @version eui 1.0
  14718. * @platform Web,Native
  14719. * @language en_US
  14720. */
  14721. /**
  14722. * IOverride 接口定义视图状态的覆盖操作。State 类 overrides 属性数组中的所有条目均必须实现此接口。
  14723. * @version Egret 2.4
  14724. * @version eui 1.0
  14725. * @platform Web,Native
  14726. * @language zh_CN
  14727. */
  14728. interface IOverride {
  14729. /**
  14730. * Applies the override. Retains the original value, so that it can
  14731. * restore the value later in the <code>remove()</code> method.<p/>
  14732. *
  14733. * This method is called automatically when the state is entered.
  14734. * It should not be called directly.
  14735. *
  14736. * @param host A component that contains view states.
  14737. * @param parent The parent that a sub element be added.
  14738. * @version Egret 2.4
  14739. * @version eui 1.0
  14740. * @platform Web,Native
  14741. * @language en_US
  14742. */
  14743. /**
  14744. * 应用覆盖。将保留原始值,以便以后可以在 remove() 方法中恢复该值。<p/>
  14745. *
  14746. * 该方法是当进入状态的时候自动调用的,请不要直接调用此方法。
  14747. * @param host 含有视图状态的组件。
  14748. * @param parent 子项添加到的父级容器。
  14749. * @version Egret 2.4
  14750. * @version eui 1.0
  14751. * @platform Web,Native
  14752. * @language zh_CN
  14753. */
  14754. apply(host: any, parent: egret.DisplayObjectContainer): void;
  14755. /**
  14756. * Removes the override. The value remembered in the <code>apply()</code>
  14757. * method is restored. </p>
  14758. *
  14759. * This method is called automatically when the state is entered.
  14760. * It should not be called directly.
  14761. * @param host A component that contains view states.
  14762. * @param parent The parent that a sub element be added.
  14763. * @version Egret 2.4
  14764. * @version eui 1.0
  14765. * @platform Web,Native
  14766. * @language en_US
  14767. */
  14768. /**
  14769. * 删除覆盖。在 apply() 方法中记住的值将被恢复。
  14770. * @param host 含有视图状态的组件。
  14771. * @param parent 子项添加到的父级容器。
  14772. * @version Egret 2.4
  14773. * @version eui 1.0
  14774. * @platform Web,Native
  14775. * @language zh_CN
  14776. */
  14777. remove(host: any, parent: egret.DisplayObjectContainer): void;
  14778. }
  14779. }
  14780. declare namespace eui {
  14781. /**
  14782. * The SetProperty class specifies a property value that is in effect only
  14783. * during the parent view state.
  14784. * You use this class in the <code>overrides</code> property of the State class.
  14785. *
  14786. * @version Egret 2.4
  14787. * @version eui 1.0
  14788. * @platform Web,Native
  14789. * @language en_US
  14790. */
  14791. /**
  14792. * SetProperty 类指定只在父视图状态期间有效的属性值。可以在 State 类的 overrides 属性中使用该类。
  14793. *
  14794. * @version Egret 2.4
  14795. * @version eui 1.0
  14796. * @platform Web,Native
  14797. * @language zh_CN
  14798. */
  14799. class SetProperty implements IOverride {
  14800. /**
  14801. * Constructor.
  14802. *
  14803. * @param target The object whose property is being set.
  14804. * By default, EUI uses the immediate parent of the State object.
  14805. * @param name The property to set.
  14806. * @param value The value of the property in the view state.
  14807. *
  14808. * @version Egret 2.4
  14809. * @version eui 1.0
  14810. * @platform Web,Native
  14811. * @language en_US
  14812. */
  14813. /**
  14814. * 创建一个SetProperty实例。
  14815. *
  14816. * @param target 要设置其属性的对象。默认情况下,EUI 使用 State 对象的直接父级。
  14817. * @param name 要设置的属性。
  14818. * @param value 视图状态中的属性值。
  14819. *
  14820. * @version Egret 2.4
  14821. * @version eui 1.0
  14822. * @platform Web,Native
  14823. * @language zh_CN
  14824. */
  14825. constructor(target: string, name: string, value: any);
  14826. /**
  14827. * he name of the property to change.
  14828. * You must set this property, either in
  14829. * the SetProperty constructor or by setting
  14830. * the property value directly.
  14831. *
  14832. * @version Egret 2.4
  14833. * @version eui 1.0
  14834. * @platform Web,Native
  14835. * @language en_US
  14836. */
  14837. /**
  14838. * 要更改的属性的名称。
  14839. * 这个属性必须设置,在 SetProperty 构造函数中设置或通过直接设置该属性值设置。
  14840. *
  14841. * @version Egret 2.4
  14842. * @version eui 1.0
  14843. * @platform Web,Native
  14844. * @language zh_CN
  14845. */
  14846. name: string;
  14847. /**
  14848. * The object containing the property to be changed.
  14849. * If the property value is <code>null</code>, EUI uses the
  14850. * immediate parent of the State object.
  14851. *
  14852. * @version Egret 2.4
  14853. * @version eui 1.0
  14854. * @platform Web,Native
  14855. * @language en_US
  14856. */
  14857. /**
  14858. * 包含要更改的属性的对象。如果属性值为 null,则 EUI 将使用 State 对象的直接父级。
  14859. *
  14860. * @version Egret 2.4
  14861. * @version eui 1.0
  14862. * @platform Web,Native
  14863. * @language zh_CN
  14864. */
  14865. target: string;
  14866. /**
  14867. * The new value for the property.
  14868. *
  14869. * @default undefined
  14870. *
  14871. * @version Egret 2.4
  14872. * @version eui 1.0
  14873. * @platform Web,Native
  14874. * @language en_US
  14875. */
  14876. /**
  14877. * 属性的新值。
  14878. *
  14879. * @default undefined
  14880. *
  14881. * @version Egret 2.4
  14882. * @version eui 1.0
  14883. * @platform Web,Native
  14884. * @language zh_CN
  14885. */
  14886. value: any;
  14887. /**
  14888. * @private
  14889. * 旧的属性值
  14890. */
  14891. private oldValue;
  14892. /**
  14893. * @inheritDoc
  14894. *
  14895. * @version Egret 2.4
  14896. * @version eui 1.0
  14897. * @platform Web,Native
  14898. */
  14899. apply(host: Skin, parent: egret.DisplayObjectContainer): void;
  14900. /**
  14901. * @inheritDoc
  14902. *
  14903. * @version Egret 2.4
  14904. * @version eui 1.0
  14905. * @platform Web,Native
  14906. */
  14907. remove(host: Skin, parent: egret.DisplayObjectContainer): void;
  14908. /**
  14909. * @private
  14910. * 设置属性值
  14911. */
  14912. private setPropertyValue(obj, name, value, valueForType);
  14913. /**
  14914. * @private
  14915. * 转成Boolean值
  14916. */
  14917. private toBoolean(value);
  14918. }
  14919. }
  14920. declare namespace eui {
  14921. /**
  14922. * The SetProperty class specifies a property value that is in effect only
  14923. * during the parent view state.
  14924. * You use this class in the <code>overrides</code> property of the State class.
  14925. *
  14926. * @version Egret 2.4
  14927. * @version eui 1.0
  14928. * @platform Web,Native
  14929. * @language en_US
  14930. */
  14931. /**
  14932. * SetProperty 类指定只在父视图状态期间有效的属性值。可以在 State 类的 overrides 属性中使用该类。
  14933. *
  14934. * @version Egret 2.4
  14935. * @version eui 1.0
  14936. * @platform Web,Native
  14937. * @language zh_CN
  14938. */
  14939. class SetStateProperty implements IOverride {
  14940. /**
  14941. * Constructor.
  14942. *
  14943. * @param target The object whose property is being set.
  14944. * By default, EUI uses the immediate parent of the State object.
  14945. * @param name The property to set.
  14946. * @param value The value of the property in the view state.
  14947. *
  14948. * @version Egret 2.4
  14949. * @version eui 1.0
  14950. * @platform Web,Native
  14951. * @language en_US
  14952. */
  14953. /**
  14954. * 创建一个SetProperty实例。
  14955. *
  14956. * @param target 要设置其属性的对象。默认情况下,EUI 使用 State 对象的直接父级。
  14957. * @param name 要设置的属性。
  14958. * @param value 视图状态中的属性值。
  14959. *
  14960. * @version Egret 2.4
  14961. * @version eui 1.0
  14962. * @platform Web,Native
  14963. * @language zh_CN
  14964. */
  14965. constructor(host: any, templates: any[], chainIndex: number[], target: any, prop: string);
  14966. /**
  14967. * 皮肤对象
  14968. * @private
  14969. */
  14970. private host;
  14971. /**
  14972. * @private
  14973. * 绑定的模板列表
  14974. */
  14975. templates: any[];
  14976. /**
  14977. * @private
  14978. * chainIndex是一个索引列表,每个索引指向templates中的一个值,该值是代表属性链。
  14979. */
  14980. chainIndex: number[];
  14981. /**
  14982. * 要绑定的对象
  14983. * @private
  14984. */
  14985. private target;
  14986. /**
  14987. * 要绑定对象的属性
  14988. * @private
  14989. */
  14990. private prop;
  14991. /**
  14992. * 上一次的数据
  14993. * @private
  14994. */
  14995. private oldValue;
  14996. /**
  14997. * @inheritDoc
  14998. *
  14999. * @version Egret 3.0
  15000. * @version eui 1.0
  15001. * @platform Web,Native
  15002. */
  15003. apply(host: Skin, parent: egret.DisplayObjectContainer): void;
  15004. /**
  15005. * @inheritDoc
  15006. *
  15007. * @version Egret 3.0
  15008. * @version eui 1.0
  15009. * @platform Web,Native
  15010. */
  15011. remove(host: Skin, parent: egret.DisplayObjectContainer): void;
  15012. /**
  15013. * @private
  15014. * 设置属性值
  15015. */
  15016. private setPropertyValue(obj, name, value, valueForType);
  15017. /**
  15018. * @private
  15019. * 转成Boolean值
  15020. */
  15021. private toBoolean(value);
  15022. }
  15023. }
  15024. declare namespace eui.sys {
  15025. /**
  15026. * @private
  15027. */
  15028. class MatrixUtil {
  15029. /**
  15030. * @private
  15031. */
  15032. static fitBounds(width: number, height: number, matrix: egret.Matrix, explicitWidth: number, explicitHeight: number, preferredWidth: number, preferredHeight: number, minWidth: number, minHeight: number, maxWidth: number, maxHeight: number): egret.Point;
  15033. }
  15034. }