www.pudn.com > wcore.rar > WebCoreFormControls.h
/* * Copyright (c) 2005 Nokia Corporation, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Nokia Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef __WEBCOREFORMCONTROLS__ #define __WEBCOREFORMCONTROLS__ // INCLUDES #include#include #include #include "WebCoreWidget.h" #include "WebCoreFormEvent.h" // CONSTANTS // MACROS // DATA TYPES typedef enum { EWebCoreScrollBarHorizontal, EWebCoreScrollBarVertical } TWebCoreScrollBarOrientation; typedef enum { EWebCoreScrollBarNone, EWebCoreScrollBarDecrementLine, EWebCoreScrollBarIncrementLine, EWebCoreScrollBarDecrementPage, EWebCoreScrollBarIncrementPage, EWebCoreScrollBarKnob } TWebCoreScrollBarPart; // FUNCTION PROTOTYPES // FORWARD DECLARATIONS class MWebCoreFormEventHandler; // CLASS DECLARATION /** * interface , implemented by input skin * @lib webcore.lib * @since 3.0 */ class MWebCoreInputWidget: public MWebCoreWidget { public: // input/textare/password related methods virtual void SetText(TPtrC aData)= 0; virtual TPtrC Text()= 0; virtual void SetMaxLength(TInt aLength)= 0; virtual void SetHeight(TInt aHeight)= 0; virtual TInt MaxLength()= 0; virtual TInt Height() const = 0; virtual TBool Edited()= 0; virtual void SetEdited(TBool aEdited)= 0; virtual TSize SizeForCharacterWidth(TInt aNumCharacters) const= 0; virtual void SetSize(TInt aSize)= 0; virtual void SetEventHandler(MWebCoreFormEventHandler* aInputEventHandler) = 0; virtual TBool IsActive() const = 0; virtual void DeActivate(TBool aAcceptChanges) = 0; virtual TBool IsReadOnly() = 0; virtual void SetReadOnly(TBool aReadOnly) = 0; virtual TBool IsDisabled() = 0; virtual void SetDisabled(TBool aDisabled) = 0; virtual void SetFont (CFont* aFont) = 0; virtual void SetName(const TDesC& aName) = 0; virtual void SetInputRequiredFormat(TBool aInputRequired, const TDesC& aFormat) = 0; }; /** * interface , implemented by file input skin * @lib webcore.lib * @since 3.0 */ class MWebCoreFileInputWidget: public MWebCoreWidget { public: virtual void SetFileName(const TPtrC aData)= 0; virtual TPtrC FileName()= 0; virtual void SetEventHandler(MWebCoreFormEventHandler* aInputEventHandler) = 0; virtual TSize SizeForCharacterWidth(TInt aNumCharacters) const= 0; virtual void SetFont (CFont* aFont) = 0; }; /** * interface , implemented by button skin * @lib webcore.lib * @since 3.0 */ class MWebCoreButtonWidget: public MWebCoreWidget { public: virtual void SetText(TPtrC aData)= 0; virtual TPtrC Text()= 0; virtual TSize SizeForCharacterWidth(TInt aNumCharacters) const= 0; virtual void SetEventHandler(MWebCoreFormEventHandler* aActivateEventHandler) = 0; virtual void SetFont (CFont* aFont) = 0; }; /** * interface , implemented by checkbox skin * @lib webcore.lib * @since 3.0 */ class MWebCoreCheckBoxWidget: public MWebCoreWidget { public: virtual void SetChecked(TBool aIsChecked)= 0; virtual TBool IsChecked()= 0; virtual void SetEventHandler(MWebCoreFormEventHandler* aActivateEventHandler) = 0; }; /** * interface , implemented by select skin * @lib webcore.lib * @since 3.0 */ class MWebCoreSelectWidget: public MWebCoreWidget { public: virtual void AppendItem(TPtrC aItem, TBool aIsLabel, TBool aIsDisabled) = 0; virtual void DoneAppendingItems() = 0; virtual void SetSelected(TInt aIndex, TBool aSelectIt) = 0; virtual void DoneSelectingItems() = 0; virtual TBool IsSelected(TInt aIndex) const = 0; virtual void SetSelectionMode(TBool aMultiple) = 0; virtual void Clear() = 0; virtual void ClearSelection() = 0; // good only for combo , for listbox the function call returns the // first selected item virtual TInt SelectedIndex() const = 0; virtual TSize SizeForNumberOfLines(TInt aLines) const = 0; virtual TSize SizeForCharacterWidth(TInt aNumCharacters) const = 0; virtual void SetEventHandler(MWebCoreFormEventHandler* aInputEventHandler) = 0; virtual void SetFont (CFont* aFont) = 0; }; /** * interface, used by widget classes * @lib webcore.lib * @since 3.1 */ class MWebCoreScrollBarWidget: public MWebCoreWidget { public: virtual TWebCoreScrollBarOrientation Orientation() const = 0; virtual void SetOrientation(TWebCoreScrollBarOrientation aOrientation) = 0; virtual TReal Value() const = 0; virtual void SetValue(TReal aValue) = 0; virtual TReal KnobProportion() const = 0; virtual void SetKnobProportion(TReal aValue) = 0; virtual TWebCoreScrollBarPart ClickAtPoint(const TPoint& aPoint) = 0; }; #endif // __WEBCOREFORMCONTROLS__ // End of File