camerauis/cameraapp/generic/inc/camoneclickuploadutility.h
branchRCL_3
changeset 24 bac7acad7cb3
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2008-2010 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:  Helper class for implementing one-click upload support
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMONECLICKUPLOADUTILITY_H
       
    20 #define CAMONECLICKUPLOADUTILITY_H
       
    21 
       
    22 
       
    23 #include <e32std.h>
       
    24 
       
    25 #include "CamSettingsInternal.hrh"
       
    26 #include "camimagedecoder.h"
       
    27 
       
    28 
       
    29 class CAiwServiceHandler;
       
    30 class AknToolbar;
       
    31 class CGulIcon;
       
    32 
       
    33 class CFbsBitmap;
       
    34 class CCamImageDecoder;
       
    35 class MCamImageDecoderObserver;
       
    36 
       
    37 /**
       
    38  *  Helper class for implementing one-click upload support
       
    39  *
       
    40  *  @since S60 v5.0
       
    41  */
       
    42 class CCamOneClickUploadUtility : public CBase,
       
    43                                   public MCamImageDecoderObserver
       
    44     {
       
    45 public:
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      */
       
    49     static CCamOneClickUploadUtility* NewL();
       
    50 
       
    51     /**
       
    52     * Destructor.
       
    53     */
       
    54     virtual ~CCamOneClickUploadUtility();
       
    55 
       
    56 public:
       
    57 
       
    58     /**
       
    59     * Check if one-click upload is supported.
       
    60     * @since S60 v5.0
       
    61     * @return A boolean value indicating if one-click upload support is present.
       
    62     */
       
    63     TBool OneClickUploadSupported() const;
       
    64 
       
    65     /**
       
    66     * Upload a file.
       
    67     * @since S60 v5.0
       
    68     * @param aFilename Full path to the file to be uploaded.
       
    69     */
       
    70     void UploadL( const TDesC& aFilename );
       
    71 
       
    72     /**
       
    73     * Upload multiple files.
       
    74     * @since S60 v5.0
       
    75     * @param aFilenames Full paths to the files to be uploaded.
       
    76     */
       
    77     void UploadL( const MDesC16Array& aFilenames );
       
    78 
       
    79     /**
       
    80     * Get the tooltip text for one-click upload button.
       
    81     * @since S60 v5.0
       
    82     * @return Tooltip text
       
    83     */
       
    84     const TDesC& ButtonTooltipL();
       
    85     
       
    86     /**
       
    87      * Get the current one click icon
       
    88      */
       
    89     void UpdateUploadIconL( CAknToolbar *aToolbar, TCamCameraMode aMode );
       
    90     
       
    91     /**
       
    92      * Launch Share settings view 
       
    93      */
       
    94     void LaunchShareSettings();
       
    95 
       
    96     /**
       
    97      * From MCamImageDecoderObserver
       
    98      */
       
    99     virtual void ImageDecodedL( TInt aStatus, const CFbsBitmap* aBitmap, 
       
   100                                const CFbsBitmap* aMask );    
       
   101     
       
   102 private:
       
   103     void ConstructL();
       
   104     void CheckVersionL();
       
   105     void InitializeAiwL();
       
   106     CCamOneClickUploadUtility();
       
   107     
       
   108     /**
       
   109     * Obtains the path for icon to be used. 
       
   110     * @param aMode the current camera mode
       
   111     * @param aPath descriptor containing the path of icon to be used 
       
   112     */
       
   113     void CurrentIconPathL( TCamCameraMode aMode, TDes& aPath ); 
       
   114 
       
   115     /**
       
   116     * Decodes / starts decoding of icon to be used.
       
   117     * @param aPath descriptor containing the path of icon to be used 
       
   118     */
       
   119     void DecodeIconL( TDesC* aPath );
       
   120 
       
   121 private: // Data
       
   122 
       
   123     TBool iUploadSupported;
       
   124 
       
   125     // Own
       
   126     CAiwServiceHandler* iAiwServiceHandler;
       
   127     
       
   128     CFbsBitmap*    iDecodedBitmap;
       
   129     CCamImageDecoder* iDecoder;    
       
   130 
       
   131     TFileName iIconFileName;
       
   132     CFbsBitmap* iIconImage;
       
   133     CFbsBitmap* iIconMask;
       
   134     
       
   135     CAknToolbar* iToolbar;
       
   136 
       
   137     // Own
       
   138     HBufC* iTooltip;
       
   139     };
       
   140 
       
   141 #endif // CAMONECLICKUPLOADUTILITY_H