camerauis/cameraapp/generic/inc/CamSAEventActive.h
branchRCL_3
changeset 54 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 *
       
    14 * Description:  Handles system agent events*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 #ifndef CAMSAEVENTACTIVE_H
       
    20 #define CAMSAEVENTACTIVE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <saclient.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CCamAppController;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 * Active Object listening to events coming from System Agent
       
    33 * @since 2.8
       
    34 */
       
    35 
       
    36 class CCamSAEventActive : public CActive 
       
    37     {
       
    38     public: // Constructors and destructor
       
    39         /**
       
    40         * C++ constructor
       
    41         * @since 2.8
       
    42         * @param aController reference to CCamAppController instance
       
    43         * @param aSystemAgent System agent handle
       
    44         */
       
    45         CCamSAEventActive( CCamAppController& aController,
       
    46                             const RSystemAgent& aSystemAgent );
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CCamSAEventActive();
       
    52 
       
    53     public:
       
    54         /**
       
    55         * Issue a request to receive events from System Agent
       
    56         * @since 2.8
       
    57         */
       
    58         void IssueRequest();
       
    59 
       
    60     private: // Functions from base classes
       
    61         /**
       
    62         * From CActive, called when RunL() is trapped by Active Scheduler
       
    63         * @since 2.8
       
    64         * @param aError the error code trapped from RunL()
       
    65         * @return TInt KErrNone
       
    66         */
       
    67         TInt RunError( TInt aError );   
       
    68 
       
    69         /**
       
    70         * From CActive called when an event comes from System Agent
       
    71         * Calls HandleSAEvent in Controller to handle the event
       
    72         * @since 2.8
       
    73         */
       
    74         void RunL();
       
    75 
       
    76         /**
       
    77         * From CActive Cancel request
       
    78         * @since 2.8
       
    79         */
       
    80         void DoCancel();
       
    81 
       
    82     private:
       
    83         CCamAppController& iController;
       
    84         RSystemAgent iSystemAgent;
       
    85         TSysAgentEvent iSAEvent;
       
    86         TBool iRequestIssued;
       
    87     };
       
    88 
       
    89 #endif  // CAMSAEVENTACTIVE_H   
       
    90             
       
    91 // End of File