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