imgeditor_plat/image_editor_utilities_api/inc/Callback.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 * Forces an	asynchronous callback to be called.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef CALLBACK_H
       
    22 #define	CALLBACK_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "callbackmethod.h"
       
    26 
       
    27 /**
       
    28  *  Forces an	asynchronous callback to be called.
       
    29  *
       
    30  *  @code
       
    31  *   ?good_class_usage_example(s)
       
    32  *  @endcode
       
    33  *
       
    34  *  @lib ImageEditorUtils.lib
       
    35  *  @since S60 v5.0
       
    36  */
       
    37 class CObCallback : public CActive
       
    38 {
       
    39 
       
    40 public:
       
    41 
       
    42 /** @name Methods:*/
       
    43 //@{
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      * @param aMethod - observer reference
       
    48      * @param ?arg2 ?description
       
    49      */
       
    50      IMPORT_C static CObCallback * NewL (MObCallbackMethod * aMethod);
       
    51 
       
    52     /**
       
    53     * Destructor.
       
    54     */
       
    55     IMPORT_C ~CObCallback();
       
    56 		
       
    57     /**
       
    58      * Forces the active scheduler to do callback
       
    59      *
       
    60      * @since S60 ?S60_version
       
    61      * @param aParam - ID for callback, returned to observer
       
    62      * @param ?arg2 ?description
       
    63      * @return ?description
       
    64      */
       
    65      IMPORT_C void DoCallback (TInt aParam);
       
    66 
       
    67 protected:
       
    68 
       
    69 private:
       
    70 
       
    71 	CObCallback (MObCallbackMethod * aMethod);
       
    72 	
       
    73 	void ConstructL();
       
    74 
       
    75 // from base class CActive
       
    76 	
       
    77     /**
       
    78      * From CActive.
       
    79      * See CActive
       
    80      *
       
    81      * @since S60 ?S60_version
       
    82      */
       
    83      virtual void RunL();
       
    84 
       
    85 
       
    86     /**
       
    87      * From CActive.
       
    88      * See CActive
       
    89      *
       
    90      * @since S60 ?S60_version
       
    91      */
       
    92      virtual void DoCancel();
       
    93 
       
    94 	/** CompleteRequest
       
    95 	*
       
    96 	*	Force RunL
       
    97 	*
       
    98 	*	@param -
       
    99 	*	@return -
       
   100 	*/
       
   101     void CompleteRequest();
       
   102 
       
   103 private: // data
       
   104 
       
   105     /**
       
   106      * Observer reference
       
   107      */
       
   108 	  MObCallbackMethod *		iMethod;
       
   109 
       
   110     /**
       
   111      * Callback ID
       
   112      */	
       
   113 	  TInt                    iParam;
       
   114 };
       
   115 
       
   116 
       
   117 #endif // CALLBACK_H