chromium/components/dbus/menu/menu_property_list.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_DBUS_MENU_MENU_PROPERTY_LIST_H_
#define COMPONENTS_DBUS_MENU_MENU_PROPERTY_LIST_H_

#include <map>
#include <string>
#include <vector>

#include "components/dbus/properties/types.h"

MenuPropertyList;
MenuItemProperties;
MenuPropertyChanges;

namespace ui {
class MenuModel;
}

// Computes properties for the menu item with index |i| in |menu|.
COMPONENT_EXPORT()
MenuItemProperties ComputeMenuPropertiesForMenuItem(ui::MenuModel* menu,
                                                    size_t i);

// Given inputs |old_properties| and |new_properties|, computes outputs
// |item_updated_props| and |item_removed_props| suitable for use in
// com.canonical.dbusmenu.ItemsPropertiesUpdated.
COMPONENT_EXPORT()
void ComputeMenuPropertyChanges(const MenuItemProperties& old_properties,
                                const MenuItemProperties& new_properties,
                                MenuPropertyList* item_updated_props,
                                MenuPropertyList* item_removed_props);

#endif  // COMPONENTS_DBUS_MENU_MENU_PROPERTY_LIST_H_