WebCore/platform/PopupMenuClient.h
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * Copyright (C) 2006 Apple Computer, Inc.
       
     4  *
       
     5  * This library is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU Library General Public
       
     7  * License as published by the Free Software Foundation; either
       
     8  * version 2 of the License, or (at your option) any later version.
       
     9  *
       
    10  * This library is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13  * Library General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU Library General Public License
       
    16  * along with this library; see the file COPYING.LIB.  If not, write to
       
    17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
       
    18  * Boston, MA 02110-1301, USA.
       
    19  *
       
    20  */
       
    21 
       
    22 #ifndef PopupMenuClient_h
       
    23 #define PopupMenuClient_h
       
    24 
       
    25 #include "PopupMenuStyle.h"
       
    26 #include "ScrollTypes.h"
       
    27 
       
    28 namespace WebCore {
       
    29 
       
    30 class Color;
       
    31 class FontSelector;
       
    32 class HostWindow;
       
    33 class Scrollbar;
       
    34 class ScrollbarClient;
       
    35 class String;
       
    36 
       
    37 class PopupMenuClient {
       
    38 public:
       
    39     virtual ~PopupMenuClient() {}
       
    40     virtual void valueChanged(unsigned listIndex, bool fireEvents = true) = 0;
       
    41     virtual void selectionChanged(unsigned listIndex, bool fireEvents = true) = 0;
       
    42     virtual void selectionCleared() = 0;
       
    43 
       
    44     virtual String itemText(unsigned listIndex) const = 0;
       
    45     virtual String itemLabel(unsigned listIndex) const = 0;
       
    46     virtual String itemToolTip(unsigned listIndex) const = 0;
       
    47     virtual String itemAccessibilityText(unsigned listIndex) const = 0;
       
    48     virtual bool itemIsEnabled(unsigned listIndex) const = 0;
       
    49     virtual PopupMenuStyle itemStyle(unsigned listIndex) const = 0;
       
    50     virtual PopupMenuStyle menuStyle() const = 0;
       
    51     virtual int clientInsetLeft() const = 0;
       
    52     virtual int clientInsetRight() const = 0;
       
    53     virtual int clientPaddingLeft() const = 0;
       
    54     virtual int clientPaddingRight() const = 0;
       
    55     virtual int listSize() const = 0;
       
    56     virtual int selectedIndex() const = 0;
       
    57     virtual void popupDidHide() = 0;
       
    58     virtual bool itemIsSeparator(unsigned listIndex) const = 0;
       
    59     virtual bool itemIsLabel(unsigned listIndex) const = 0;
       
    60     virtual bool itemIsSelected(unsigned listIndex) const = 0;
       
    61     virtual bool shouldPopOver() const = 0;
       
    62     virtual bool valueShouldChangeOnHotTrack() const = 0;
       
    63     virtual void setTextFromItem(unsigned listIndex) = 0;
       
    64     
       
    65     virtual FontSelector* fontSelector() const = 0;
       
    66     virtual HostWindow* hostWindow() const = 0;
       
    67     
       
    68     virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) = 0;
       
    69 };
       
    70 
       
    71 #if ENABLE(NO_LISTBOX_RENDERING)
       
    72 class ListPopupMenuClient : public PopupMenuClient {
       
    73 public:
       
    74     virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true) = 0;
       
    75     virtual bool multiple() = 0;
       
    76 };
       
    77 #endif
       
    78 
       
    79 
       
    80 }
       
    81 
       
    82 #endif