btobexprofiles/obexreceiveservices/bip/inc/BIPController.h
author hgs
Fri, 28 May 2010 17:03:06 +0300
changeset 32 19bd632b5100
child 40 997690c3397a
child 42 b72428996822
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Bip controller class declaration.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef _BIPCONTROLLER_H
hgs
parents:
diff changeset
    20
#define _BIPCONTROLLER_H
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
//INCLUDES
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#include <e32base.h>
hgs
parents:
diff changeset
    25
#include <obex.h>
hgs
parents:
diff changeset
    26
#include <obexutilsmessagehandler.h>
hgs
parents:
diff changeset
    27
#include <obexutilsuilayer.h>
hgs
parents:
diff changeset
    28
#include <obexutilsdialog.h>
hgs
parents:
diff changeset
    29
#include "obexutilspropertynotifier.h"
hgs
parents:
diff changeset
    30
#include "debug.h"
hgs
parents:
diff changeset
    31
#include <SrcsInterface.h>
hgs
parents:
diff changeset
    32
#include <obexutilspropertynotifier.h>
hgs
parents:
diff changeset
    33
#include <obexutilsglobalprogressdialog.h>
hgs
parents:
diff changeset
    34
#include <btengsettings.h>
hgs
parents:
diff changeset
    35
#include "btengdevman.h"
hgs
parents:
diff changeset
    36
#include <obexutilsdialog.h>
hgs
parents:
diff changeset
    37
hgs
parents:
diff changeset
    38
// FORWARD DECLARATIONS
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
class CBIPCapabilityHandler;
hgs
parents:
diff changeset
    41
class CBIPImageHandler;
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
// CLASS DECLARATION
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
/**
hgs
parents:
diff changeset
    47
*  The main controller for Basic Imaging Profile.
hgs
parents:
diff changeset
    48
*/
hgs
parents:
diff changeset
    49
NONSHARABLE_CLASS (CBIPController): public CSrcsInterface, public MObexServerNotify,
hgs
parents:
diff changeset
    50
                                    public MObexUtilsPropertyNotifyHandler, 
hgs
parents:
diff changeset
    51
                                    public MGlobalProgressCallback, public MGlobalNoteCallback,
hgs
parents:
diff changeset
    52
                                    public MBTEngDevManObserver
hgs
parents:
diff changeset
    53
    {
hgs
parents:
diff changeset
    54
public:
hgs
parents:
diff changeset
    55
    static CBIPController* NewL();
hgs
parents:
diff changeset
    56
    ~CBIPController();
hgs
parents:
diff changeset
    57
    
hgs
parents:
diff changeset
    58
private: // from CSrcsInterface
hgs
parents:
diff changeset
    59
    TBool IsOBEXActive();
hgs
parents:
diff changeset
    60
    void SetMediaType(TSrcsMediaType aMediaType);
hgs
parents:
diff changeset
    61
    TInt SetObexServer(CObexServer* aServer);
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
private: // from MObexServerNotify
hgs
parents:
diff changeset
    64
    void ErrorIndication(TInt aError);
hgs
parents:
diff changeset
    65
    void TransportUpIndication();
hgs
parents:
diff changeset
    66
    void TransportDownIndication();
hgs
parents:
diff changeset
    67
    TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo);
hgs
parents:
diff changeset
    68
    void ObexDisconnectIndication(const TDesC8& aInfo);
hgs
parents:
diff changeset
    69
    CObexBufObject* PutRequestIndication();
hgs
parents:
diff changeset
    70
    TInt PutPacketIndication();
hgs
parents:
diff changeset
    71
    TInt PutCompleteIndication();
hgs
parents:
diff changeset
    72
    CObexBufObject* GetRequestIndication(CObexBaseObject* aRequiredObject);
hgs
parents:
diff changeset
    73
    TInt GetPacketIndication();
hgs
parents:
diff changeset
    74
    TInt GetCompleteIndication();
hgs
parents:
diff changeset
    75
    TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo);
hgs
parents:
diff changeset
    76
    void AbortIndication();
hgs
parents:
diff changeset
    77
    
hgs
parents:
diff changeset
    78
private: // from MObexUtilsPropertyNotifyHandler
hgs
parents:
diff changeset
    79
    void HandleNotifyL(TMemoryPropertyCheckType aCheckType);
hgs
parents:
diff changeset
    80
    
hgs
parents:
diff changeset
    81
private: // from MGlobalProgressCallback
hgs
parents:
diff changeset
    82
    void HandleGlobalProgressDialogL(TInt aSoftkey); 
hgs
parents:
diff changeset
    83
    
hgs
parents:
diff changeset
    84
private: // from MGlobalNoteCallback
hgs
parents:
diff changeset
    85
    void HandleGlobalNoteDialogL(TInt aSoftkey);
hgs
parents:
diff changeset
    86
    
hgs
parents:
diff changeset
    87
private: // from MBTEngDevManObserver
hgs
parents:
diff changeset
    88
    void HandleGetDevicesComplete(TInt aErr, CBTDeviceArray* aDeviceArray);
hgs
parents:
diff changeset
    89
    
hgs
parents:
diff changeset
    90
private:
hgs
parents:
diff changeset
    91
    CBIPController();
hgs
parents:
diff changeset
    92
    void ConstructL();
