| 1 | /* |
| 2 | * Copyright (C) 2006 Apple Inc. All rights reserved. |
| 3 | * Copyright (C) 2010 Igalia S.L |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 18 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 19 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 20 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 21 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 22 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | */ |
| 26 | |
| 27 | #ifndef ContextMenuItem_h |
| 28 | #define |
| 29 | |
| 30 | #include <wtf/text/WTFString.h> |
| 31 | |
| 32 | namespace WebCore { |
| 33 | |
| 34 | class ; |
| 35 | class Image; |
| 36 | |
| 37 | enum { |
| 38 | , |
| 39 | , |
| 40 | , |
| 41 | , |
| 42 | , |
| 43 | , |
| 44 | , |
| 45 | #if PLATFORM(GTK) |
| 46 | , |
| 47 | #endif |
| 48 | , |
| 49 | , |
| 50 | , |
| 51 | , |
| 52 | , |
| 53 | , |
| 54 | , |
| 55 | , |
| 56 | #if PLATFORM(GTK) |
| 57 | , |
| 58 | , |
| 59 | , |
| 60 | , |
| 61 | , |
| 62 | , |
| 63 | , |
| 64 | , |
| 65 | , |
| 66 | , |
| 67 | , |
| 68 | , |
| 69 | , |
| 70 | , |
| 71 | , |
| 72 | #endif |
| 73 | , |
| 74 | , |
| 75 | , |
| 76 | , |
| 77 | , |
| 78 | , |
| 79 | , |
| 80 | , |
| 81 | , |
| 82 | , |
| 83 | , |
| 84 | , |
| 85 | , |
| 86 | , |
| 87 | , |
| 88 | , |
| 89 | , |
| 90 | , |
| 91 | , |
| 92 | , |
| 93 | , // Spelling or Spelling/Grammar sub-menu |
| 94 | , |
| 95 | , |
| 96 | , |
| 97 | , |
| 98 | , // Font sub-menu |
| 99 | , |
| 100 | , |
| 101 | , |
| 102 | , |
| 103 | , |
| 104 | , |
| 105 | , |
| 106 | , // Speech sub-menu |
| 107 | , |
| 108 | , |
| 109 | , // Writing Direction sub-menu |
| 110 | , |
| 111 | , |
| 112 | , |
| 113 | , |
| 114 | , |
| 115 | , |
| 116 | , // Text Direction sub-menu |
| 117 | , |
| 118 | , |
| 119 | , |
| 120 | #if PLATFORM(COCOA) |
| 121 | ContextMenuItemTagCorrectSpellingAutomatically, |
| 122 | ContextMenuItemTagSubstitutionsMenu, |
| 123 | ContextMenuItemTagShowSubstitutions, |
| 124 | ContextMenuItemTagSmartCopyPaste, |
| 125 | ContextMenuItemTagSmartQuotes, |
| 126 | ContextMenuItemTagSmartDashes, |
| 127 | ContextMenuItemTagSmartLinks, |
| 128 | ContextMenuItemTagTextReplacement, |
| 129 | ContextMenuItemTagTransformationsMenu, |
| 130 | ContextMenuItemTagMakeUpperCase, |
| 131 | ContextMenuItemTagMakeLowerCase, |
| 132 | ContextMenuItemTagCapitalize, |
| 133 | ContextMenuItemTagChangeBack, |
| 134 | #endif |
| 135 | , |
| 136 | , |
| 137 | , |
| 138 | , |
| 139 | , |
| 140 | , |
| 141 | , |
| 142 | , |
| 143 | , |
| 144 | , |
| 145 | , |
| 146 | , |
| 147 | = 5000, |
| 148 | = 5999, |
| 149 | = 10000 |
| 150 | }; |
| 151 | |
| 152 | enum { |
| 153 | ActionType, |
| 154 | CheckableActionType, |
| 155 | SeparatorType, |
| 156 | |
| 157 | }; |
| 158 | |
| 159 | class { |
| 160 | WTF_MAKE_FAST_ALLOCATED; |
| 161 | public: |
| 162 | WEBCORE_EXPORT (ContextMenuItemType, ContextMenuAction, const String&, ContextMenu* = 0); |
| 163 | WEBCORE_EXPORT (ContextMenuItemType, ContextMenuAction, const String&, bool enabled, bool checked); |
| 164 | |
| 165 | WEBCORE_EXPORT (); |
| 166 | |
| 167 | void (ContextMenuItemType); |
| 168 | WEBCORE_EXPORT ContextMenuItemType () const; |
| 169 | |
| 170 | void (ContextMenuAction); |
| 171 | WEBCORE_EXPORT ContextMenuAction () const; |
| 172 | |
| 173 | void (bool = true); |
| 174 | WEBCORE_EXPORT bool () const; |
| 175 | |
| 176 | void (bool = true); |
| 177 | WEBCORE_EXPORT bool () const; |
| 178 | |
| 179 | void (ContextMenu*); |
| 180 | |
| 181 | WEBCORE_EXPORT (ContextMenuAction, const String&, bool enabled, bool checked, const Vector<ContextMenuItem>& ); |
| 182 | (); |
| 183 | |
| 184 | bool () const; |
| 185 | |
| 186 | void (const String& title) { m_title = title; } |
| 187 | const String& () const { return m_title; } |
| 188 | |
| 189 | const Vector<ContextMenuItem>& () const { return m_subMenuItems; } |
| 190 | private: |
| 191 | ContextMenuItemType ; |
| 192 | ContextMenuAction ; |
| 193 | String ; |
| 194 | bool ; |
| 195 | bool ; |
| 196 | Vector<ContextMenuItem> ; |
| 197 | }; |
| 198 | |
| 199 | } |
| 200 | |
| 201 | #endif // ContextMenuItem_h |
| 202 | |