mtpdataproviders/mtppictbridgedp/pictbridgeengine/inc/dpsscriptsender.h
author hgs
Fri, 23 Jul 2010 18:35:35 +0800
changeset 35 c4c427c00f31
parent 29 3ae5cb0b4c02
permissions -rw-r--r--
201029_04
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     1
/*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     2
* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies).
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     3
* All rights reserved.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     8
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
     9
* Initial Contributors:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    11
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    12
* Contributors:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    13
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    14
* Description:  This class defines the dps script sending function. 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    15
*
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    16
*/
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    17
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    18
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    19
#ifndef DPSSCRIPTSENDER_H
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    20
#define DPSSCRIPTSENDER_H
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    21
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    22
#include <e32base.h>
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    23
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    24
class CDpsEngine;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    25
class CDpsStateMachine;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    26
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    27
/**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    28
*   This class is an active object. It sends the script to ptp server and 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    29
*   listens on the ptp server for notification of sending result.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    30
*/
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    31
NONSHARABLE_CLASS(CDpsScriptSender) : public CActive
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    32
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    33
    public:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    34
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    35
        *   Two phase constructor
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    36
        *   
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    37
        *   @param aOperator the pointer to the dps state machine
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    38
        *   @return a CDpsScriptSender instance
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    39
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    40
        static CDpsScriptSender* NewL(CDpsStateMachine* aOperator);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    41
		
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    42
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    43
        *   Destructor
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    44
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    45
        ~CDpsScriptSender();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    46
		
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    47
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    48
        *   Issues sending request
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    49
        *   @param aReply ETrue is the script is the reply, EFalse if the 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    50
        *   script is the request.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    51
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    52
        TInt SendScript(TBool aReply);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    53
	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    54
    private: // Functions derived from CActive.
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    55
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    56
        *   @see CActive
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    57
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    58
    	void RunL();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    59
    	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    60
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    61
        *   @see CActive
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    62
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    63
        void DoCancel();
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    64
	    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    65
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    66
        *   @see CActive
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    67
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    68
        TInt RunError(TInt aError);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    69
	    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    70
    private:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    71
        /**
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    72
        *   Default constructor
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    73
        *   
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    74
        *   @param aOperator the pointer to the dps state machine
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    75
        */
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    76
        CDpsScriptSender(CDpsStateMachine* aOperator);    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    77
	
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    78
    private:
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    79
        
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    80
        // not owned by this class
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    81
        CDpsStateMachine* iOperator;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    82
	   
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    83
        // telling if the current sending session is a reply or a request
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    84
        TBool iReply;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    85
    };
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    86
				
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    87
#endif