fake_autocomplete_suggestion.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef IOS_SHOWCASE_OMNIBOX_POPUP_FAKE_AUTOCOMPLETE_SUGGESTION_H_
  5. #define IOS_SHOWCASE_OMNIBOX_POPUP_FAKE_AUTOCOMPLETE_SUGGESTION_H_
  6. #import <UIKit/UIKit.h>
  7. #import "ios/chrome/browser/ui/omnibox/popup/autocomplete_suggestion.h"
  8. @protocol OmniboxIcon;
  9. // Fake class implementing AutocompleteSuggestion for Showcase.
  10. @interface FakeAutocompleteSuggestion : NSObject <AutocompleteSuggestion>
  11. @property(nonatomic) BOOL supportsDeletion;
  12. @property(nonatomic) BOOL hasAnswer;
  13. @property(nonatomic) BOOL isURL;
  14. @property(nonatomic) BOOL isAppendable;
  15. @property(nonatomic) BOOL isTabMatch;
  16. @property(nonatomic) NSAttributedString* text;
  17. @property(nonatomic) NSAttributedString* detailText;
  18. @property(nonatomic) NSInteger numberOfLines;
  19. @property(nonatomic) UIImage* suggestionTypeIcon;
  20. @property(nonatomic) id<OmniboxIcon> icon;
  21. @property(nonatomic) id<OmniboxPedal, OmniboxIcon> pedal;
  22. @property(nonatomic) BOOL isTailSuggestion;
  23. @property(nonatomic, readonly) NSString* commonPrefix;
  24. @property(nonatomic) NSAttributedString* omniboxPreviewText;
  25. @property(nonatomic) UIImage* matchTypeIcon;
  26. @property(nonatomic, getter=isMatchTypeSearch) BOOL matchTypeSearch;
  27. @property(nonatomic) CrURL* destinationUrl;
  28. // Simple suggestion with text.
  29. + (instancetype)simpleSuggestion;
  30. // Suggestion with detail text.
  31. + (instancetype)suggestionWithDetail;
  32. // Suggestion with text long enough to clip on iPhone.
  33. + (instancetype)clippingSuggestion;
  34. // Suggestion that can be appended.
  35. + (instancetype)appendableSuggestion;
  36. // Suggestion that will switch to open tab.
  37. + (instancetype)otherTabSuggestion;
  38. // Suggestion that can be deleted.
  39. + (instancetype)deletableSuggestion;
  40. // Suggestion with answer for weather.
  41. + (instancetype)weatherSuggestion;
  42. // Suggestion with answer for stock price.
  43. + (instancetype)stockSuggestion;
  44. // Suggestion with answer for definition.
  45. + (instancetype)definitionSuggestion;
  46. // Suggestion with answer for sunrise time.
  47. + (instancetype)sunriseSuggestion;
  48. // Suggestion with answer for knowledge.
  49. + (instancetype)knowledgeSuggestion;
  50. // Suggestion with answer for sports.
  51. + (instancetype)sportsSuggestion;
  52. // Suggestion with answer for "when is" (When is <some event>).
  53. + (instancetype)whenIsSuggestion;
  54. // Suggestion with answer for currency.
  55. + (instancetype)currencySuggestion;
  56. // Suggestion with answer for translate.
  57. + (instancetype)translateSuggestion;
  58. // Suggestion for calculator.
  59. + (instancetype)calculatorSuggestion;
  60. // Suggestion for a rich entity (entity with image).
  61. + (instancetype)richEntitySuggestion;
  62. @end
  63. #endif // IOS_SHOWCASE_OMNIBOX_POPUP_FAKE_AUTOCOMPLETE_SUGGESTION_H_