Home | History | Annotate | Download | only in platform
      1 /*
      2  * Copyright (C) 2010 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. AND ITS CONTRIBUTORS ``AS IS''
     15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
     18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     24  * THE POSSIBILITY OF SUCH DAMAGE.
     25  */
     26 
     27 #ifndef LocalizationStrategy_h
     28 #define LocalizationStrategy_h
     29 
     30 #if USE(PLATFORM_STRATEGIES)
     31 
     32 #include <wtf/Forward.h>
     33 
     34 namespace WebCore {
     35 
     36 class IntSize;
     37 
     38 class LocalizationStrategy {
     39 public:
     40     virtual String inputElementAltText() = 0;
     41     virtual String resetButtonDefaultLabel() = 0;
     42     virtual String searchableIndexIntroduction() = 0;
     43     virtual String submitButtonDefaultLabel() = 0;
     44     virtual String fileButtonChooseFileLabel() = 0;
     45     virtual String fileButtonNoFileSelectedLabel() = 0;
     46     virtual String defaultDetailsSummaryText() = 0;
     47 
     48 #if PLATFORM(MAC)
     49     virtual String copyImageUnknownFileLabel() = 0;
     50 #endif
     51 
     52 #if ENABLE(CONTEXT_MENUS)
     53     virtual String contextMenuItemTagOpenLinkInNewWindow() = 0;
     54     virtual String contextMenuItemTagDownloadLinkToDisk() = 0;
     55     virtual String contextMenuItemTagCopyLinkToClipboard() = 0;
     56     virtual String contextMenuItemTagOpenImageInNewWindow() = 0;
     57     virtual String contextMenuItemTagDownloadImageToDisk() = 0;
     58     virtual String contextMenuItemTagCopyImageToClipboard() = 0;
     59 #if PLATFORM(QT) || PLATFORM(GTK)
     60     virtual String contextMenuItemTagCopyImageUrlToClipboard() = 0;
     61 #endif
     62     virtual String contextMenuItemTagOpenFrameInNewWindow() = 0;
     63     virtual String contextMenuItemTagCopy() = 0;
     64     virtual String contextMenuItemTagGoBack() = 0;
     65     virtual String contextMenuItemTagGoForward() = 0;
     66     virtual String contextMenuItemTagStop() = 0;
     67     virtual String contextMenuItemTagReload() = 0;
     68     virtual String contextMenuItemTagCut() = 0;
     69     virtual String contextMenuItemTagPaste() = 0;
     70 #if PLATFORM(GTK)
     71     virtual String contextMenuItemTagDelete() = 0;
     72     virtual String contextMenuItemTagInputMethods() = 0;
     73     virtual String contextMenuItemTagUnicode() = 0;
     74 #endif
     75 #if PLATFORM(GTK) || PLATFORM(QT)
     76     virtual String contextMenuItemTagSelectAll() = 0;
     77 #endif
     78     virtual String contextMenuItemTagNoGuessesFound() = 0;
     79     virtual String contextMenuItemTagIgnoreSpelling() = 0;
     80     virtual String contextMenuItemTagLearnSpelling() = 0;
     81     virtual String contextMenuItemTagSearchWeb() = 0;
     82     virtual String contextMenuItemTagLookUpInDictionary(const String& selectedString) = 0;
     83     virtual String contextMenuItemTagOpenLink() = 0;
     84     virtual String contextMenuItemTagIgnoreGrammar() = 0;
     85     virtual String contextMenuItemTagSpellingMenu() = 0;
     86     virtual String contextMenuItemTagShowSpellingPanel(bool show) = 0;
     87     virtual String contextMenuItemTagCheckSpelling() = 0;
     88     virtual String contextMenuItemTagCheckSpellingWhileTyping() = 0;
     89     virtual String contextMenuItemTagCheckGrammarWithSpelling() = 0;
     90     virtual String contextMenuItemTagFontMenu() = 0;
     91     virtual String contextMenuItemTagBold() = 0;
     92     virtual String contextMenuItemTagItalic() = 0;
     93     virtual String contextMenuItemTagUnderline() = 0;
     94     virtual String contextMenuItemTagOutline() = 0;
     95     virtual String contextMenuItemTagWritingDirectionMenu() = 0;
     96     virtual String contextMenuItemTagTextDirectionMenu() = 0;
     97     virtual String contextMenuItemTagDefaultDirection() = 0;
     98     virtual String contextMenuItemTagLeftToRight() = 0;
     99     virtual String contextMenuItemTagRightToLeft() = 0;
    100 #if PLATFORM(MAC)
    101     virtual String contextMenuItemTagSearchInSpotlight() = 0;
    102     virtual String contextMenuItemTagShowFonts() = 0;
    103     virtual String contextMenuItemTagStyles() = 0;
    104     virtual String contextMenuItemTagShowColors() = 0;
    105     virtual String contextMenuItemTagSpeechMenu() = 0;
    106     virtual String contextMenuItemTagStartSpeaking() = 0;
    107     virtual String contextMenuItemTagStopSpeaking() = 0;
    108     virtual String contextMenuItemTagCorrectSpellingAutomatically() = 0;
    109     virtual String contextMenuItemTagSubstitutionsMenu() = 0;
    110     virtual String contextMenuItemTagShowSubstitutions(bool show) = 0;
    111     virtual String contextMenuItemTagSmartCopyPaste() = 0;
    112     virtual String contextMenuItemTagSmartQuotes() = 0;
    113     virtual String contextMenuItemTagSmartDashes() = 0;
    114     virtual String contextMenuItemTagSmartLinks() = 0;
    115     virtual String contextMenuItemTagTextReplacement() = 0;
    116     virtual String contextMenuItemTagTransformationsMenu() = 0;
    117     virtual String contextMenuItemTagMakeUpperCase() = 0;
    118     virtual String contextMenuItemTagMakeLowerCase() = 0;
    119     virtual String contextMenuItemTagCapitalize() = 0;
    120     virtual String contextMenuItemTagChangeBack(const String& replacedString) = 0;
    121 #endif
    122     virtual String contextMenuItemTagOpenVideoInNewWindow() = 0;
    123     virtual String contextMenuItemTagOpenAudioInNewWindow() = 0;
    124     virtual String contextMenuItemTagCopyVideoLinkToClipboard() = 0;
    125     virtual String contextMenuItemTagCopyAudioLinkToClipboard() = 0;
    126     virtual String contextMenuItemTagToggleMediaControls() = 0;
    127     virtual String contextMenuItemTagToggleMediaLoop() = 0;
    128     virtual String contextMenuItemTagEnterVideoFullscreen() = 0;
    129     virtual String contextMenuItemTagMediaPlay() = 0;
    130     virtual String contextMenuItemTagMediaPause() = 0;
    131     virtual String contextMenuItemTagMediaMute() = 0;
    132     virtual String contextMenuItemTagInspectElement() = 0;
    133 #endif // ENABLE(CONTEXT_MENUS)
    134 
    135     virtual String searchMenuNoRecentSearchesText() = 0;
    136     virtual String searchMenuRecentSearchesText() = 0;
    137     virtual String searchMenuClearRecentSearchesText() = 0;
    138 
    139     virtual String AXWebAreaText() = 0;
    140     virtual String AXLinkText() = 0;
    141     virtual String AXListMarkerText() = 0;
    142     virtual String AXImageMapText() = 0;
    143     virtual String AXHeadingText() = 0;
    144     virtual String AXDefinitionListTermText() = 0;
    145     virtual String AXDefinitionListDefinitionText() = 0;
    146 
    147 #if PLATFORM(MAC)
    148     virtual String AXARIAContentGroupText(const String& ariaType) = 0;
    149 #endif
    150 
    151     virtual String AXButtonActionVerb() = 0;
    152     virtual String AXRadioButtonActionVerb() = 0;
    153     virtual String AXTextFieldActionVerb() = 0;
    154     virtual String AXCheckedCheckBoxActionVerb() = 0;
    155     virtual String AXUncheckedCheckBoxActionVerb() = 0;
    156     virtual String AXMenuListActionVerb() = 0;
    157     virtual String AXMenuListPopupActionVerb() = 0;
    158     virtual String AXLinkActionVerb() = 0;
    159 
    160     virtual String missingPluginText() = 0;
    161     virtual String crashedPluginText() = 0;
    162     virtual String multipleFileUploadText(unsigned numberOfFiles) = 0;
    163     virtual String unknownFileSizeText() = 0;
    164 
    165 #if PLATFORM(WIN)
    166     virtual String uploadFileText() = 0;
    167     virtual String allFilesText() = 0;
    168 #endif
    169 
    170 #if PLATFORM(MAC)
    171     virtual String keygenMenuItem512() = 0;
    172     virtual String keygenMenuItem1024() = 0;
    173     virtual String keygenMenuItem2048() = 0;
    174     virtual String keygenKeychainItemName(const String& host) = 0;
    175 #endif
    176 
    177     virtual String imageTitle(const String& filename, const IntSize& size) = 0;
    178 
    179     virtual String mediaElementLoadingStateText() = 0;
    180     virtual String mediaElementLiveBroadcastStateText() = 0;
    181     virtual String localizedMediaControlElementString(const String&) = 0;
    182     virtual String localizedMediaControlElementHelpText(const String&) = 0;
    183     virtual String localizedMediaTimeDescription(float) = 0;
    184 
    185     virtual String validationMessageValueMissingText() = 0;
    186     virtual String validationMessageTypeMismatchText() = 0;
    187     virtual String validationMessagePatternMismatchText() = 0;
    188     virtual String validationMessageTooLongText() = 0;
    189     virtual String validationMessageRangeUnderflowText() = 0;
    190     virtual String validationMessageRangeOverflowText() = 0;
    191     virtual String validationMessageStepMismatchText() = 0;
    192 
    193 protected:
    194     virtual ~LocalizationStrategy()
    195     {
    196     }
    197 };
    198 
    199 } // namespace WebCore
    200 
    201 #endif // USE(PLATFORM_STRATEGIES)
    202 
    203 #endif // LocalizationStrategy_h
    204