imageeditor/plugins/FramePlugin/inc/ImageEditorFrameControl.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 * Frame plugin control's header.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef IMAGEEDITORCROPCONTROL_H
       
    22 #define IMAGEEDITORCROPCONTROL_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <coecntrl.h>
       
    26 
       
    27 #include "PreviewControlBase.h"
       
    28 
       
    29 //  FORWARD DECLARATIONS
       
    30 class CAknView;
       
    31 class CFbsBitmap;
       
    32 class CPluginInfo;
       
    33 
       
    34 #ifdef RD_TACTILE_FEEDBACK 
       
    35 class MTouchFeedback;
       
    36 #endif /* RD_TACTILE_FEEDBACK  */
       
    37 
       
    38 
       
    39 /*	CLASS: CImageEditorFrameControl
       
    40 *
       
    41 *   CImageEditorFrameControl is a control for red eye reduction plug-in.
       
    42 *
       
    43 */
       
    44 class CImageEditorFrameControl : public CPreviewControlBase
       
    45 {
       
    46 
       
    47 public:
       
    48 
       
    49 /** @name Methods:*/
       
    50 //@{
       
    51 
       
    52 	/** NewL factory method, pops cleanupstack
       
    53 	*
       
    54 	*	@param aRect - control rectangle
       
    55 	*	@param aParent - pointer to window owning control
       
    56 	*	@return pointer to created CImageEditorFrameControl object
       
    57 	*/
       
    58 	static CImageEditorFrameControl * NewL (
       
    59 		const TRect &		aRect,
       
    60 		CCoeControl	*		aParent
       
    61 		);
       
    62 
       
    63 	/** Destructor
       
    64 	*
       
    65 	*	@param -
       
    66 	*	@return -
       
    67 	*/
       
    68 	virtual ~CImageEditorFrameControl ();
       
    69 
       
    70 	/** Second phase constructor
       
    71 	*
       
    72 	*	@see CImageEditorControlBase
       
    73 	*
       
    74     */
       
    75 	virtual void ConstructL (
       
    76 		const TRect &		aRect,
       
    77 		CCoeControl	*		aParent
       
    78 		);
       
    79 
       
    80 	/*	Setter for view reference
       
    81 	*
       
    82 	*	@see CImageEditorControlBase
       
    83 	*
       
    84     */
       
    85     virtual void SetView (CAknView * aView);
       
    86 
       
    87     /*	SetSelectedUiItemL
       
    88 	*
       
    89 	*	@see CImageEditorControlBase
       
    90 	*
       
    91     */
       
    92     virtual void SetSelectedUiItemL (CPluginInfo * aItem);
       
    93 
       
    94     /*	OfferKeyEventL
       
    95 	*
       
    96 	*	@see CImageEditorControlBase
       
    97 	*
       
    98     */
       
    99     virtual TKeyResponse OfferKeyEventL (
       
   100         const TKeyEvent &   aKeyEvent,
       
   101         TEventCode          aType
       
   102         );   
       
   103 
       
   104 	/*	HandlePluginCommandL
       
   105 	*
       
   106 	*	@see CImageEditorControlBase
       
   107 	*
       
   108     */
       
   109     virtual void HandlePluginCommandL (const TInt aCommand);
       
   110 
       
   111 	/*	GetSoftkeyIndexL
       
   112 	*
       
   113 	*	@see CImageEditorControlBase
       
   114     */
       
   115     virtual TInt GetSoftkeyIndexL();
       
   116 
       
   117 	/*	GetNaviPaneTextL
       
   118 	*
       
   119 	*	@see CImageEditorControlBase
       
   120 	*/
       
   121 	virtual TPtrC GetNaviPaneTextL (
       
   122 		TBool& aLeftNaviPaneScrollButtonVisibile, 
       
   123 		TBool& aRightNaviPaneScrollButtonVisible);
       
   124 
       
   125 	/*	GetParam
       
   126 	*
       
   127 	*	Gets pointer to the parameter struct.
       
   128 	*
       
   129 	*	@param -
       
   130 	*	@return - pointer to MIA parameter struct
       
   131 	*/
       
   132     TDesC & GetParam ();
       
   133 
       
   134 //@}
       
   135 
       
   136 protected:
       
   137 
       
   138 /** @name Methods:*/
       
   139 //@{
       
   140 	/*	SizeChanged
       
   141 	*
       
   142 	*	@see CImageEditorControlBase
       
   143 	*
       
   144     */
       
   145 	virtual void SizeChanged();
       
   146 
       
   147 	/*	PrepareL
       
   148 	*
       
   149 	*	@see CImageEditorControlBase
       
   150 	*
       
   151     */
       
   152     virtual void PrepareL ();
       
   153 
       
   154     /*	HandlePointerEventL
       
   155 	*
       
   156 	*	@see CImageEditorControlBase
       
   157 	*
       
   158     */
       
   159 	virtual void HandlePointerEventL( const TPointerEvent &aPointerEvent );
       
   160 //@}
       
   161 
       
   162 /** @name Members:*/
       
   163 //@{
       
   164 
       
   165 //@}
       
   166 
       
   167 private:
       
   168 
       
   169 /** @name Methods:*/
       
   170 //@{
       
   171 
       
   172 	/** Default constructor
       
   173 	*
       
   174 	*	@param -
       
   175 	*	@return -
       
   176 	*/
       
   177 	CImageEditorFrameControl ();
       
   178 
       
   179 	/**	Draw
       
   180 	*
       
   181 	*	@see CImageEditorControlBase
       
   182 	*
       
   183     */
       
   184 	virtual void Draw (const TRect & aRect) const;
       
   185 
       
   186 	/**	NaviRightL
       
   187 	*
       
   188 	*	Handles nave key right event.
       
   189 	*
       
   190 	*	@param -
       
   191 	*	@return -
       
   192 	*/
       
   193     void NaviRightL();
       
   194 
       
   195 	/**	NaviLeftL
       
   196 	*
       
   197 	*	Handles nave key left event.
       
   198 	*
       
   199 	*	@param -
       
   200 	*	@return -
       
   201 	*/
       
   202     void NaviLeftL();
       
   203 
       
   204     /** FindFramesL
       
   205 	*
       
   206     *   Search all the frames available in the system
       
   207 	*/
       
   208     void FindFramesL();
       
   209 
       
   210     /** 
       
   211 	*	Select and decode frame bitmap.
       
   212     *   Done asyncronously.
       
   213 	*/
       
   214 	void SelectFrameL();
       
   215 
       
   216     /** SetNaviPaneTextL
       
   217 	*
       
   218     *   Update the navi pane.
       
   219 	*/
       
   220     void SetNaviPaneTextL();
       
   221 
       
   222     /** Copy constructor, disabled
       
   223 	*/
       
   224 	CImageEditorFrameControl (const CImageEditorFrameControl & rhs);
       
   225 
       
   226 	/** Assignment operator, disabled 
       
   227 	*/
       
   228 	CImageEditorFrameControl & operator= (const CImageEditorFrameControl & rhs);
       
   229 
       
   230 //@}
       
   231 
       
   232 /** @name Typedefs:*/
       
   233 //@{
       
   234     enum TFrameControlState
       
   235     {
       
   236         //  Invalid
       
   237         EFrameControlStateMin = 0,
       
   238         //  Loading initial frame
       
   239         EFrameControlStateInitializing,
       
   240         //  Loading frame
       
   241         EFrameControlStateLoadingFrame,
       
   242         //  Ready
       
   243         EFrameControlStateIdle,
       
   244         //  Invalid
       
   245         EFrameControlStateMax
       
   246     } iState;
       
   247     
       
   248     enum TFrameChangeDirection
       
   249         {
       
   250         // No direction
       
   251         ENoDirection = 0,
       
   252         // Direciton from right to left (x-axis)
       
   253         EPreviousFrame,
       
   254         // Direciton from left to right (x-axis)
       
   255         ENextFrame
       
   256 	    };
       
   257 //@}
       
   258     
       
   259 /** @name Members:*/
       
   260 //@{
       
   261     /// Editor view
       
   262     CAknView *					iEditorView;
       
   263     /// Plug-in info
       
   264     CPluginInfo *               iItem;
       
   265     /// Navigation pane text
       
   266     TBuf<64>                    iNaviPaneText;
       
   267     /// Frame file array
       
   268     CDesCArray*                 iFrameFileArray;
       
   269     /// Array of frames in each file
       
   270     RArray<TInt>                iMultiplicities;
       
   271     /// Current frame bitmap
       
   272     TInt                        iCurrentFrameIndex;
       
   273     /// Number of frame bitmaps
       
   274     TInt                        iFrameCount;
       
   275     /// Parameter
       
   276     TBuf<256>					iParameter;
       
   277     
       
   278     // Pointer event enablers
       
   279     // Pointer position in last pointer event
       
   280     TPoint                      iPointerPosition;
       
   281     // Position on button down event
       
   282     TPoint                      iInitialPointerPosition;
       
   283     // Position on button up event
       
   284     TPoint                      iFinalPointerPosition;
       
   285     // Whether stylus has been moved to one direction only or not 
       
   286     // (in x direction) 
       
   287     TBool                       iOneDirectionalChange;
       
   288     // Change direction on previous drag event
       
   289     TFrameChangeDirection       iPreviousChange;
       
   290     
       
   291 	// Feedback for screen touch:
       
   292 #ifdef RD_TACTILE_FEEDBACK 
       
   293 	MTouchFeedback* iTouchFeedBack;
       
   294 #endif /* RD_TACTILE_FEEDBACK  */
       
   295 //@}
       
   296 
       
   297 };
       
   298 
       
   299 
       
   300 #endif