smsprotocols/smsstack/smsu/inc/smsuact.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #ifndef __SMSUACT_H__
       
    21 #define __SMSUACT_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class CSmsuTimeout;
       
    26 
       
    27 
       
    28 /**
       
    29  *  Base class for SMS active objects.
       
    30  *  
       
    31  *  @publishedAll
       
    32  *  @released 
       
    33  */
       
    34 class CSmsuActiveBase : public CActive
       
    35 	{
       
    36 	friend class CSmsuTimeout;
       
    37 	
       
    38 public:
       
    39 	IMPORT_C ~CSmsuActiveBase();
       
    40 
       
    41 protected:
       
    42 	IMPORT_C CSmsuActiveBase(TInt aPriority);
       
    43 
       
    44 	IMPORT_C virtual void Complete(TInt aStatus);
       
    45 
       
    46 	IMPORT_C void   ConstructTimeoutL();
       
    47 
       
    48 	IMPORT_C void   CompleteMyself(TInt aStatus, TBool aSetActive = ETrue);
       
    49 	IMPORT_C void   CompleteMyselfAfterTimeout(TInt aStatus);
       
    50 
       
    51 	IMPORT_C void   TimedSetActive(const TTimeIntervalMicroSeconds32& aTimeIntervalMicroSeconds32);
       
    52 	IMPORT_C void   TimedSetActiveCancel();
       
    53 	IMPORT_C TBool  TimedOut() const;
       
    54 
       
    55 	IMPORT_C void   Queue(TRequestStatus& aStatus);
       
    56 
       
    57 	IMPORT_C TInt   RunError(TInt aError); //< Calls complete
       
    58 
       
    59 	/**
       
    60 	 *  Implements derived-class specified RunL() behaviour.
       
    61 	 *  
       
    62 	 *  This is called from RunL(). 
       
    63 	 */
       
    64     virtual void DoRunL()=0;
       
    65 
       
    66 	/**
       
    67 	 *  Implements derived-class specified Complete() behaviour.
       
    68 	 *  
       
    69 	 *  This is called from Complete().
       
    70 	 *  
       
    71 	 *  @param Active object status word 
       
    72 	 */
       
    73 	inline virtual void DoComplete(TInt&) {};
       
    74 
       
    75     IMPORT_C void RunL();
       
    76 
       
    77 protected:
       
    78 	/**
       
    79 	 *  Timer, to be activated by TimedSetActive().
       
    80 	 */
       
    81 	CSmsuTimeout* iSmsuTimeout;
       
    82 
       
    83 	/**
       
    84 	 *  Observer, set by Queue().
       
    85 	 */
       
    86 	TRequestStatus* iReport;
       
    87 	};
       
    88 
       
    89 #endif // __SMSUACT_H__