| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Igalia S.L | 3 * Copyright (C) 2010 Igalia S.L |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 enum ContextMenuItemType { | 44 enum ContextMenuItemType { |
| 45 ActionType, | 45 ActionType, |
| 46 CheckableActionType, | 46 CheckableActionType, |
| 47 SeparatorType, | 47 SeparatorType, |
| 48 SubmenuType | 48 SubmenuType |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class PLATFORM_EXPORT ContextMenuItem { | 51 class PLATFORM_EXPORT ContextMenuItem { |
| 52 WTF_MAKE_FAST_ALLOCATED; | 52 WTF_MAKE_FAST_ALLOCATED; |
| 53 public: | 53 public: |
| 54 ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, Conte
xtMenu* subMenu = 0); | 54 ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String& title,
const String& icon, ContextMenu* subMenu = 0); |
| 55 ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, bool
enabled, bool checked); | 55 ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String& title,
const String& icon, bool enabled, bool checked); |
| 56 | 56 |
| 57 ~ContextMenuItem(); | 57 ~ContextMenuItem(); |
| 58 | 58 |
| 59 void setType(ContextMenuItemType); | 59 void setType(ContextMenuItemType); |
| 60 ContextMenuItemType type() const; | 60 ContextMenuItemType type() const; |
| 61 | 61 |
| 62 void setAction(ContextMenuAction); | 62 void setAction(ContextMenuAction); |
| 63 ContextMenuAction action() const; | 63 ContextMenuAction action() const; |
| 64 | 64 |
| 65 void setChecked(bool = true); | 65 void setChecked(bool = true); |
| 66 bool checked() const; | 66 bool checked() const; |
| 67 | 67 |
| 68 void setEnabled(bool = true); | 68 void setEnabled(bool = true); |
| 69 bool enabled() const; | 69 bool enabled() const; |
| 70 | 70 |
| 71 void setSubMenu(ContextMenu*); | 71 void setSubMenu(ContextMenu*); |
| 72 | 72 |
| 73 ContextMenuItem(ContextMenuAction, const String&, bool enabled, bool checked
, const Vector<ContextMenuItem>& subMenuItems); | 73 ContextMenuItem(ContextMenuAction, const String&, bool enabled, bool checked
, const Vector<ContextMenuItem>& subMenuItems); |
| 74 | 74 |
| 75 void setTitle(const String& title) { m_title = title; } | 75 void setTitle(const String& title) { m_title = title; } |
| 76 const String& title() const { return m_title; } | 76 const String& title() const { return m_title; } |
| 77 | 77 |
| 78 void setIcon(const String& icon) { m_icon = icon; } |
| 79 const String& icon() const { return m_icon; } |
| 80 |
| 78 const Vector<ContextMenuItem>& subMenuItems() const { return m_subMenuItems;
} | 81 const Vector<ContextMenuItem>& subMenuItems() const { return m_subMenuItems;
} |
| 79 | 82 |
| 80 private: | 83 private: |
| 81 ContextMenuItemType m_type; | 84 ContextMenuItemType m_type; |
| 82 ContextMenuAction m_action; | 85 ContextMenuAction m_action; |
| 83 String m_title; | 86 String m_title; |
| 87 String m_icon; |
| 84 bool m_enabled; | 88 bool m_enabled; |
| 85 bool m_checked; | 89 bool m_checked; |
| 86 Vector<ContextMenuItem> m_subMenuItems; | 90 Vector<ContextMenuItem> m_subMenuItems; |
| 87 }; | 91 }; |
| 88 | 92 |
| 89 } | 93 } |
| 90 | 94 |
| 91 #endif // ContextMenuItem_h | 95 #endif // ContextMenuItem_h |
| OLD | NEW |