Home | History | Annotate | Download | only in launcher
      1 // Copyright (c) 2012 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_LAUNCHER_LAUNCHER_TYPES_H_
      6 #define ASH_LAUNCHER_LAUNCHER_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 LauncherID;
     17 
     18 // Height of the Launcher. Hard coded to avoid resizing as items are
     19 // added/removed.
     20 ASH_EXPORT extern const int kLauncherPreferredSize;
     21 
     22 // Max alpha of the launcher background.
     23 ASH_EXPORT extern const int kLauncherBackgroundAlpha;
     24 
     25 // Invalid image resource id used for LauncherItemDetails.
     26 extern const int kInvalidImageResourceID;
     27 
     28 extern const int kInvalidLauncherID;
     29 
     30 // Animation duration for switching black shelf and dock background on and off.
     31 ASH_EXPORT extern const int kTimeToSwitchBackgroundMs;
     32 
     33 // Type the LauncherItem represents.
     34 enum LauncherItemType {
     35   // Represents a running app panel.
     36   TYPE_APP_PANEL,
     37 
     38   // Represents a pinned shortcut to an app.
     39   TYPE_APP_SHORTCUT,
     40 
     41   // Toggles visiblity of the app list.
     42   TYPE_APP_LIST,
     43 
     44   // The browser shortcut button.
     45   TYPE_BROWSER_SHORTCUT,
     46 
     47   // Represents a platform app.
     48   TYPE_PLATFORM_APP,
     49 
     50   // Represents a windowed V1 browser app.
     51   TYPE_WINDOWED_APP,
     52 
     53   // Default value.
     54   TYPE_UNDEFINED,
     55 };
     56 
     57 // Represents the status of pinned or running app launcher items.
     58 enum LauncherItemStatus {
     59   // A closed LauncherItem, i.e. has no live instance.
     60   STATUS_CLOSED,
     61   // A LauncherItem that has live instance.
     62   STATUS_RUNNING,
     63   // An active LauncherItem that has focus.
     64   STATUS_ACTIVE,
     65   // A LauncherItem that needs user's attention.
     66   STATUS_ATTENTION,
     67 };
     68 
     69 struct ASH_EXPORT LauncherItem {
     70   LauncherItem();
     71   ~LauncherItem();
     72 
     73   LauncherItemType type;
     74 
     75   // Image to display in the launcher.
     76   gfx::ImageSkia image;
     77 
     78   // Assigned by the model when the item is added.
     79   LauncherID id;
     80 
     81   // Running status.
     82   LauncherItemStatus status;
     83 };
     84 
     85 typedef std::vector<LauncherItem> LauncherItems;
     86 
     87 // The direction of the focus cycling.
     88 enum CycleDirection {
     89   CYCLE_FORWARD,
     90   CYCLE_BACKWARD
     91 };
     92 
     93 // LauncherItemDetails may be set on Window (by way of
     94 // SetLauncherItemDetailsForWindow) to make the window appear in the shelf. See
     95 // ShelfWindowWatcher for details.
     96 struct ASH_EXPORT LauncherItemDetails {
     97   LauncherItemDetails();
     98   ~LauncherItemDetails();
     99 
    100   LauncherItemType type;
    101 
    102   // Resource id of the image to display on the shelf.
    103   int image_resource_id;
    104 
    105   // Title of the item.
    106   base::string16 title;
    107 };
    108 
    109 }  // namespace ash
    110 
    111 #endif  // ASH_LAUNCHER_LAUNCHER_TYPES_H_
    112