mtpdataproviders/mtppictbridgedp/pictbridgeengine/inc/dpsstatemachine.inl
author hgs
Fri, 25 Jun 2010 16:54:01 +0800
changeset 29 3ae5cb0b4c02
permissions -rw-r--r--
201025_07
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:  inline functions of CDpsStatemachine
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
#include "dpsstate.h"
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    20
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    21
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    22
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    23
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    24
//    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    25
void CDpsStateMachine::ScriptSentNotifyL(TBool aReply)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    26
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    27
    iCurState->ScriptSentNotifyL(aReply);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    28
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    29
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    30
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    31
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    32
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    33
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    34
void CDpsStateMachine::ScriptReceivedNotifyL(TBool aReply)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    35
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    36
    iCurState->ScriptReceivedNotifyL(aReply);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    37
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    38
        
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    39
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    40
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    41
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    42
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    43
void CDpsStateMachine::Error(TInt err)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    44
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    45
    iCurError = err;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    46
    iCurState->Error(err);
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    47
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    48
        
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    49
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    50
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    51
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    52
//    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    53
void CDpsStateMachine::SetState(MDpsState* aState)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    54
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    55
    iCurState = aState;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    56
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    57
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    58
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    59
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    60
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    61
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    62
MDpsState* CDpsStateMachine::IdleState() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    63
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    64
    return iIdleState;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    65
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    66
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    67
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    68
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    69
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    70
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    71
MDpsState* CDpsStateMachine::SendingReqState() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    72
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    73
    return iSendingReqState;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    74
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    75
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    76
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    77
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    78
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    79
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    80
MDpsState* CDpsStateMachine::WaitingRepState() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    81
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    82
    return iWaitingRepState; 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    83
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    84
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    85
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    86
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    87
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    88
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    89
MDpsState* CDpsStateMachine::SendingRepState() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    90
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    91
    return iSendingRepState;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    92
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    93
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    94
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    95
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    96
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    97
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    98
CDpsScriptReceiver* CDpsStateMachine::ScriptReceiver() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
    99
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   100
    return iScriptReceiver;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   101
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   102
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   103
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   104
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   105
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   106
//                
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   107
CDpsScriptSender* CDpsStateMachine::ScriptSender() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   108
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   109
    return iScriptSender;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   110
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   111
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   112
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   113
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   114
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   115
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   116
CDpsTransaction* CDpsStateMachine::Trader() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   117
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   118
    return iTrader;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   119
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   120
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   121
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   122
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   123
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   124
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   125
TDpsOperation CDpsStateMachine::Operation() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   126
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   127
    return iOperation;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   128
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   129
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   130
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   131
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   132
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   133
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   134
void CDpsStateMachine::SetOperation(TDpsOperation aOp)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   135
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   136
    iOperation = aOp;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   137
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   138
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   139
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   140
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   141
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   142
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   143
TMDpsOperation* CDpsStateMachine::MOperation() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   144
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   145
    return iMOperation;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   146
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   147
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   148
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   149
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   150
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   151
//
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   152
TDpsEvent CDpsStateMachine::Event() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   153
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   154
    return iEvent;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   155
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   156
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   157
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   158
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   159
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   160
//    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   161
void CDpsStateMachine::SetEvent(TDpsEvent aEvent)
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   162
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   163
    iEvent = aEvent;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   164
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   165
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   166
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   167
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   168
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   169
//    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   170
MDpsState* CDpsStateMachine::CurState() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   171
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   172
    return iCurState;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   173
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   174
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   175
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   176
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   177
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   178
//        
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   179
CDpsEngine* CDpsStateMachine::DpsEngine() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   180
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   181
    return iEngine;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   182
    }
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   183
    
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   184
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   185
// 
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   186
// ---------------------------------------------------------------------------
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   187
//            
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   188
TInt CDpsStateMachine::CurError() const
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   189
    {
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   190
    return iCurError;
3ae5cb0b4c02 201025_07
hgs
parents:
diff changeset
   191
    }