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