imageeditor/inc/SingleParamControl.h
changeset 1 edfc90759b9f
equal deleted inserted replaced
0:57d4cdd99204 1:edfc90759b9f
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef SINGLEPARAMCONTROL_H
       
    21 #define SINGLEPARAMCONTROL_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <eiklabel.h>
       
    25 #include "PreviewControlBase.h"
       
    26 
       
    27 //  FORWARD DECLARATIONS
       
    28 class CCoeControl;
       
    29 class CAknView;
       
    30 class MSingleParControlObserver;
       
    31 class CPluginInfo;
       
    32 class CHorizontalSlider;
       
    33 
       
    34 #ifdef RD_TACTILE_FEEDBACK 
       
    35 class MTouchFeedback;
       
    36 #endif /* RD_TACTILE_FEEDBACK  */
       
    37 
       
    38 /*	CLASS: CSingleParamControl
       
    39  *
       
    40  *   CSingleParamControl represents a single parameter adjustment UI control,
       
    41  *   that can be used by any of the plug-ins just by defining a UI type to
       
    42  *   resource file.
       
    43  */
       
    44 class CSingleParamControl : public CPreviewControlBase
       
    45 	{
       
    46 public:
       
    47 
       
    48 	/** @name Methods:*/
       
    49 	//@{
       
    50 
       
    51 	/** NewL factory method, pops cleanupstack
       
    52 	 *
       
    53 	 *   @param aRect - control rectangle
       
    54 	 *	 @param aParent - pointer to window owning control
       
    55 	 *   @param aActionOnButtonRelease - To indicate if rendering should happen only when
       
    56 	 *   the button1 is released, i.e. when dragging has stopped. Default value is false.
       
    57 	 *   @return - pointer to the newly created CSingleParamControl instance
       
    58 	 */
       
    59 	IMPORT_C static CSingleParamControl * NewL (
       
    60 			const TRect & aRect,
       
    61 			CCoeControl * aParent,
       
    62 			TBool aActionOnButtonRelease = EFalse
       
    63 	);
       
    64 
       
    65 	/** Default constructor
       
    66 	 *
       
    67 	 *	@param -
       
    68 	 *	@return -
       
    69 	 */
       
    70 	IMPORT_C CSingleParamControl ();
       
    71 
       
    72 	/** Second phase constructor
       
    73 	 *
       
    74 	 *   @see CImageEditorControlBase
       
    75 	 */
       
    76 	IMPORT_C virtual void ConstructL (
       
    77 			const TRect & aRect,
       
    78 			CCoeControl * aParent,
       
    79 			TBool aActionOnButtonRelease
       
    80 	);
       
    81 
       
    82 	/** Destructor
       
    83 	 *
       
    84 	 *	@param -
       
    85 	 *	@return -
       
    86 	 */
       
    87 	IMPORT_C virtual ~CSingleParamControl ();
       
    88 
       
    89 	/*	SetView
       
    90 	 *
       
    91 	 *   @see CImageEditorControlBase
       
    92 	 */
       
    93 	IMPORT_C virtual void SetView (CAknView * aView);
       
    94 
       
    95 	/*	SetSelectedUiItemL
       
    96 	 *
       
    97 	 *   @see CImageEditorControlBase
       
    98 	 */
       
    99 	IMPORT_C virtual void SetSelectedUiItemL (CPluginInfo * aItem);
       
   100 
       
   101 	/*	OfferKeyEventL
       
   102 	 *
       
   103 	 *   @see CImageEditorControlBase
       
   104 	 */
       
   105 	IMPORT_C virtual TKeyResponse OfferKeyEventL (
       
   106 			const TKeyEvent & aKeyEvent,
       
   107 			TEventCode aType
       
   108 	);
       
   109 
       
   110 	/**	HandlePointerEventL	
       
   111 	 *
       
   112 	 *	@see CCoeControl
       
   113 	 */
       
   114 	IMPORT_C virtual void HandlePointerEventL( const TPointerEvent &aPointerEvent );
       
   115 
       
   116 	/*	SetParObserver 
       
   117 	 *
       
   118 	 *   Sets the MSingleParControlObserver for the control.
       
   119 	 *
       
   120 	 *	@param aObserver - parameter observer
       
   121 	 *	@return -
       
   122 	 */
       
   123 	IMPORT_C void SetParObserver (MSingleParControlObserver * aObserver);
       
   124 
       
   125 	/*	HandlePluginCommandL
       
   126 	 *
       
   127 	 *   @see CImageEditorControlBase
       
   128 	 */
       
   129 	IMPORT_C virtual void HandlePluginCommandL (const TInt aCommand);
       
   130 
       
   131 	/*	GetSoftkeyIndexL
       
   132 	 *
       
   133 	 *   @see CImageEditorControlBase
       
   134 	 */
       
   135 	IMPORT_C virtual TInt GetSoftkeyIndexL();
       
   136 
       
   137 	/*	GetNaviPaneTextL
       
   138 	 *
       
   139 	 *	@see CImageEditorControlBase
       
   140 	 */
       
   141 	IMPORT_C virtual TPtrC GetNaviPaneTextL (
       
   142 			TBool& aLeftNaviPaneScrollButtonVisibile,
       
   143 			TBool& aRightNaviPaneScrollButtonVisible);
       
   144 
       
   145 	// these functions are for adjusting the slider
       
   146 	IMPORT_C void SetSliderMinimumAndMaximum(TInt aMin, TInt aMax);
       
   147 	IMPORT_C void SetSliderPosition(TInt aPosition);
       
   148 	IMPORT_C void SetSliderStep(TUint aStep);
       
   149 	IMPORT_C void SetSliderStepAmount(TUint8 aAmount);
       
   150 	IMPORT_C void SetIcon(CEikImage* aIcon);
       
   151 	IMPORT_C void SetCaption(const TDesC& aText);
       
   152 	IMPORT_C TInt Position() const;
       
   153 
       
   154 	// from CCoeControl
       
   155 	IMPORT_C TInt CountComponentControls() const;
       
   156 	IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
       
   157 	IMPORT_C void SizeChanged();
       
   158 
       
   159 	//@}
       
   160 
       
   161 protected:
       
   162 
       
   163 private:
       
   164 
       
   165 	/** @name Methods:*/
       
   166 	//@{
       
   167 
       
   168 	/*	Draw
       
   169 	 *
       
   170 	 *   @see CImageEditorControlBase
       
   171 	 */
       
   172 	IMPORT_C virtual void Draw (const TRect & aRect) const;
       
   173 
       
   174 	//@}
       
   175 	/// Parameter adjustment observer
       
   176 	MSingleParControlObserver * iParObserver;
       
   177 
       
   178 	IMPORT_C void CountImageSizesAndPositions();
       
   179 	IMPORT_C void MoveSlider(TInt aSteps);
       
   180 
       
   181 protected:
       
   182 
       
   183 	/// Plug-in info
       
   184 	CPluginInfo* iItem;
       
   185 
       
   186 	/// View reference
       
   187 	CAknView* iEditorView;
       
   188 
       
   189 	/// drag flag
       
   190 	TBool iDragging;
       
   191 	
       
   192 	/// should rendering happen only when the button is released
       
   193 	TBool iActionOnButtonRelease;
       
   194 
       
   195 	/// touch area
       
   196 	TRect iTouchRect;
       
   197 
       
   198 	/// minimum value of the slider
       
   199 	TInt iMinimumValue;
       
   200 
       
   201 	/// maximum value of the slider
       
   202 	TInt iMaximumValue;
       
   203 
       
   204 	/// step value
       
   205 	TUint iStep;
       
   206 	TUint iStepInPixels;
       
   207 
       
   208 	/// number of steps
       
   209 	TUint8 iNumberOfSteps;
       
   210 
       
   211 	/// current position
       
   212 	TInt iPosition;
       
   213 
       
   214 	/// popup graphics
       
   215 	RPointerArray<CEikImage> iBorders;
       
   216 
       
   217 	/// scrollbar graphics
       
   218 	RPointerArray<CEikImage> iScrollBar;
       
   219 
       
   220 	/// caption text
       
   221 	CEikLabel* iText;
       
   222 
       
   223 	/// icon graphic, owned
       
   224 	CEikImage* iIcon;
       
   225 
       
   226 	/// use selection graphic
       
   227 	TBool iMarkerPressed;
       
   228 
       
   229 	// Feedback for screen touch:
       
   230 #ifdef RD_TACTILE_FEEDBACK 
       
   231 	MTouchFeedback* iTouchFeedBack;
       
   232 #endif /* RD_TACTILE_FEEDBACK  */
       
   233 
       
   234 	};
       
   235 
       
   236 #endif
       
   237 
       
   238 // End of File