// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Sync protocol datatype extension for the app list (aka app launcher).

// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.

syntax = "proto2";

option java_multiple_files = true;
option java_package = "org.chromium.components.sync.protocol";

option optimize_for = LITE_RUNTIME;

package sync_pb;

// Properties of app list objects.
message AppListSpecifics {
  // Unique identifier for the item:
  // * TYPE_FOLDER: Folder id (generated)
  // * TYPE_APP: App Id
  optional string item_id = 1;

  // What type of item this is.
  enum AppListItemType {
    // An app, whether a web app, Android app, etc.
    //
    // For bookmark apps (URL shortcuts), additional information such as their
    // URLs are kept in the AppSpecifics.bookmark_app_foobar fields.
    TYPE_APP = 1;
    // A request to remove any matching default installed apps.
    TYPE_REMOVE_DEFAULT_APP = 2;
    // A folder containing entries whose |parent_id| matches |item_id|.
    TYPE_FOLDER = 3;
    // Obsolete type, intended for URL shortcuts, that was never implemented.
    TYPE_OBSOLETE_URL = 4;
    // A "page break" item (Indicate creation of a new page in app list).
    TYPE_PAGE_BREAK = 5;
  }
  optional AppListItemType item_type = 2;

  // Item name (FOLDER).
  optional string item_name = 3;

  // Id of the parent (folder) item.
  optional string parent_id = 4;

  // Marked OBSOLETE because this is unused for the app list.
  // Which page this item will appear on in the app list.
  optional string OBSOLETE_page_ordinal = 5 [deprecated = true];

  // Where on a page this item will appear.
  optional string item_ordinal = 6;

  // Where on a shelf this item will appear.
  optional string item_pin_ordinal = 7;

  // The color groups used for grouping together icons by colors.
  enum ColorGroup {
    COLOR_EMPTY = 0;
    COLOR_WHITE = 1;
    COLOR_RED = 2;
    COLOR_ORANGE = 3;
    COLOR_YELLOW = 4;
    COLOR_GREEN = 5;
    COLOR_BLUE = 6;
    COLOR_MAGENTA = 7;
    COLOR_BLACK = 8;
  }

  message IconColor {
    // The item icon's background color.
    optional ColorGroup background_color = 1;

    // The item icon's hue.
    optional int32 hue = 2;
  }
  optional IconColor item_color = 8;
}