Home | History | Annotate | Download | only in shelf
      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 ASH_SHELF_SHELF_ITEM_TYPES_H_
      6 #define ASH_SHELF_SHELF_ITEM_TYPES_H_
      7 
      8 #include <vector>
      9 
     10 #include "ash/ash_export.h"
     11 #include "base/strings/string16.h"
     12 #include "ui/gfx/image/image_skia.h"
     13 
     14 namespace ash {
     15 
     16 typedef int ShelfID;
     17 
     18 // The type of a shelf item.
     19 enum ShelfItemType {
     20   // Represents a running app panel.
     21   TYPE_APP_PANEL,
     22 
     23   // Represents a pinned shortcut to an app.
     24   TYPE_APP_SHORTCUT,
     25 
     26   // Toggles visiblity of the app list.
     27   TYPE_APP_LIST,
     28 
     29   // The browser shortcut button.
     30   TYPE_BROWSER_SHORTCUT,
     31 
     32   // Represents a platform app.
     33   TYPE_PLATFORM_APP,
     34 
     35   // Represents a windowed V1 browser app.
     36   TYPE_WINDOWED_APP,
     37 
     38   // Represents a dialog.
     39   TYPE_DIALOG,
     40 
     41   // Default value.
     42   TYPE_UNDEFINED,
     43 };
     44 
     45 // Represents the status of applications in the shelf.
     46 enum ShelfItemStatus {
     47   // A closed shelf item, i.e. has no live instance.
     48   STATUS_CLOSED,
     49   // A shelf item that has live instance.
     50   STATUS_RUNNING,
     51   // An active shelf item that has focus.
     52   STATUS_ACTIVE,
     53   // A shelf item that needs user's attention.
     54   STATUS_ATTENTION,
     55 };
     56 
     57 struct ASH_EXPORT ShelfItem {
     58   ShelfItem();
     59   ~ShelfItem();
     60 
     61   ShelfItemType type;
     62 
     63   // Image to display in the shelf.
     64   gfx::ImageSkia image;
     65 
     66   // Assigned by the model when the item is added.
     67   ShelfID id;
     68 
     69   // Running status.
     70   ShelfItemStatus status;
     71 };
     72 
     73 typedef std::vector<ShelfItem> ShelfItems;
     74 
     75 // ShelfItemDetails may be set on Window (by way of
     76 // SetShelfItemDetailsForWindow) to make the window appear in the shelf. See
     77 // ShelfWindowWatcher for details.
     78 struct ASH_EXPORT ShelfItemDetails {
     79   ShelfItemDetails();
     80   ~ShelfItemDetails();
     81 
     82   ShelfItemType type;
     83 
     84   // Resource id of the image to display on the shelf.
     85   int image_resource_id;
     86 
     87   // Title of the item.
     88   base::string16 title;
     89 };
     90 
     91 }  // namespace ash
     92 
     93 #endif  // ASH_SHELF_SHELF_ITEM_TYPES_H_
     94