hgs
parents:
diff changeset
    93
    
hgs
parents:
diff changeset
    94
    void CancelTransfer();
hgs
parents:
diff changeset
    95
    
hgs
parents:
diff changeset
    96
    void HandleError(TBool aAbort);
hgs
parents:
diff changeset
    97
    void HandleGetCapabilityRequestL();
hgs
parents:
diff changeset
    98
    void HandlePutImageRequestL();
hgs
parents:
diff changeset
    99
    TInt HandlePutCompleteIndication();
hgs
parents:
diff changeset
   100
    TInt RemoveCapabilityObject();
hgs
parents:
diff changeset
   101
    
hgs
parents:
diff changeset
   102
    TBool CheckCapacityL();
hgs
parents:
diff changeset
   103
    void LaunchReceivingIndicatorL();
hgs
parents:
diff changeset
   104
    inline TBool ReceivingIndicatorActive() const { return (iProgressDialog || iWaitDialog); }
hgs
parents:
diff changeset
   105
    void UpdateReceivingIndicator();
hgs
parents:
diff changeset
   106
    void CloseReceivingIndicator(TBool aResetDisplayedState = ETrue);
hgs
parents:
diff changeset
   107
    TInt GetDriveWithMaximumFreeSpaceL();
hgs
parents:
diff changeset
   108
    
hgs
parents:
diff changeset
   109
private:
hgs
parents:
diff changeset
   110
    enum TBipTransferState
hgs
parents:
diff changeset
   111
        {
hgs
parents:
diff changeset
   112
        ETransferIdle,
hgs
parents:
diff changeset
   113
        ETransferPut,
hgs
parents:
diff changeset
   114
        ETransferGet,
hgs
parents:
diff changeset
   115
        ETransferPutDiskError,
hgs
parents:
diff changeset
   116
        ETransferPutInitError,
hgs
parents:
diff changeset
   117
        ETransferPutCancel,
hgs
parents:
diff changeset
   118
        };
hgs
parents:
diff changeset
   119
    
hgs
parents:
diff changeset
   120
private: // Data
hgs
parents:
diff changeset
   121
    CBIPCapabilityHandler*      iBIPCapabilityHandler;
hgs
parents:
diff changeset
   122
    CObexBufObject*             iBTObject;
hgs
parents:
diff changeset
   123
    CObexServer*                iBTObexServer;
hgs
parents:
diff changeset
   124
    TBipTransferState           iBTTransferState;
hgs
parents:
diff changeset
   125
    TInt                        iDrive;
hgs
parents:
diff changeset
   126
    CBIPImageHandler*           iBIPImageHandler;
hgs
parents:
diff changeset
   127
    CObexBufObject*             iGetObject;
hgs
parents:
diff changeset
   128
    CObexUtilsPropertyNotifier* iLowMemoryActiveCDrive;
hgs
parents:
diff changeset
   129
    CObexUtilsPropertyNotifier* iLowMemoryActiveMMC;
hgs
parents:
diff changeset
   130
    TMsvId                      iMsvIdParent;
hgs
parents:
diff changeset
   131
    TMsvId                      iMsvIdAttach;
hgs
parents:
diff changeset
   132
    RFile                       iFile;
hgs
parents:
diff changeset
   133
    RFs                         iFs;
hgs
parents:
diff changeset
   134
    TFileName                   iFullPathFilename;
hgs
parents:
diff changeset
   135
    TFileName                   iCapabilityFileName;
hgs
parents:
diff changeset
   136
    TFileName                   iDefaultFolder;
hgs
parents:
diff changeset
   137
    TFileName                   iPreviousDefaultFolder;
hgs
parents:
diff changeset
   138
    CBufFlat                    *iBuf;
hgs
parents:
diff changeset
   139
    TBool                       iLengthHeaderReceived;
hgs
parents:
diff changeset
   140
    TInt                        iTotalSizeByte;
hgs
parents:
diff changeset
   141
    CGlobalProgressDialog*      iProgressDialog;
hgs
parents:
diff changeset
   142
    CGlobalDialog*              iWaitDialog;
hgs
parents:
diff changeset
   143
    TBool                       iNoteDisplayed;
hgs
parents:
diff changeset
   144
    CBTEngDevMan*               iDevMan;
hgs
parents:
diff changeset
   145
    CBTDeviceArray*             iResultArray;
hgs
parents:
diff changeset
   146
    TBTDeviceName               iRemoteDeviceName;
hgs
parents:
diff changeset
   147
    TFileName                   iReceivingFileName;
hgs
parents:
diff changeset
   148
    TFileName                   iCenRepFolder;
hgs
parents:
diff changeset
   149
    };
hgs
parents:
diff changeset
   150
    
hgs
parents:
diff changeset
   151
_LIT(KBipPanicCategory, "BIP");
hgs
parents:
diff changeset
   152
enum TBipPanicCode
hgs
parents:
diff changeset
   153
    {
hgs
parents:
diff changeset
   154
    EBipPanicNotBluetoothMediaType = 0,
hgs
parents:
diff changeset
   155
    };
hgs
parents:
diff changeset
   156
hgs
parents:
diff changeset
   157
#endif      //_BIPCONTROLLER_H
hgs
parents:
diff changeset
   158
hgs
parents:
diff changeset
   159
// End of File