googlecustomsearch.pp 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031
  1. {$IFNDEF FPC_DOTTEDUNITS}
  2. unit googlecustomsearch;
  3. {$ENDIF FPC_DOTTEDUNITS}
  4. {$MODE objfpc}
  5. {$H+}
  6. interface
  7. {$IFDEF FPC_DOTTEDUNITS}
  8. uses System.SysUtils, System.Classes, GoogleApi.Service, FpWeb.Rest.Base, GoogleApi.Base;
  9. {$ELSE FPC_DOTTEDUNITS}
  10. uses sysutils, classes, googleservice, restbase, googlebase;
  11. {$ENDIF FPC_DOTTEDUNITS}
  12. type
  13. //Top-level schema types
  14. TContext = Class;
  15. TPromotion = Class;
  16. TQuery = Class;
  17. TResult = Class;
  18. TSearch = Class;
  19. TContextArray = Array of TContext;
  20. TPromotionArray = Array of TPromotion;
  21. TQueryArray = Array of TQuery;
  22. TResultArray = Array of TResult;
  23. TSearchArray = Array of TSearch;
  24. //Anonymous types, using auto-generated names
  25. TContextTypefacetsItemItem = Class;
  26. TPromotionTypebodyLinesItem = Class;
  27. TPromotionTypeimage = Class;
  28. TResultTypeimage = Class;
  29. TResultTypelabelsItem = Class;
  30. TResultTypepagemap = Class;
  31. TSearchTypequeries = Class;
  32. TSearchTypesearchInformation = Class;
  33. TSearchTypespelling = Class;
  34. TSearchTypeurl = Class;
  35. TContextTypefacetsItemArray = Array of TContextTypefacetsItemItem;
  36. TContextTypefacetsArray = Array of TContextTypefacetsItemArray;
  37. TPromotionTypebodyLinesArray = Array of TPromotionTypebodyLinesItem;
  38. TResultTypelabelsArray = Array of TResultTypelabelsItem;
  39. TSearchTypeitemsArray = Array of TResult;
  40. TSearchTypepromotionsArray = Array of TPromotion;
  41. { --------------------------------------------------------------------
  42. TContextTypefacetsItemItem
  43. --------------------------------------------------------------------}
  44. TContextTypefacetsItemItem = Class(TGoogleBaseObject)
  45. Private
  46. Fanchor : String;
  47. F_label : String;
  48. Flabel_with_op : String;
  49. Protected
  50. Class Function ExportPropertyName(Const AName : String) : string; override;
  51. //Property setters
  52. Procedure Setanchor(AIndex : Integer; const AValue : String); virtual;
  53. Procedure Set_label(AIndex : Integer; const AValue : String); virtual;
  54. Procedure Setlabel_with_op(AIndex : Integer; const AValue : String); virtual;
  55. Public
  56. Published
  57. Property anchor : String Index 0 Read Fanchor Write Setanchor;
  58. Property _label : String Index 8 Read F_label Write Set_label;
  59. Property label_with_op : String Index 16 Read Flabel_with_op Write Setlabel_with_op;
  60. end;
  61. TContextTypefacetsItemItemClass = Class of TContextTypefacetsItemItem;
  62. { --------------------------------------------------------------------
  63. TContext
  64. --------------------------------------------------------------------}
  65. TContext = Class(TGoogleBaseObject)
  66. Private
  67. Ffacets : TContextTypefacetsArray;
  68. Ftitle : String;
  69. Protected
  70. //Property setters
  71. Procedure Setfacets(AIndex : Integer; const AValue : TContextTypefacetsArray); virtual;
  72. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  73. //2.6.4. bug workaround
  74. {$IFDEF VER2_6}
  75. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  76. {$ENDIF VER2_6}
  77. Public
  78. Published
  79. Property facets : TContextTypefacetsArray Index 0 Read Ffacets Write Setfacets;
  80. Property title : String Index 8 Read Ftitle Write Settitle;
  81. end;
  82. TContextClass = Class of TContext;
  83. { --------------------------------------------------------------------
  84. TPromotionTypebodyLinesItem
  85. --------------------------------------------------------------------}
  86. TPromotionTypebodyLinesItem = Class(TGoogleBaseObject)
  87. Private
  88. FhtmlTitle : String;
  89. Flink : String;
  90. Ftitle : String;
  91. Furl : String;
  92. Protected
  93. //Property setters
  94. Procedure SethtmlTitle(AIndex : Integer; const AValue : String); virtual;
  95. Procedure Setlink(AIndex : Integer; const AValue : String); virtual;
  96. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  97. Procedure Seturl(AIndex : Integer; const AValue : String); virtual;
  98. Public
  99. Published
  100. Property htmlTitle : String Index 0 Read FhtmlTitle Write SethtmlTitle;
  101. Property link : String Index 8 Read Flink Write Setlink;
  102. Property title : String Index 16 Read Ftitle Write Settitle;
  103. Property url : String Index 24 Read Furl Write Seturl;
  104. end;
  105. TPromotionTypebodyLinesItemClass = Class of TPromotionTypebodyLinesItem;
  106. { --------------------------------------------------------------------
  107. TPromotionTypeimage
  108. --------------------------------------------------------------------}
  109. TPromotionTypeimage = Class(TGoogleBaseObject)
  110. Private
  111. Fheight : integer;
  112. Fsource : String;
  113. Fwidth : integer;
  114. Protected
  115. //Property setters
  116. Procedure Setheight(AIndex : Integer; const AValue : integer); virtual;
  117. Procedure Setsource(AIndex : Integer; const AValue : String); virtual;
  118. Procedure Setwidth(AIndex : Integer; const AValue : integer); virtual;
  119. Public
  120. Published
  121. Property height : integer Index 0 Read Fheight Write Setheight;
  122. Property source : String Index 8 Read Fsource Write Setsource;
  123. Property width : integer Index 16 Read Fwidth Write Setwidth;
  124. end;
  125. TPromotionTypeimageClass = Class of TPromotionTypeimage;
  126. { --------------------------------------------------------------------
  127. TPromotion
  128. --------------------------------------------------------------------}
  129. TPromotion = Class(TGoogleBaseObject)
  130. Private
  131. FbodyLines : TPromotionTypebodyLinesArray;
  132. FdisplayLink : String;
  133. FhtmlTitle : String;
  134. Fimage : TPromotionTypeimage;
  135. Flink : String;
  136. Ftitle : String;
  137. Protected
  138. //Property setters
  139. Procedure SetbodyLines(AIndex : Integer; const AValue : TPromotionTypebodyLinesArray); virtual;
  140. Procedure SetdisplayLink(AIndex : Integer; const AValue : String); virtual;
  141. Procedure SethtmlTitle(AIndex : Integer; const AValue : String); virtual;
  142. Procedure Setimage(AIndex : Integer; const AValue : TPromotionTypeimage); virtual;
  143. Procedure Setlink(AIndex : Integer; const AValue : String); virtual;
  144. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  145. //2.6.4. bug workaround
  146. {$IFDEF VER2_6}
  147. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  148. {$ENDIF VER2_6}
  149. Public
  150. Published
  151. Property bodyLines : TPromotionTypebodyLinesArray Index 0 Read FbodyLines Write SetbodyLines;
  152. Property displayLink : String Index 8 Read FdisplayLink Write SetdisplayLink;
  153. Property htmlTitle : String Index 16 Read FhtmlTitle Write SethtmlTitle;
  154. Property image : TPromotionTypeimage Index 24 Read Fimage Write Setimage;
  155. Property link : String Index 32 Read Flink Write Setlink;
  156. Property title : String Index 40 Read Ftitle Write Settitle;
  157. end;
  158. TPromotionClass = Class of TPromotion;
  159. { --------------------------------------------------------------------
  160. TQuery
  161. --------------------------------------------------------------------}
  162. TQuery = Class(TGoogleBaseObject)
  163. Private
  164. Fcount : integer;
  165. Fcr : String;
  166. Fcref : String;
  167. Fcx : String;
  168. FdateRestrict : String;
  169. FdisableCnTwTranslation : String;
  170. FexactTerms : String;
  171. FexcludeTerms : String;
  172. FfileType : String;
  173. Ffilter : String;
  174. Fgl : String;
  175. FgoogleHost : String;
  176. FhighRange : String;
  177. Fhl : String;
  178. Fhq : String;
  179. FimgColorType : String;
  180. FimgDominantColor : String;
  181. FimgSize : String;
  182. FimgType : String;
  183. FinputEncoding : String;
  184. Flanguage : String;
  185. FlinkSite : String;
  186. FlowRange : String;
  187. ForTerms : String;
  188. FoutputEncoding : String;
  189. FrelatedSite : String;
  190. Frights : String;
  191. Fsafe : String;
  192. FsearchTerms : String;
  193. FsearchType : String;
  194. FsiteSearch : String;
  195. FsiteSearchFilter : String;
  196. Fsort : String;
  197. FstartIndex : integer;
  198. FstartPage : integer;
  199. Ftitle : String;
  200. FtotalResults : String;
  201. Protected
  202. //Property setters
  203. Procedure Setcount(AIndex : Integer; const AValue : integer); virtual;
  204. Procedure Setcr(AIndex : Integer; const AValue : String); virtual;
  205. Procedure Setcref(AIndex : Integer; const AValue : String); virtual;
  206. Procedure Setcx(AIndex : Integer; const AValue : String); virtual;
  207. Procedure SetdateRestrict(AIndex : Integer; const AValue : String); virtual;
  208. Procedure SetdisableCnTwTranslation(AIndex : Integer; const AValue : String); virtual;
  209. Procedure SetexactTerms(AIndex : Integer; const AValue : String); virtual;
  210. Procedure SetexcludeTerms(AIndex : Integer; const AValue : String); virtual;
  211. Procedure SetfileType(AIndex : Integer; const AValue : String); virtual;
  212. Procedure Setfilter(AIndex : Integer; const AValue : String); virtual;
  213. Procedure Setgl(AIndex : Integer; const AValue : String); virtual;
  214. Procedure SetgoogleHost(AIndex : Integer; const AValue : String); virtual;
  215. Procedure SethighRange(AIndex : Integer; const AValue : String); virtual;
  216. Procedure Sethl(AIndex : Integer; const AValue : String); virtual;
  217. Procedure Sethq(AIndex : Integer; const AValue : String); virtual;
  218. Procedure SetimgColorType(AIndex : Integer; const AValue : String); virtual;
  219. Procedure SetimgDominantColor(AIndex : Integer; const AValue : String); virtual;
  220. Procedure SetimgSize(AIndex : Integer; const AValue : String); virtual;
  221. Procedure SetimgType(AIndex : Integer; const AValue : String); virtual;
  222. Procedure SetinputEncoding(AIndex : Integer; const AValue : String); virtual;
  223. Procedure Setlanguage(AIndex : Integer; const AValue : String); virtual;
  224. Procedure SetlinkSite(AIndex : Integer; const AValue : String); virtual;
  225. Procedure SetlowRange(AIndex : Integer; const AValue : String); virtual;
  226. Procedure SetorTerms(AIndex : Integer; const AValue : String); virtual;
  227. Procedure SetoutputEncoding(AIndex : Integer; const AValue : String); virtual;
  228. Procedure SetrelatedSite(AIndex : Integer; const AValue : String); virtual;
  229. Procedure Setrights(AIndex : Integer; const AValue : String); virtual;
  230. Procedure Setsafe(AIndex : Integer; const AValue : String); virtual;
  231. Procedure SetsearchTerms(AIndex : Integer; const AValue : String); virtual;
  232. Procedure SetsearchType(AIndex : Integer; const AValue : String); virtual;
  233. Procedure SetsiteSearch(AIndex : Integer; const AValue : String); virtual;
  234. Procedure SetsiteSearchFilter(AIndex : Integer; const AValue : String); virtual;
  235. Procedure Setsort(AIndex : Integer; const AValue : String); virtual;
  236. Procedure SetstartIndex(AIndex : Integer; const AValue : integer); virtual;
  237. Procedure SetstartPage(AIndex : Integer; const AValue : integer); virtual;
  238. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  239. Procedure SettotalResults(AIndex : Integer; const AValue : String); virtual;
  240. Public
  241. Published
  242. Property count : integer Index 0 Read Fcount Write Setcount;
  243. Property cr : String Index 8 Read Fcr Write Setcr;
  244. Property cref : String Index 16 Read Fcref Write Setcref;
  245. Property cx : String Index 24 Read Fcx Write Setcx;
  246. Property dateRestrict : String Index 32 Read FdateRestrict Write SetdateRestrict;
  247. Property disableCnTwTranslation : String Index 40 Read FdisableCnTwTranslation Write SetdisableCnTwTranslation;
  248. Property exactTerms : String Index 48 Read FexactTerms Write SetexactTerms;
  249. Property excludeTerms : String Index 56 Read FexcludeTerms Write SetexcludeTerms;
  250. Property fileType : String Index 64 Read FfileType Write SetfileType;
  251. Property filter : String Index 72 Read Ffilter Write Setfilter;
  252. Property gl : String Index 80 Read Fgl Write Setgl;
  253. Property googleHost : String Index 88 Read FgoogleHost Write SetgoogleHost;
  254. Property highRange : String Index 96 Read FhighRange Write SethighRange;
  255. Property hl : String Index 104 Read Fhl Write Sethl;
  256. Property hq : String Index 112 Read Fhq Write Sethq;
  257. Property imgColorType : String Index 120 Read FimgColorType Write SetimgColorType;
  258. Property imgDominantColor : String Index 128 Read FimgDominantColor Write SetimgDominantColor;
  259. Property imgSize : String Index 136 Read FimgSize Write SetimgSize;
  260. Property imgType : String Index 144 Read FimgType Write SetimgType;
  261. Property inputEncoding : String Index 152 Read FinputEncoding Write SetinputEncoding;
  262. Property language : String Index 160 Read Flanguage Write Setlanguage;
  263. Property linkSite : String Index 168 Read FlinkSite Write SetlinkSite;
  264. Property lowRange : String Index 176 Read FlowRange Write SetlowRange;
  265. Property orTerms : String Index 184 Read ForTerms Write SetorTerms;
  266. Property outputEncoding : String Index 192 Read FoutputEncoding Write SetoutputEncoding;
  267. Property relatedSite : String Index 200 Read FrelatedSite Write SetrelatedSite;
  268. Property rights : String Index 208 Read Frights Write Setrights;
  269. Property safe : String Index 216 Read Fsafe Write Setsafe;
  270. Property searchTerms : String Index 224 Read FsearchTerms Write SetsearchTerms;
  271. Property searchType : String Index 232 Read FsearchType Write SetsearchType;
  272. Property siteSearch : String Index 240 Read FsiteSearch Write SetsiteSearch;
  273. Property siteSearchFilter : String Index 248 Read FsiteSearchFilter Write SetsiteSearchFilter;
  274. Property sort : String Index 256 Read Fsort Write Setsort;
  275. Property startIndex : integer Index 264 Read FstartIndex Write SetstartIndex;
  276. Property startPage : integer Index 272 Read FstartPage Write SetstartPage;
  277. Property title : String Index 280 Read Ftitle Write Settitle;
  278. Property totalResults : String Index 288 Read FtotalResults Write SettotalResults;
  279. end;
  280. TQueryClass = Class of TQuery;
  281. { --------------------------------------------------------------------
  282. TResultTypeimage
  283. --------------------------------------------------------------------}
  284. TResultTypeimage = Class(TGoogleBaseObject)
  285. Private
  286. FbyteSize : integer;
  287. FcontextLink : String;
  288. Fheight : integer;
  289. FthumbnailHeight : integer;
  290. FthumbnailLink : String;
  291. FthumbnailWidth : integer;
  292. Fwidth : integer;
  293. Protected
  294. //Property setters
  295. Procedure SetbyteSize(AIndex : Integer; const AValue : integer); virtual;
  296. Procedure SetcontextLink(AIndex : Integer; const AValue : String); virtual;
  297. Procedure Setheight(AIndex : Integer; const AValue : integer); virtual;
  298. Procedure SetthumbnailHeight(AIndex : Integer; const AValue : integer); virtual;
  299. Procedure SetthumbnailLink(AIndex : Integer; const AValue : String); virtual;
  300. Procedure SetthumbnailWidth(AIndex : Integer; const AValue : integer); virtual;
  301. Procedure Setwidth(AIndex : Integer; const AValue : integer); virtual;
  302. Public
  303. Published
  304. Property byteSize : integer Index 0 Read FbyteSize Write SetbyteSize;
  305. Property contextLink : String Index 8 Read FcontextLink Write SetcontextLink;
  306. Property height : integer Index 16 Read Fheight Write Setheight;
  307. Property thumbnailHeight : integer Index 24 Read FthumbnailHeight Write SetthumbnailHeight;
  308. Property thumbnailLink : String Index 32 Read FthumbnailLink Write SetthumbnailLink;
  309. Property thumbnailWidth : integer Index 40 Read FthumbnailWidth Write SetthumbnailWidth;
  310. Property width : integer Index 48 Read Fwidth Write Setwidth;
  311. end;
  312. TResultTypeimageClass = Class of TResultTypeimage;
  313. { --------------------------------------------------------------------
  314. TResultTypelabelsItem
  315. --------------------------------------------------------------------}
  316. TResultTypelabelsItem = Class(TGoogleBaseObject)
  317. Private
  318. FdisplayName : String;
  319. Flabel_with_op : String;
  320. Fname : String;
  321. Protected
  322. //Property setters
  323. Procedure SetdisplayName(AIndex : Integer; const AValue : String); virtual;
  324. Procedure Setlabel_with_op(AIndex : Integer; const AValue : String); virtual;
  325. Procedure Setname(AIndex : Integer; const AValue : String); virtual;
  326. Public
  327. Published
  328. Property displayName : String Index 0 Read FdisplayName Write SetdisplayName;
  329. Property label_with_op : String Index 8 Read Flabel_with_op Write Setlabel_with_op;
  330. Property name : String Index 16 Read Fname Write Setname;
  331. end;
  332. TResultTypelabelsItemClass = Class of TResultTypelabelsItem;
  333. { --------------------------------------------------------------------
  334. TResultTypepagemap
  335. --------------------------------------------------------------------}
  336. TResultTypepagemap = Class(TGoogleBaseObject)
  337. Private
  338. Protected
  339. //Property setters
  340. Public
  341. Class Function AllowAdditionalProperties : Boolean; override;
  342. Published
  343. end;
  344. TResultTypepagemapClass = Class of TResultTypepagemap;
  345. { --------------------------------------------------------------------
  346. TResult
  347. --------------------------------------------------------------------}
  348. TResult = Class(TGoogleBaseObject)
  349. Private
  350. FcacheId : String;
  351. FdisplayLink : String;
  352. FfileFormat : String;
  353. FformattedUrl : String;
  354. FhtmlFormattedUrl : String;
  355. FhtmlSnippet : String;
  356. FhtmlTitle : String;
  357. Fimage : TResultTypeimage;
  358. Fkind : String;
  359. Flabels : TResultTypelabelsArray;
  360. Flink : String;
  361. Fmime : String;
  362. Fpagemap : TResultTypepagemap;
  363. Fsnippet : String;
  364. Ftitle : String;
  365. Protected
  366. //Property setters
  367. Procedure SetcacheId(AIndex : Integer; const AValue : String); virtual;
  368. Procedure SetdisplayLink(AIndex : Integer; const AValue : String); virtual;
  369. Procedure SetfileFormat(AIndex : Integer; const AValue : String); virtual;
  370. Procedure SetformattedUrl(AIndex : Integer; const AValue : String); virtual;
  371. Procedure SethtmlFormattedUrl(AIndex : Integer; const AValue : String); virtual;
  372. Procedure SethtmlSnippet(AIndex : Integer; const AValue : String); virtual;
  373. Procedure SethtmlTitle(AIndex : Integer; const AValue : String); virtual;
  374. Procedure Setimage(AIndex : Integer; const AValue : TResultTypeimage); virtual;
  375. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  376. Procedure Setlabels(AIndex : Integer; const AValue : TResultTypelabelsArray); virtual;
  377. Procedure Setlink(AIndex : Integer; const AValue : String); virtual;
  378. Procedure Setmime(AIndex : Integer; const AValue : String); virtual;
  379. Procedure Setpagemap(AIndex : Integer; const AValue : TResultTypepagemap); virtual;
  380. Procedure Setsnippet(AIndex : Integer; const AValue : String); virtual;
  381. Procedure Settitle(AIndex : Integer; const AValue : String); virtual;
  382. //2.6.4. bug workaround
  383. {$IFDEF VER2_6}
  384. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  385. {$ENDIF VER2_6}
  386. Public
  387. Published
  388. Property cacheId : String Index 0 Read FcacheId Write SetcacheId;
  389. Property displayLink : String Index 8 Read FdisplayLink Write SetdisplayLink;
  390. Property fileFormat : String Index 16 Read FfileFormat Write SetfileFormat;
  391. Property formattedUrl : String Index 24 Read FformattedUrl Write SetformattedUrl;
  392. Property htmlFormattedUrl : String Index 32 Read FhtmlFormattedUrl Write SethtmlFormattedUrl;
  393. Property htmlSnippet : String Index 40 Read FhtmlSnippet Write SethtmlSnippet;
  394. Property htmlTitle : String Index 48 Read FhtmlTitle Write SethtmlTitle;
  395. Property image : TResultTypeimage Index 56 Read Fimage Write Setimage;
  396. Property kind : String Index 64 Read Fkind Write Setkind;
  397. Property labels : TResultTypelabelsArray Index 72 Read Flabels Write Setlabels;
  398. Property link : String Index 80 Read Flink Write Setlink;
  399. Property mime : String Index 88 Read Fmime Write Setmime;
  400. Property pagemap : TResultTypepagemap Index 96 Read Fpagemap Write Setpagemap;
  401. Property snippet : String Index 104 Read Fsnippet Write Setsnippet;
  402. Property title : String Index 112 Read Ftitle Write Settitle;
  403. end;
  404. TResultClass = Class of TResult;
  405. { --------------------------------------------------------------------
  406. TSearchTypequeries
  407. --------------------------------------------------------------------}
  408. TSearchTypequeries = Class(TGoogleBaseObject)
  409. Private
  410. Protected
  411. //Property setters
  412. Public
  413. Class Function AllowAdditionalProperties : Boolean; override;
  414. Published
  415. end;
  416. TSearchTypequeriesClass = Class of TSearchTypequeries;
  417. { --------------------------------------------------------------------
  418. TSearchTypesearchInformation
  419. --------------------------------------------------------------------}
  420. TSearchTypesearchInformation = Class(TGoogleBaseObject)
  421. Private
  422. FformattedSearchTime : String;
  423. FformattedTotalResults : String;
  424. FsearchTime : double;
  425. FtotalResults : String;
  426. Protected
  427. //Property setters
  428. Procedure SetformattedSearchTime(AIndex : Integer; const AValue : String); virtual;
  429. Procedure SetformattedTotalResults(AIndex : Integer; const AValue : String); virtual;
  430. Procedure SetsearchTime(AIndex : Integer; const AValue : double); virtual;
  431. Procedure SettotalResults(AIndex : Integer; const AValue : String); virtual;
  432. Public
  433. Published
  434. Property formattedSearchTime : String Index 0 Read FformattedSearchTime Write SetformattedSearchTime;
  435. Property formattedTotalResults : String Index 8 Read FformattedTotalResults Write SetformattedTotalResults;
  436. Property searchTime : double Index 16 Read FsearchTime Write SetsearchTime;
  437. Property totalResults : String Index 24 Read FtotalResults Write SettotalResults;
  438. end;
  439. TSearchTypesearchInformationClass = Class of TSearchTypesearchInformation;
  440. { --------------------------------------------------------------------
  441. TSearchTypespelling
  442. --------------------------------------------------------------------}
  443. TSearchTypespelling = Class(TGoogleBaseObject)
  444. Private
  445. FcorrectedQuery : String;
  446. FhtmlCorrectedQuery : String;
  447. Protected
  448. //Property setters
  449. Procedure SetcorrectedQuery(AIndex : Integer; const AValue : String); virtual;
  450. Procedure SethtmlCorrectedQuery(AIndex : Integer; const AValue : String); virtual;
  451. Public
  452. Published
  453. Property correctedQuery : String Index 0 Read FcorrectedQuery Write SetcorrectedQuery;
  454. Property htmlCorrectedQuery : String Index 8 Read FhtmlCorrectedQuery Write SethtmlCorrectedQuery;
  455. end;
  456. TSearchTypespellingClass = Class of TSearchTypespelling;
  457. { --------------------------------------------------------------------
  458. TSearchTypeurl
  459. --------------------------------------------------------------------}
  460. TSearchTypeurl = Class(TGoogleBaseObject)
  461. Private
  462. Ftemplate : String;
  463. F_type : String;
  464. Protected
  465. Class Function ExportPropertyName(Const AName : String) : string; override;
  466. //Property setters
  467. Procedure Settemplate(AIndex : Integer; const AValue : String); virtual;
  468. Procedure Set_type(AIndex : Integer; const AValue : String); virtual;
  469. Public
  470. Published
  471. Property template : String Index 0 Read Ftemplate Write Settemplate;
  472. Property _type : String Index 8 Read F_type Write Set_type;
  473. end;
  474. TSearchTypeurlClass = Class of TSearchTypeurl;
  475. { --------------------------------------------------------------------
  476. TSearch
  477. --------------------------------------------------------------------}
  478. TSearch = Class(TGoogleBaseObject)
  479. Private
  480. Fcontext : TContext;
  481. Fitems : TSearchTypeitemsArray;
  482. Fkind : String;
  483. Fpromotions : TSearchTypepromotionsArray;
  484. Fqueries : TSearchTypequeries;
  485. FsearchInformation : TSearchTypesearchInformation;
  486. Fspelling : TSearchTypespelling;
  487. Furl : TSearchTypeurl;
  488. Protected
  489. //Property setters
  490. Procedure Setcontext(AIndex : Integer; const AValue : TContext); virtual;
  491. Procedure Setitems(AIndex : Integer; const AValue : TSearchTypeitemsArray); virtual;
  492. Procedure Setkind(AIndex : Integer; const AValue : String); virtual;
  493. Procedure Setpromotions(AIndex : Integer; const AValue : TSearchTypepromotionsArray); virtual;
  494. Procedure Setqueries(AIndex : Integer; const AValue : TSearchTypequeries); virtual;
  495. Procedure SetsearchInformation(AIndex : Integer; const AValue : TSearchTypesearchInformation); virtual;
  496. Procedure Setspelling(AIndex : Integer; const AValue : TSearchTypespelling); virtual;
  497. Procedure Seturl(AIndex : Integer; const AValue : TSearchTypeurl); virtual;
  498. //2.6.4. bug workaround
  499. {$IFDEF VER2_6}
  500. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  501. {$ENDIF VER2_6}
  502. Public
  503. Published
  504. Property context : TContext Index 0 Read Fcontext Write Setcontext;
  505. Property items : TSearchTypeitemsArray Index 8 Read Fitems Write Setitems;
  506. Property kind : String Index 16 Read Fkind Write Setkind;
  507. Property promotions : TSearchTypepromotionsArray Index 24 Read Fpromotions Write Setpromotions;
  508. Property queries : TSearchTypequeries Index 32 Read Fqueries Write Setqueries;
  509. Property searchInformation : TSearchTypesearchInformation Index 40 Read FsearchInformation Write SetsearchInformation;
  510. Property spelling : TSearchTypespelling Index 48 Read Fspelling Write Setspelling;
  511. Property url : TSearchTypeurl Index 56 Read Furl Write Seturl;
  512. end;
  513. TSearchClass = Class of TSearch;
  514. { --------------------------------------------------------------------
  515. TCseResource
  516. --------------------------------------------------------------------}
  517. //Optional query Options for TCseResource, method List
  518. TCseListOptions = Record
  519. c2coff : String;
  520. cr : String;
  521. cref : String;
  522. cx : String;
  523. dateRestrict : String;
  524. exactTerms : String;
  525. excludeTerms : String;
  526. fileType : String;
  527. filter : String;
  528. gl : String;
  529. googlehost : String;
  530. highRange : String;
  531. hl : String;
  532. hq : String;
  533. imgColorType : String;
  534. imgDominantColor : String;
  535. imgSize : String;
  536. imgType : String;
  537. linkSite : String;
  538. lowRange : String;
  539. lr : String;
  540. num : integer;
  541. orTerms : String;
  542. q : String;
  543. relatedSite : String;
  544. rights : String;
  545. safe : String;
  546. searchType : String;
  547. siteSearch : String;
  548. siteSearchFilter : String;
  549. sort : String;
  550. start : integer;
  551. end;
  552. TCseResource = Class(TGoogleResource)
  553. Public
  554. Class Function ResourceName : String; override;
  555. Class Function DefaultAPI : TGoogleAPIClass; override;
  556. Function List(AQuery : string = '') : TSearch;
  557. Function List(AQuery : TCselistOptions) : TSearch;
  558. end;
  559. { --------------------------------------------------------------------
  560. TCustomsearchAPI
  561. --------------------------------------------------------------------}
  562. TCustomsearchAPI = Class(TGoogleAPI)
  563. Private
  564. FCseInstance : TCseResource;
  565. Function GetCseInstance : TCseResource;virtual;
  566. Public
  567. //Override class functions with API info
  568. Class Function APIName : String; override;
  569. Class Function APIVersion : String; override;
  570. Class Function APIRevision : String; override;
  571. Class Function APIID : String; override;
  572. Class Function APITitle : String; override;
  573. Class Function APIDescription : String; override;
  574. Class Function APIOwnerDomain : String; override;
  575. Class Function APIOwnerName : String; override;
  576. Class Function APIIcon16 : String; override;
  577. Class Function APIIcon32 : String; override;
  578. Class Function APIdocumentationLink : String; override;
  579. Class Function APIrootUrl : string; override;
  580. Class Function APIbasePath : string;override;
  581. Class Function APIbaseURL : String;override;
  582. Class Function APIProtocol : string;override;
  583. Class Function APIservicePath : string;override;
  584. Class Function APIbatchPath : String;override;
  585. Class Function APIAuthScopes : TScopeInfoArray;override;
  586. Class Function APINeedsAuth : Boolean;override;
  587. Class Procedure RegisterAPIResources; override;
  588. //Add create function for resources
  589. Function CreateCseResource(AOwner : TComponent) : TCseResource;virtual;overload;
  590. Function CreateCseResource : TCseResource;virtual;overload;
  591. //Add default on-demand instances for resources
  592. Property CseResource : TCseResource Read GetCseInstance;
  593. end;
  594. implementation
  595. { --------------------------------------------------------------------
  596. TContextTypefacetsItemItem
  597. --------------------------------------------------------------------}
  598. Procedure TContextTypefacetsItemItem.Setanchor(AIndex : Integer; const AValue : String);
  599. begin
  600. If (Fanchor=AValue) then exit;
  601. Fanchor:=AValue;
  602. MarkPropertyChanged(AIndex);
  603. end;
  604. Procedure TContextTypefacetsItemItem.Set_label(AIndex : Integer; const AValue : String);
  605. begin
  606. If (F_label=AValue) then exit;
  607. F_label:=AValue;
  608. MarkPropertyChanged(AIndex);
  609. end;
  610. Procedure TContextTypefacetsItemItem.Setlabel_with_op(AIndex : Integer; const AValue : String);
  611. begin
  612. If (Flabel_with_op=AValue) then exit;
  613. Flabel_with_op:=AValue;
  614. MarkPropertyChanged(AIndex);
  615. end;
  616. Class Function TContextTypefacetsItemItem.ExportPropertyName(Const AName : String) :String;
  617. begin
  618. Case AName of
  619. '_label' : Result:='label';
  620. else
  621. Result:=Inherited ExportPropertyName(AName);
  622. end;
  623. end;
  624. { --------------------------------------------------------------------
  625. TContext
  626. --------------------------------------------------------------------}
  627. Procedure TContext.Setfacets(AIndex : Integer; const AValue : TContextTypefacetsArray);
  628. begin
  629. If (Ffacets=AValue) then exit;
  630. Ffacets:=AValue;
  631. MarkPropertyChanged(AIndex);
  632. end;
  633. Procedure TContext.Settitle(AIndex : Integer; const AValue : String);
  634. begin
  635. If (Ftitle=AValue) then exit;
  636. Ftitle:=AValue;
  637. MarkPropertyChanged(AIndex);
  638. end;
  639. //2.6.4. bug workaround
  640. {$IFDEF VER2_6}
  641. Procedure TContext.SetArrayLength(Const AName : String; ALength : Longint);
  642. begin
  643. Case AName of
  644. 'facets' : SetLength(Ffacets,ALength);
  645. else
  646. Inherited SetArrayLength(AName,ALength);
  647. end;
  648. end;
  649. {$ENDIF VER2_6}
  650. { --------------------------------------------------------------------
  651. TPromotionTypebodyLinesItem
  652. --------------------------------------------------------------------}
  653. Procedure TPromotionTypebodyLinesItem.SethtmlTitle(AIndex : Integer; const AValue : String);
  654. begin
  655. If (FhtmlTitle=AValue) then exit;
  656. FhtmlTitle:=AValue;
  657. MarkPropertyChanged(AIndex);
  658. end;
  659. Procedure TPromotionTypebodyLinesItem.Setlink(AIndex : Integer; const AValue : String);
  660. begin
  661. If (Flink=AValue) then exit;
  662. Flink:=AValue;
  663. MarkPropertyChanged(AIndex);
  664. end;
  665. Procedure TPromotionTypebodyLinesItem.Settitle(AIndex : Integer; const AValue : String);
  666. begin
  667. If (Ftitle=AValue) then exit;
  668. Ftitle:=AValue;
  669. MarkPropertyChanged(AIndex);
  670. end;
  671. Procedure TPromotionTypebodyLinesItem.Seturl(AIndex : Integer; const AValue : String);
  672. begin
  673. If (Furl=AValue) then exit;
  674. Furl:=AValue;
  675. MarkPropertyChanged(AIndex);
  676. end;
  677. { --------------------------------------------------------------------
  678. TPromotionTypeimage
  679. --------------------------------------------------------------------}
  680. Procedure TPromotionTypeimage.Setheight(AIndex : Integer; const AValue : integer);
  681. begin
  682. If (Fheight=AValue) then exit;
  683. Fheight:=AValue;
  684. MarkPropertyChanged(AIndex);
  685. end;
  686. Procedure TPromotionTypeimage.Setsource(AIndex : Integer; const AValue : String);
  687. begin
  688. If (Fsource=AValue) then exit;
  689. Fsource:=AValue;
  690. MarkPropertyChanged(AIndex);
  691. end;
  692. Procedure TPromotionTypeimage.Setwidth(AIndex : Integer; const AValue : integer);
  693. begin
  694. If (Fwidth=AValue) then exit;
  695. Fwidth:=AValue;
  696. MarkPropertyChanged(AIndex);
  697. end;
  698. { --------------------------------------------------------------------
  699. TPromotion
  700. --------------------------------------------------------------------}
  701. Procedure TPromotion.SetbodyLines(AIndex : Integer; const AValue : TPromotionTypebodyLinesArray);
  702. begin
  703. If (FbodyLines=AValue) then exit;
  704. FbodyLines:=AValue;
  705. MarkPropertyChanged(AIndex);
  706. end;
  707. Procedure TPromotion.SetdisplayLink(AIndex : Integer; const AValue : String);
  708. begin
  709. If (FdisplayLink=AValue) then exit;
  710. FdisplayLink:=AValue;
  711. MarkPropertyChanged(AIndex);
  712. end;
  713. Procedure TPromotion.SethtmlTitle(AIndex : Integer; const AValue : String);
  714. begin
  715. If (FhtmlTitle=AValue) then exit;
  716. FhtmlTitle:=AValue;
  717. MarkPropertyChanged(AIndex);
  718. end;
  719. Procedure TPromotion.Setimage(AIndex : Integer; const AValue : TPromotionTypeimage);
  720. begin
  721. If (Fimage=AValue) then exit;
  722. Fimage:=AValue;
  723. MarkPropertyChanged(AIndex);
  724. end;
  725. Procedure TPromotion.Setlink(AIndex : Integer; const AValue : String);
  726. begin
  727. If (Flink=AValue) then exit;
  728. Flink:=AValue;
  729. MarkPropertyChanged(AIndex);
  730. end;
  731. Procedure TPromotion.Settitle(AIndex : Integer; const AValue : String);
  732. begin
  733. If (Ftitle=AValue) then exit;
  734. Ftitle:=AValue;
  735. MarkPropertyChanged(AIndex);
  736. end;
  737. //2.6.4. bug workaround
  738. {$IFDEF VER2_6}
  739. Procedure TPromotion.SetArrayLength(Const AName : String; ALength : Longint);
  740. begin
  741. Case AName of
  742. 'bodylines' : SetLength(FbodyLines,ALength);
  743. else
  744. Inherited SetArrayLength(AName,ALength);
  745. end;
  746. end;
  747. {$ENDIF VER2_6}
  748. { --------------------------------------------------------------------
  749. TQuery
  750. --------------------------------------------------------------------}
  751. Procedure TQuery.Setcount(AIndex : Integer; const AValue : integer);
  752. begin
  753. If (Fcount=AValue) then exit;
  754. Fcount:=AValue;
  755. MarkPropertyChanged(AIndex);
  756. end;
  757. Procedure TQuery.Setcr(AIndex : Integer; const AValue : String);
  758. begin
  759. If (Fcr=AValue) then exit;
  760. Fcr:=AValue;
  761. MarkPropertyChanged(AIndex);
  762. end;
  763. Procedure TQuery.Setcref(AIndex : Integer; const AValue : String);
  764. begin
  765. If (Fcref=AValue) then exit;
  766. Fcref:=AValue;
  767. MarkPropertyChanged(AIndex);
  768. end;
  769. Procedure TQuery.Setcx(AIndex : Integer; const AValue : String);
  770. begin
  771. If (Fcx=AValue) then exit;
  772. Fcx:=AValue;
  773. MarkPropertyChanged(AIndex);
  774. end;
  775. Procedure TQuery.SetdateRestrict(AIndex : Integer; const AValue : String);
  776. begin
  777. If (FdateRestrict=AValue) then exit;
  778. FdateRestrict:=AValue;
  779. MarkPropertyChanged(AIndex);
  780. end;
  781. Procedure TQuery.SetdisableCnTwTranslation(AIndex : Integer; const AValue : String);
  782. begin
  783. If (FdisableCnTwTranslation=AValue) then exit;
  784. FdisableCnTwTranslation:=AValue;
  785. MarkPropertyChanged(AIndex);
  786. end;
  787. Procedure TQuery.SetexactTerms(AIndex : Integer; const AValue : String);
  788. begin
  789. If (FexactTerms=AValue) then exit;
  790. FexactTerms:=AValue;
  791. MarkPropertyChanged(AIndex);
  792. end;
  793. Procedure TQuery.SetexcludeTerms(AIndex : Integer; const AValue : String);
  794. begin
  795. If (FexcludeTerms=AValue) then exit;
  796. FexcludeTerms:=AValue;
  797. MarkPropertyChanged(AIndex);
  798. end;
  799. Procedure TQuery.SetfileType(AIndex : Integer; const AValue : String);
  800. begin
  801. If (FfileType=AValue) then exit;
  802. FfileType:=AValue;
  803. MarkPropertyChanged(AIndex);
  804. end;
  805. Procedure TQuery.Setfilter(AIndex : Integer; const AValue : String);
  806. begin
  807. If (Ffilter=AValue) then exit;
  808. Ffilter:=AValue;
  809. MarkPropertyChanged(AIndex);
  810. end;
  811. Procedure TQuery.Setgl(AIndex : Integer; const AValue : String);
  812. begin
  813. If (Fgl=AValue) then exit;
  814. Fgl:=AValue;
  815. MarkPropertyChanged(AIndex);
  816. end;
  817. Procedure TQuery.SetgoogleHost(AIndex : Integer; const AValue : String);
  818. begin
  819. If (FgoogleHost=AValue) then exit;
  820. FgoogleHost:=AValue;
  821. MarkPropertyChanged(AIndex);
  822. end;
  823. Procedure TQuery.SethighRange(AIndex : Integer; const AValue : String);
  824. begin
  825. If (FhighRange=AValue) then exit;
  826. FhighRange:=AValue;
  827. MarkPropertyChanged(AIndex);
  828. end;
  829. Procedure TQuery.Sethl(AIndex : Integer; const AValue : String);
  830. begin
  831. If (Fhl=AValue) then exit;
  832. Fhl:=AValue;
  833. MarkPropertyChanged(AIndex);
  834. end;
  835. Procedure TQuery.Sethq(AIndex : Integer; const AValue : String);
  836. begin
  837. If (Fhq=AValue) then exit;
  838. Fhq:=AValue;
  839. MarkPropertyChanged(AIndex);
  840. end;
  841. Procedure TQuery.SetimgColorType(AIndex : Integer; const AValue : String);
  842. begin
  843. If (FimgColorType=AValue) then exit;
  844. FimgColorType:=AValue;
  845. MarkPropertyChanged(AIndex);
  846. end;
  847. Procedure TQuery.SetimgDominantColor(AIndex : Integer; const AValue : String);
  848. begin
  849. If (FimgDominantColor=AValue) then exit;
  850. FimgDominantColor:=AValue;
  851. MarkPropertyChanged(AIndex);
  852. end;
  853. Procedure TQuery.SetimgSize(AIndex : Integer; const AValue : String);
  854. begin
  855. If (FimgSize=AValue) then exit;
  856. FimgSize:=AValue;
  857. MarkPropertyChanged(AIndex);
  858. end;
  859. Procedure TQuery.SetimgType(AIndex : Integer; const AValue : String);
  860. begin
  861. If (FimgType=AValue) then exit;
  862. FimgType:=AValue;
  863. MarkPropertyChanged(AIndex);
  864. end;
  865. Procedure TQuery.SetinputEncoding(AIndex : Integer; const AValue : String);
  866. begin
  867. If (FinputEncoding=AValue) then exit;
  868. FinputEncoding:=AValue;
  869. MarkPropertyChanged(AIndex);
  870. end;
  871. Procedure TQuery.Setlanguage(AIndex : Integer; const AValue : String);
  872. begin
  873. If (Flanguage=AValue) then exit;
  874. Flanguage:=AValue;
  875. MarkPropertyChanged(AIndex);
  876. end;
  877. Procedure TQuery.SetlinkSite(AIndex : Integer; const AValue : String);
  878. begin
  879. If (FlinkSite=AValue) then exit;
  880. FlinkSite:=AValue;
  881. MarkPropertyChanged(AIndex);
  882. end;
  883. Procedure TQuery.SetlowRange(AIndex : Integer; const AValue : String);
  884. begin
  885. If (FlowRange=AValue) then exit;
  886. FlowRange:=AValue;
  887. MarkPropertyChanged(AIndex);
  888. end;
  889. Procedure TQuery.SetorTerms(AIndex : Integer; const AValue : String);
  890. begin
  891. If (ForTerms=AValue) then exit;
  892. ForTerms:=AValue;
  893. MarkPropertyChanged(AIndex);
  894. end;
  895. Procedure TQuery.SetoutputEncoding(AIndex : Integer; const AValue : String);
  896. begin
  897. If (FoutputEncoding=AValue) then exit;
  898. FoutputEncoding:=AValue;
  899. MarkPropertyChanged(AIndex);
  900. end;
  901. Procedure TQuery.SetrelatedSite(AIndex : Integer; const AValue : String);
  902. begin
  903. If (FrelatedSite=AValue) then exit;
  904. FrelatedSite:=AValue;
  905. MarkPropertyChanged(AIndex);
  906. end;
  907. Procedure TQuery.Setrights(AIndex : Integer; const AValue : String);
  908. begin
  909. If (Frights=AValue) then exit;
  910. Frights:=AValue;
  911. MarkPropertyChanged(AIndex);
  912. end;
  913. Procedure TQuery.Setsafe(AIndex : Integer; const AValue : String);
  914. begin
  915. If (Fsafe=AValue) then exit;
  916. Fsafe:=AValue;
  917. MarkPropertyChanged(AIndex);
  918. end;
  919. Procedure TQuery.SetsearchTerms(AIndex : Integer; const AValue : String);
  920. begin
  921. If (FsearchTerms=AValue) then exit;
  922. FsearchTerms:=AValue;
  923. MarkPropertyChanged(AIndex);
  924. end;
  925. Procedure TQuery.SetsearchType(AIndex : Integer; const AValue : String);
  926. begin
  927. If (FsearchType=AValue) then exit;
  928. FsearchType:=AValue;
  929. MarkPropertyChanged(AIndex);
  930. end;
  931. Procedure TQuery.SetsiteSearch(AIndex : Integer; const AValue : String);
  932. begin
  933. If (FsiteSearch=AValue) then exit;
  934. FsiteSearch:=AValue;
  935. MarkPropertyChanged(AIndex);
  936. end;
  937. Procedure TQuery.SetsiteSearchFilter(AIndex : Integer; const AValue : String);
  938. begin
  939. If (FsiteSearchFilter=AValue) then exit;
  940. FsiteSearchFilter:=AValue;
  941. MarkPropertyChanged(AIndex);
  942. end;
  943. Procedure TQuery.Setsort(AIndex : Integer; const AValue : String);
  944. begin
  945. If (Fsort=AValue) then exit;
  946. Fsort:=AValue;
  947. MarkPropertyChanged(AIndex);
  948. end;
  949. Procedure TQuery.SetstartIndex(AIndex : Integer; const AValue : integer);
  950. begin
  951. If (FstartIndex=AValue) then exit;
  952. FstartIndex:=AValue;
  953. MarkPropertyChanged(AIndex);
  954. end;
  955. Procedure TQuery.SetstartPage(AIndex : Integer; const AValue : integer);
  956. begin
  957. If (FstartPage=AValue) then exit;
  958. FstartPage:=AValue;
  959. MarkPropertyChanged(AIndex);
  960. end;
  961. Procedure TQuery.Settitle(AIndex : Integer; const AValue : String);
  962. begin
  963. If (Ftitle=AValue) then exit;
  964. Ftitle:=AValue;
  965. MarkPropertyChanged(AIndex);
  966. end;
  967. Procedure TQuery.SettotalResults(AIndex : Integer; const AValue : String);
  968. begin
  969. If (FtotalResults=AValue) then exit;
  970. FtotalResults:=AValue;
  971. MarkPropertyChanged(AIndex);
  972. end;
  973. { --------------------------------------------------------------------
  974. TResultTypeimage
  975. --------------------------------------------------------------------}
  976. Procedure TResultTypeimage.SetbyteSize(AIndex : Integer; const AValue : integer);
  977. begin
  978. If (FbyteSize=AValue) then exit;
  979. FbyteSize:=AValue;
  980. MarkPropertyChanged(AIndex);
  981. end;
  982. Procedure TResultTypeimage.SetcontextLink(AIndex : Integer; const AValue : String);
  983. begin
  984. If (FcontextLink=AValue) then exit;
  985. FcontextLink:=AValue;
  986. MarkPropertyChanged(AIndex);
  987. end;
  988. Procedure TResultTypeimage.Setheight(AIndex : Integer; const AValue : integer);
  989. begin
  990. If (Fheight=AValue) then exit;
  991. Fheight:=AValue;
  992. MarkPropertyChanged(AIndex);
  993. end;
  994. Procedure TResultTypeimage.SetthumbnailHeight(AIndex : Integer; const AValue : integer);
  995. begin
  996. If (FthumbnailHeight=AValue) then exit;
  997. FthumbnailHeight:=AValue;
  998. MarkPropertyChanged(AIndex);
  999. end;
  1000. Procedure TResultTypeimage.SetthumbnailLink(AIndex : Integer; const AValue : String);
  1001. begin
  1002. If (FthumbnailLink=AValue) then exit;
  1003. FthumbnailLink:=AValue;
  1004. MarkPropertyChanged(AIndex);
  1005. end;
  1006. Procedure TResultTypeimage.SetthumbnailWidth(AIndex : Integer; const AValue : integer);
  1007. begin
  1008. If (FthumbnailWidth=AValue) then exit;
  1009. FthumbnailWidth:=AValue;
  1010. MarkPropertyChanged(AIndex);
  1011. end;
  1012. Procedure TResultTypeimage.Setwidth(AIndex : Integer; const AValue : integer);
  1013. begin
  1014. If (Fwidth=AValue) then exit;
  1015. Fwidth:=AValue;
  1016. MarkPropertyChanged(AIndex);
  1017. end;
  1018. { --------------------------------------------------------------------
  1019. TResultTypelabelsItem
  1020. --------------------------------------------------------------------}
  1021. Procedure TResultTypelabelsItem.SetdisplayName(AIndex : Integer; const AValue : String);
  1022. begin
  1023. If (FdisplayName=AValue) then exit;
  1024. FdisplayName:=AValue;
  1025. MarkPropertyChanged(AIndex);
  1026. end;
  1027. Procedure TResultTypelabelsItem.Setlabel_with_op(AIndex : Integer; const AValue : String);
  1028. begin
  1029. If (Flabel_with_op=AValue) then exit;
  1030. Flabel_with_op:=AValue;
  1031. MarkPropertyChanged(AIndex);
  1032. end;
  1033. Procedure TResultTypelabelsItem.Setname(AIndex : Integer; const AValue : String);
  1034. begin
  1035. If (Fname=AValue) then exit;
  1036. Fname:=AValue;
  1037. MarkPropertyChanged(AIndex);
  1038. end;
  1039. { --------------------------------------------------------------------
  1040. TResultTypepagemap
  1041. --------------------------------------------------------------------}
  1042. Class Function TResultTypepagemap.AllowAdditionalProperties : Boolean;
  1043. begin
  1044. Result:=True;
  1045. end;
  1046. { --------------------------------------------------------------------
  1047. TResult
  1048. --------------------------------------------------------------------}
  1049. Procedure TResult.SetcacheId(AIndex : Integer; const AValue : String);
  1050. begin
  1051. If (FcacheId=AValue) then exit;
  1052. FcacheId:=AValue;
  1053. MarkPropertyChanged(AIndex);
  1054. end;
  1055. Procedure TResult.SetdisplayLink(AIndex : Integer; const AValue : String);
  1056. begin
  1057. If (FdisplayLink=AValue) then exit;
  1058. FdisplayLink:=AValue;
  1059. MarkPropertyChanged(AIndex);
  1060. end;
  1061. Procedure TResult.SetfileFormat(AIndex : Integer; const AValue : String);
  1062. begin
  1063. If (FfileFormat=AValue) then exit;
  1064. FfileFormat:=AValue;
  1065. MarkPropertyChanged(AIndex);
  1066. end;
  1067. Procedure TResult.SetformattedUrl(AIndex : Integer; const AValue : String);
  1068. begin
  1069. If (FformattedUrl=AValue) then exit;
  1070. FformattedUrl:=AValue;
  1071. MarkPropertyChanged(AIndex);
  1072. end;
  1073. Procedure TResult.SethtmlFormattedUrl(AIndex : Integer; const AValue : String);
  1074. begin
  1075. If (FhtmlFormattedUrl=AValue) then exit;
  1076. FhtmlFormattedUrl:=AValue;
  1077. MarkPropertyChanged(AIndex);
  1078. end;
  1079. Procedure TResult.SethtmlSnippet(AIndex : Integer; const AValue : String);
  1080. begin
  1081. If (FhtmlSnippet=AValue) then exit;
  1082. FhtmlSnippet:=AValue;
  1083. MarkPropertyChanged(AIndex);
  1084. end;
  1085. Procedure TResult.SethtmlTitle(AIndex : Integer; const AValue : String);
  1086. begin
  1087. If (FhtmlTitle=AValue) then exit;
  1088. FhtmlTitle:=AValue;
  1089. MarkPropertyChanged(AIndex);
  1090. end;
  1091. Procedure TResult.Setimage(AIndex : Integer; const AValue : TResultTypeimage);
  1092. begin
  1093. If (Fimage=AValue) then exit;
  1094. Fimage:=AValue;
  1095. MarkPropertyChanged(AIndex);
  1096. end;
  1097. Procedure TResult.Setkind(AIndex : Integer; const AValue : String);
  1098. begin
  1099. If (Fkind=AValue) then exit;
  1100. Fkind:=AValue;
  1101. MarkPropertyChanged(AIndex);
  1102. end;
  1103. Procedure TResult.Setlabels(AIndex : Integer; const AValue : TResultTypelabelsArray);
  1104. begin
  1105. If (Flabels=AValue) then exit;
  1106. Flabels:=AValue;
  1107. MarkPropertyChanged(AIndex);
  1108. end;
  1109. Procedure TResult.Setlink(AIndex : Integer; const AValue : String);
  1110. begin
  1111. If (Flink=AValue) then exit;
  1112. Flink:=AValue;
  1113. MarkPropertyChanged(AIndex);
  1114. end;
  1115. Procedure TResult.Setmime(AIndex : Integer; const AValue : String);
  1116. begin
  1117. If (Fmime=AValue) then exit;
  1118. Fmime:=AValue;
  1119. MarkPropertyChanged(AIndex);
  1120. end;
  1121. Procedure TResult.Setpagemap(AIndex : Integer; const AValue : TResultTypepagemap);
  1122. begin
  1123. If (Fpagemap=AValue) then exit;
  1124. Fpagemap:=AValue;
  1125. MarkPropertyChanged(AIndex);
  1126. end;
  1127. Procedure TResult.Setsnippet(AIndex : Integer; const AValue : String);
  1128. begin
  1129. If (Fsnippet=AValue) then exit;
  1130. Fsnippet:=AValue;
  1131. MarkPropertyChanged(AIndex);
  1132. end;
  1133. Procedure TResult.Settitle(AIndex : Integer; const AValue : String);
  1134. begin
  1135. If (Ftitle=AValue) then exit;
  1136. Ftitle:=AValue;
  1137. MarkPropertyChanged(AIndex);
  1138. end;
  1139. //2.6.4. bug workaround
  1140. {$IFDEF VER2_6}
  1141. Procedure TResult.SetArrayLength(Const AName : String; ALength : Longint);
  1142. begin
  1143. Case AName of
  1144. 'labels' : SetLength(Flabels,ALength);
  1145. else
  1146. Inherited SetArrayLength(AName,ALength);
  1147. end;
  1148. end;
  1149. {$ENDIF VER2_6}
  1150. { --------------------------------------------------------------------
  1151. TSearchTypequeries
  1152. --------------------------------------------------------------------}
  1153. Class Function TSearchTypequeries.AllowAdditionalProperties : Boolean;
  1154. begin
  1155. Result:=True;
  1156. end;
  1157. { --------------------------------------------------------------------
  1158. TSearchTypesearchInformation
  1159. --------------------------------------------------------------------}
  1160. Procedure TSearchTypesearchInformation.SetformattedSearchTime(AIndex : Integer; const AValue : String);
  1161. begin
  1162. If (FformattedSearchTime=AValue) then exit;
  1163. FformattedSearchTime:=AValue;
  1164. MarkPropertyChanged(AIndex);
  1165. end;
  1166. Procedure TSearchTypesearchInformation.SetformattedTotalResults(AIndex : Integer; const AValue : String);
  1167. begin
  1168. If (FformattedTotalResults=AValue) then exit;
  1169. FformattedTotalResults:=AValue;
  1170. MarkPropertyChanged(AIndex);
  1171. end;
  1172. Procedure TSearchTypesearchInformation.SetsearchTime(AIndex : Integer; const AValue : double);
  1173. begin
  1174. If (FsearchTime=AValue) then exit;
  1175. FsearchTime:=AValue;
  1176. MarkPropertyChanged(AIndex);
  1177. end;
  1178. Procedure TSearchTypesearchInformation.SettotalResults(AIndex : Integer; const AValue : String);
  1179. begin
  1180. If (FtotalResults=AValue) then exit;
  1181. FtotalResults:=AValue;
  1182. MarkPropertyChanged(AIndex);
  1183. end;
  1184. { --------------------------------------------------------------------
  1185. TSearchTypespelling
  1186. --------------------------------------------------------------------}
  1187. Procedure TSearchTypespelling.SetcorrectedQuery(AIndex : Integer; const AValue : String);
  1188. begin
  1189. If (FcorrectedQuery=AValue) then exit;
  1190. FcorrectedQuery:=AValue;
  1191. MarkPropertyChanged(AIndex);
  1192. end;
  1193. Procedure TSearchTypespelling.SethtmlCorrectedQuery(AIndex : Integer; const AValue : String);
  1194. begin
  1195. If (FhtmlCorrectedQuery=AValue) then exit;
  1196. FhtmlCorrectedQuery:=AValue;
  1197. MarkPropertyChanged(AIndex);
  1198. end;
  1199. { --------------------------------------------------------------------
  1200. TSearchTypeurl
  1201. --------------------------------------------------------------------}
  1202. Procedure TSearchTypeurl.Settemplate(AIndex : Integer; const AValue : String);
  1203. begin
  1204. If (Ftemplate=AValue) then exit;
  1205. Ftemplate:=AValue;
  1206. MarkPropertyChanged(AIndex);
  1207. end;
  1208. Procedure TSearchTypeurl.Set_type(AIndex : Integer; const AValue : String);
  1209. begin
  1210. If (F_type=AValue) then exit;
  1211. F_type:=AValue;
  1212. MarkPropertyChanged(AIndex);
  1213. end;
  1214. Class Function TSearchTypeurl.ExportPropertyName(Const AName : String) :String;
  1215. begin
  1216. Case AName of
  1217. '_type' : Result:='type';
  1218. else
  1219. Result:=Inherited ExportPropertyName(AName);
  1220. end;
  1221. end;
  1222. { --------------------------------------------------------------------
  1223. TSearch
  1224. --------------------------------------------------------------------}
  1225. Procedure TSearch.Setcontext(AIndex : Integer; const AValue : TContext);
  1226. begin
  1227. If (Fcontext=AValue) then exit;
  1228. Fcontext:=AValue;
  1229. MarkPropertyChanged(AIndex);
  1230. end;
  1231. Procedure TSearch.Setitems(AIndex : Integer; const AValue : TSearchTypeitemsArray);
  1232. begin
  1233. If (Fitems=AValue) then exit;
  1234. Fitems:=AValue;
  1235. MarkPropertyChanged(AIndex);
  1236. end;
  1237. Procedure TSearch.Setkind(AIndex : Integer; const AValue : String);
  1238. begin
  1239. If (Fkind=AValue) then exit;
  1240. Fkind:=AValue;
  1241. MarkPropertyChanged(AIndex);
  1242. end;
  1243. Procedure TSearch.Setpromotions(AIndex : Integer; const AValue : TSearchTypepromotionsArray);
  1244. begin
  1245. If (Fpromotions=AValue) then exit;
  1246. Fpromotions:=AValue;
  1247. MarkPropertyChanged(AIndex);
  1248. end;
  1249. Procedure TSearch.Setqueries(AIndex : Integer; const AValue : TSearchTypequeries);
  1250. begin
  1251. If (Fqueries=AValue) then exit;
  1252. Fqueries:=AValue;
  1253. MarkPropertyChanged(AIndex);
  1254. end;
  1255. Procedure TSearch.SetsearchInformation(AIndex : Integer; const AValue : TSearchTypesearchInformation);
  1256. begin
  1257. If (FsearchInformation=AValue) then exit;
  1258. FsearchInformation:=AValue;
  1259. MarkPropertyChanged(AIndex);
  1260. end;
  1261. Procedure TSearch.Setspelling(AIndex : Integer; const AValue : TSearchTypespelling);
  1262. begin
  1263. If (Fspelling=AValue) then exit;
  1264. Fspelling:=AValue;
  1265. MarkPropertyChanged(AIndex);
  1266. end;
  1267. Procedure TSearch.Seturl(AIndex : Integer; const AValue : TSearchTypeurl);
  1268. begin
  1269. If (Furl=AValue) then exit;
  1270. Furl:=AValue;
  1271. MarkPropertyChanged(AIndex);
  1272. end;
  1273. //2.6.4. bug workaround
  1274. {$IFDEF VER2_6}
  1275. Procedure TSearch.SetArrayLength(Const AName : String; ALength : Longint);
  1276. begin
  1277. Case AName of
  1278. 'items' : SetLength(Fitems,ALength);
  1279. 'promotions' : SetLength(Fpromotions,ALength);
  1280. else
  1281. Inherited SetArrayLength(AName,ALength);
  1282. end;
  1283. end;
  1284. {$ENDIF VER2_6}
  1285. { --------------------------------------------------------------------
  1286. TCseResource
  1287. --------------------------------------------------------------------}
  1288. Class Function TCseResource.ResourceName : String;
  1289. begin
  1290. Result:='cse';
  1291. end;
  1292. Class Function TCseResource.DefaultAPI : TGoogleAPIClass;
  1293. begin
  1294. Result:=TcustomsearchAPI;
  1295. end;
  1296. Function TCseResource.List(AQuery : string = '') : TSearch;
  1297. Const
  1298. _HTTPMethod = 'GET';
  1299. _Path = 'v1';
  1300. _Methodid = 'search.cse.list';
  1301. begin
  1302. Result:=ServiceCall(_HTTPMethod,_Path,AQuery,Nil,TSearch) as TSearch;
  1303. end;
  1304. Function TCseResource.List(AQuery : TCselistOptions) : TSearch;
  1305. Var
  1306. _Q : String;
  1307. begin
  1308. _Q:='';
  1309. AddToQuery(_Q,'c2coff',AQuery.c2coff);
  1310. AddToQuery(_Q,'cr',AQuery.cr);
  1311. AddToQuery(_Q,'cref',AQuery.cref);
  1312. AddToQuery(_Q,'cx',AQuery.cx);
  1313. AddToQuery(_Q,'dateRestrict',AQuery.dateRestrict);
  1314. AddToQuery(_Q,'exactTerms',AQuery.exactTerms);
  1315. AddToQuery(_Q,'excludeTerms',AQuery.excludeTerms);
  1316. AddToQuery(_Q,'fileType',AQuery.fileType);
  1317. AddToQuery(_Q,'filter',AQuery.filter);
  1318. AddToQuery(_Q,'gl',AQuery.gl);
  1319. AddToQuery(_Q,'googlehost',AQuery.googlehost);
  1320. AddToQuery(_Q,'highRange',AQuery.highRange);
  1321. AddToQuery(_Q,'hl',AQuery.hl);
  1322. AddToQuery(_Q,'hq',AQuery.hq);
  1323. AddToQuery(_Q,'imgColorType',AQuery.imgColorType);
  1324. AddToQuery(_Q,'imgDominantColor',AQuery.imgDominantColor);
  1325. AddToQuery(_Q,'imgSize',AQuery.imgSize);
  1326. AddToQuery(_Q,'imgType',AQuery.imgType);
  1327. AddToQuery(_Q,'linkSite',AQuery.linkSite);
  1328. AddToQuery(_Q,'lowRange',AQuery.lowRange);
  1329. AddToQuery(_Q,'lr',AQuery.lr);
  1330. AddToQuery(_Q,'num',AQuery.num);
  1331. AddToQuery(_Q,'orTerms',AQuery.orTerms);
  1332. AddToQuery(_Q,'q',AQuery.q);
  1333. AddToQuery(_Q,'relatedSite',AQuery.relatedSite);
  1334. AddToQuery(_Q,'rights',AQuery.rights);
  1335. AddToQuery(_Q,'safe',AQuery.safe);
  1336. AddToQuery(_Q,'searchType',AQuery.searchType);
  1337. AddToQuery(_Q,'siteSearch',AQuery.siteSearch);
  1338. AddToQuery(_Q,'siteSearchFilter',AQuery.siteSearchFilter);
  1339. AddToQuery(_Q,'sort',AQuery.sort);
  1340. AddToQuery(_Q,'start',AQuery.start);
  1341. Result:=List(_Q);
  1342. end;
  1343. { --------------------------------------------------------------------
  1344. TCustomsearchAPI
  1345. --------------------------------------------------------------------}
  1346. Class Function TCustomsearchAPI.APIName : String;
  1347. begin
  1348. Result:='customsearch';
  1349. end;
  1350. Class Function TCustomsearchAPI.APIVersion : String;
  1351. begin
  1352. Result:='v1';
  1353. end;
  1354. Class Function TCustomsearchAPI.APIRevision : String;
  1355. begin
  1356. Result:='20160411';
  1357. end;
  1358. Class Function TCustomsearchAPI.APIID : String;
  1359. begin
  1360. Result:='customsearch:v1';
  1361. end;
  1362. Class Function TCustomsearchAPI.APITitle : String;
  1363. begin
  1364. Result:='CustomSearch API';
  1365. end;
  1366. Class Function TCustomsearchAPI.APIDescription : String;
  1367. begin
  1368. Result:='Lets you search over a website or collection of websites';
  1369. end;
  1370. Class Function TCustomsearchAPI.APIOwnerDomain : String;
  1371. begin
  1372. Result:='google.com';
  1373. end;
  1374. Class Function TCustomsearchAPI.APIOwnerName : String;
  1375. begin
  1376. Result:='Google';
  1377. end;
  1378. Class Function TCustomsearchAPI.APIIcon16 : String;
  1379. begin
  1380. Result:='http://www.google.com/images/icons/product/search-16.gif';
  1381. end;
  1382. Class Function TCustomsearchAPI.APIIcon32 : String;
  1383. begin
  1384. Result:='http://www.google.com/images/icons/product/search-32.gif';
  1385. end;
  1386. Class Function TCustomsearchAPI.APIdocumentationLink : String;
  1387. begin
  1388. Result:='https://developers.google.com/custom-search/v1/using_rest';
  1389. end;
  1390. Class Function TCustomsearchAPI.APIrootUrl : string;
  1391. begin
  1392. Result:='https://www.googleapis.com/';
  1393. end;
  1394. Class Function TCustomsearchAPI.APIbasePath : string;
  1395. begin
  1396. Result:='/customsearch/';
  1397. end;
  1398. Class Function TCustomsearchAPI.APIbaseURL : String;
  1399. begin
  1400. Result:='https://www.googleapis.com/customsearch/';
  1401. end;
  1402. Class Function TCustomsearchAPI.APIProtocol : string;
  1403. begin
  1404. Result:='rest';
  1405. end;
  1406. Class Function TCustomsearchAPI.APIservicePath : string;
  1407. begin
  1408. Result:='customsearch/';
  1409. end;
  1410. Class Function TCustomsearchAPI.APIbatchPath : String;
  1411. begin
  1412. Result:='batch';
  1413. end;
  1414. Class Function TCustomsearchAPI.APIAuthScopes : TScopeInfoArray;
  1415. begin
  1416. SetLength(Result,0);
  1417. end;
  1418. Class Function TCustomsearchAPI.APINeedsAuth : Boolean;
  1419. begin
  1420. Result:=False;
  1421. end;
  1422. Class Procedure TCustomsearchAPI.RegisterAPIResources;
  1423. begin
  1424. TContextTypefacetsItemItem.RegisterObject;
  1425. TContext.RegisterObject;
  1426. TPromotionTypebodyLinesItem.RegisterObject;
  1427. TPromotionTypeimage.RegisterObject;
  1428. TPromotion.RegisterObject;
  1429. TQuery.RegisterObject;
  1430. TResultTypeimage.RegisterObject;
  1431. TResultTypelabelsItem.RegisterObject;
  1432. TResultTypepagemap.RegisterObject;
  1433. TResult.RegisterObject;
  1434. TSearchTypequeries.RegisterObject;
  1435. TSearchTypesearchInformation.RegisterObject;
  1436. TSearchTypespelling.RegisterObject;
  1437. TSearchTypeurl.RegisterObject;
  1438. TSearch.RegisterObject;
  1439. end;
  1440. Function TCustomsearchAPI.GetCseInstance : TCseResource;
  1441. begin
  1442. if (FCseInstance=Nil) then
  1443. FCseInstance:=CreateCseResource;
  1444. Result:=FCseInstance;
  1445. end;
  1446. Function TCustomsearchAPI.CreateCseResource : TCseResource;
  1447. begin
  1448. Result:=CreateCseResource(Self);
  1449. end;
  1450. Function TCustomsearchAPI.CreateCseResource(AOwner : TComponent) : TCseResource;
  1451. begin
  1452. Result:=TCseResource.Create(AOwner);
  1453. Result.API:=Self.API;
  1454. end;
  1455. initialization
  1456. TCustomsearchAPI.RegisterAPI;
  1457. end.