Home | History | Annotate | Download | only in public
      1 // Copyright 2014 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 
      5 #ifndef ATHENA_HOME_PUBLIC_HOME_CARD_H_
      6 #define ATHENA_HOME_PUBLIC_HOME_CARD_H_
      7 
      8 #include "athena/athena_export.h"
      9 
     10 namespace app_list {
     11 class SearchProvider;
     12 }
     13 
     14 namespace gfx {
     15 class Rect;
     16 }
     17 
     18 namespace athena {
     19 class AppModelBuilder;
     20 
     21 class ATHENA_EXPORT HomeCard {
     22  public:
     23   enum State {
     24     // HomeCard is not visible.
     25     HIDDEN,
     26 
     27     // HomeCard is visible in the center of the screen as a normal mode.
     28     VISIBLE_CENTERED,
     29 
     30     // HomeCard is visible smaller at the bottom of the screen as a supplemental
     31     // widget.
     32     VISIBLE_BOTTOM,
     33 
     34     // HomeCard is minimized (i.e. a small UI element is displayed on screen
     35     // that the user can interact with to bring up the BOTTOM or CENTERED view).
     36     VISIBLE_MINIMIZED,
     37   };
     38 
     39   // Creates/deletes/gets the singleton object of the HomeCard
     40   // implementation. Takes the ownership of |model_builder|.
     41   static HomeCard* Create(AppModelBuilder* model_builder);
     42   static void Shutdown();
     43   static HomeCard* Get();
     44 
     45   virtual ~HomeCard() {}
     46 
     47   // Updates/gets the current state of the home card.
     48   virtual void SetState(State state) = 0;
     49   virtual State GetState() = 0;
     50 
     51   // Registers a search_provider to the HomeCard. Receiver will take
     52   // the ownership of the specified provider.
     53   virtual void RegisterSearchProvider(
     54       app_list::SearchProvider* search_provider) = 0;
     55 
     56   // Called when the virtual keyboard changed has changed to |bounds|. An empty
     57   // |bounds| indicates that the virtual keyboard is not visible anymore.
     58   virtual void UpdateVirtualKeyboardBounds(
     59       const gfx::Rect& bounds) = 0;
     60 };
     61 
     62 }  // namespace athena
     63 
     64 #endif  // ATHENA_HOME_PUBLIC_HOME_CARD_H_
     65