epoc32/include/mw/aknscbut.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 /*
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  ?Description
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 #if !defined(__AKNSCBUT_H__)
    22 #define __AKNSCBUT_H__
    23 
    24 //  INCLUDES
    25 #include <AknControl.h>
    26 
    27 // FORWARD DECLARATIONS
    28 
    29 class CAknScrollIndicator;
    30 
    31 /**
    32 *  Implements a scroll buttons of a scroll bar.
    33 *
    34 *  @since Series 60 0.9
    35 */
    36 NONSHARABLE_CLASS(CAknScrollButton) : public CAknControl
    37 	{
    38 public:
    39 	/**
    40 	* Indicates a Scroll button's type
    41 	*/
    42 	enum TType
    43 		{
    44 		/** Scroll button to move the display to the left. */
    45 		ENudgeLeft,
    46 		/** Scroll button to move the display up.  */
    47 		ENudgeUp, 
    48 		/** Scroll button to move the display to the right. */
    49 		ENudgeRight,
    50 		/** Scroll button to move the display down. */ 
    51 		ENudgeDown,
    52 		/** Scroll button to move the display page to the left. */ 
    53 		EPageLeft, 
    54 		/** Scroll button to move the display page up. */
    55 		EPageUp, 
    56 		/** Scroll button to move the display page to the right.*/
    57 		EPageRight,
    58 		/** Scroll button to move the display page down. */ 
    59 		EPageDown, 
    60 		/** Scroll button to move the display to the home position. */
    61 		EHome,
    62 		/** Scroll button to move the display to the top. */ 
    63 		ETop,
    64 		 /** Scroll button to move the display to the end position. */ 
    65 		EEnd,
    66 		/** Scroll button to move the display to the bottom. */
    67 		EBottom 
    68 		};
    69 
    70 public:
    71 	/**
    72 	* Indicates a scroll bar's type.
    73 	*/
    74 	enum TTypeOfScrollBar
    75 		{
    76 		/** Normal scroll bar  */
    77 		ENormal		=0x00,
    78 		/** Arrow headed scroll bar */ 
    79 		EArrowHead	=0x01 
    80 		};
    81 
    82 public: // class specific functions
    83 
    84     /**
    85     * Two-phased constructor.
    86     * @param aType scroll button's type.
    87     * @return A fully constructed @c CAknScrollButton object.
    88     */
    89 	IMPORT_C static CAknScrollButton* NewL(TType aType);
    90 	
    91 	/**
    92     * Destructor.
    93     */
    94 	IMPORT_C ~CAknScrollButton();
    95 	
    96 	/**
    97     * Gets a scroll button's type.
    98     * @return The scroll button's type.
    99     */
   100 	IMPORT_C TType Type() const;
   101 	
   102 	/**
   103     * Creates a window only for arrows. 
   104     * Sets the container window to be this class.
   105     * @param aParent The control to be the parent of this control.
   106     */
   107 	IMPORT_C void CreateWindowOnlyForArrowsL(const CCoeControl* aParent);
   108 	
   109 	/**
   110     * Determines whether a scroll button is owned by normal scroll bar.
   111     * @return @c ETrue if a scroll button is owned by the normal scroll bar, 
   112     *         @c EFalse if not
   113     */
   114 	IMPORT_C TBool IsNormalScrollBarUsingButton() const;
   115 	
   116 	/**
   117     * Sets the type of scroll bar which owns the button.
   118     * @param aTypeOfScrollBar The type of the scroll bar.
   119     */
   120 	IMPORT_C void SetTypeOfScrollBarUsingButton(TTypeOfScrollBar aTypeOfScrollBar);
   121 	
   122 	/**
   123     * Sets the new focus position in the control and the span length.
   124     * @param aFocusPosition The new focus position.
   125     * @param aScrollSpan The new span length.
   126     */
   127 	IMPORT_C void SetPosition(const TInt aFocusPosition, const TInt aScrollSpan);
   128 	
   129 	/**
   130     * Two-phased constructor.
   131     * @param aType scroll button's type.
   132     * @param aTypeOfScrollBar scroll bar type, this information is needed at construction
   133     *  time when creating button for double span scroll bar (ie. the parameter is ENormal)
   134     * @return A fully constructed @c CAknScrollButton object.
   135     */
   136 	IMPORT_C static CAknScrollButton* NewL(TType aType, TTypeOfScrollBar aTypeOfScrollBar);
   137 	
   138 	void SetContainerWindowL( const CCoeControl& aControl );
   139 	TInt CountComponentControls() const;
   140 	CCoeControl* ComponentControl( TInt aIndex ) const;
   141 	
   142 private: // class specific functions
   143 	CAknScrollButton(TType aType);
   144 	void ConstructL();
   145 	void SizeChanged();
   146 	void DrawIndicator() const;
   147 	void ConstructL(TTypeOfScrollBar aTypeOfScrollBar);
   148 private: // from CCoeControl
   149 	virtual void Draw(const TRect& aRect) const;
   150 private:
   151 	friend class CAknScrollBar;
   152 	TType iType;
   153 	TInt iFlag;
   154 	CAknScrollIndicator* iScrollIndicator;
   155 	TRect iOldRect;
   156 	};
   157 
   158 
   159 #endif