localconnectivityservice/obexserviceman/utils/inc/obexutilsuilayer.h
branchRCL_3
changeset 39 4096754ee773
parent 38 3dcb815346df
child 40 52a167391590
equal deleted inserted replaced
38:3dcb815346df 39:4096754ee773
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef COBEXUTILSUILAYER_H
       
    20 #define COBEXUTILSUILAYER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <msvapi.h>
       
    25 #include <data_caging_path_literals.hrh> 
       
    26 #include <AknsUtils.h> 
       
    27 #include <eikdialg.h>
       
    28 #include <Obexutils.rsg>
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 const TUid KUidMsgTypeBt                 = {0x10009ED5};
       
    33 const TInt KObexUtilsMaxChar             = 80;
       
    34 const TInt KObexUtilsMaxCharToFromField  = 256;
       
    35 
       
    36 // Literals for resource location (drive, directory, file)
       
    37 _LIT( KObexUtilsFileDrive, "z:");
       
    38 _LIT( KObexUtilsResourceFileName, "obexutils.rsc" );
       
    39 
       
    40 // Icon file
       
    41 _LIT( KCommonUiBitmapFile, "MUIU.MBM" );
       
    42 
       
    43 // Cover display
       
    44 const TInt KEnumStart = 1;  // start of enumerations; start after ECmdNone
       
    45 const TInt KResourceNumberMask = 0x00000FFF;
       
    46 const TInt KFirstResourceOffset = (R_IR_CONNECTING & KResourceNumberMask);
       
    47 
       
    48 class CMsvOperation;
       
    49 
       
    50 // DATA TYPES
       
    51 
       
    52 enum TContextMedia
       
    53     {
       
    54     EBluetooth,
       
    55     EInfrared,
       
    56 	ENfc
       
    57     };
       
    58 
       
    59 /**
       
    60 * Backup status.
       
    61 * The value is controlled by FileManager
       
    62 */
       
    63 enum TFileManagerBkupStatusType
       
    64     {
       
    65     EFileManagerBkupStatusUnset   = 0x00000000,
       
    66     EFileManagerBkupStatusBackup  = 0x00000001,
       
    67     EFileManagerBkupStatusRestore = 0x00000002
       
    68     };
       
    69 
       
    70 // CLASS DECLARATION
       
    71 
       
    72 /**
       
    73 *  Utility methods for UI related functionality.
       
    74 *  
       
    75 */
       
    76 NONSHARABLE_CLASS(  TObexUtilsUiLayer )
       
    77     {
       
    78     public: // New functions
       
    79     
       
    80         typedef CArrayPtr<CFbsBitmap> CBitmapArray;
       
    81         
       
    82         /**
       
    83         * Launches an editor application for the given message.
       
    84         * @param aMessage The message to be launched in an application.
       
    85         * @param aSession A message server session.
       
    86         * @param aObserverRequestStatus Request status of the observer.
       
    87         * @return MSV operation
       
    88         */
       
    89         IMPORT_C static CMsvOperation* LaunchEditorApplicationOperationL( 
       
    90         	CMsvSession& aMsvSession,
       
    91         	CMsvEntry* aMessage,
       
    92             TRequestStatus& aObserverRequestStatus );
       
    93 
       
    94         /**
       
    95         * Launches an editor application for the given message.
       
    96         * @param aMessage The message to be launched in an application.
       
    97         * @param aSession A message server session.
       
    98         * @return Symbian OS errorcode.
       
    99         */
       
   100         IMPORT_C static TInt LaunchEditorApplicationL( CMsvEntry* aMessage,
       
   101                                                        CMsvSession& aSession );
       
   102 
       
   103         /**
       
   104          * LaunchFileManager by specific path and sort method
       
   105          * @Since S60 v5.0
       
   106          * @param aPath The directory where file manager should open
       
   107          * @param aSortMethod sort method to sort the files in aPath
       
   108          * @param isEmbeddedMode indicates start mode for file manager or standalone mode
       
   109          * @return None 
       
   110          */ 
       
   111         IMPORT_C static void LaunchFileManagerL( TDesC& aPath, TInt aSortMethod, TBool isEmbeddedMode);
       
   112         
       
   113              
       
   114         /**
       
   115          * Open the file by Launching the suitable S60 application  
       
   116          * @Since S60 v5.0
       
   117          * @return None
       
   118          */
       
   119         IMPORT_C static void LaunchEditorApplicationL (TMsvId& aMsvIdParent);
       
   120         
       
   121         /**
       
   122         * Shows an error note.
       
   123         * @param aResourceID A resource id for the note.
       
   124         * @return None.
       
   125         */
       
   126         IMPORT_C static void ShowErrorNoteL( const TInt& aResourceID );
       
   127 
       
   128         /**
       
   129         * Shows an information note.
       
   130         * @param aResourceID A resource id for the note.
       
   131         * @return None.
       
   132         */
       
   133         IMPORT_C static void ShowInformationNoteL( const TInt& aResourceID );
       
   134         
       
   135         /**
       
   136         * Reads contents of a resource into a buffer.
       
   137         * @parma aBuf The buffer.
       
   138         * @param aResourceID The id of the resource
       
   139         * @return None.
       
   140         */
       
   141         IMPORT_C static void ReadResourceL( TDes& aBuf,
       
   142                                             const TInt& aResourceID );
       
   143          
       
   144         /**
       
   145         * Shows an global information note.
       
   146         * @param aResourceID A resource id for the note.
       
   147         * @return None.
       
   148         */                                    
       
   149         IMPORT_C static void ShowGlobalConfirmationQueryL( const TInt& aResourceID );
       
   150 
       
   151         /**
       
   152          * Show global conformation query without animations or tones.
       
   153          * @Since S60 5.0
       
   154          * @aResourceID aREsourceID for loc string
       
   155          * @return TBool
       
   156          */
       
   157         IMPORT_C static TBool ShowGlobalConfirmationQueryPlainL( const TInt& aResourceID);
       
   158 
       
   159         /**
       
   160          * Show global conformation query
       
   161          * @Since S60 5.0
       
   162          * @aResourceID aREsourceID for loc string
       
   163          * @aFilePath location for those files received.
       
   164          * @return TBool
       
   165          */
       
   166         IMPORT_C static TBool ShowGlobalFileOpenConfirmationQueryL( const TInt& aResourceID, const TDesC& aFilePath);
       
   167         
       
   168 
       
   169         
       
   170         /**
       
   171         * Returns a resource id for a not supported operation.
       
   172         * @return The resource id.
       
   173         */
       
   174         IMPORT_C static TInt OperationNotSupported();
       
   175         
       
   176         /**
       
   177         * Returns an icon for the given context.
       
   178         * @param aContext The context.
       
   179         * @param aMedia The used media.
       
   180         * @return The resource id of the icon.
       
   181         */
       
   182         IMPORT_C static TInt ContextIcon( const TMsvEntry& aContext,
       
   183                                           TContextMedia aMedia );
       
   184 
       
   185         /**
       
   186         * Updates bitmaps accoding to given media.
       
   187         * @param aMedia The used media.
       
   188         * @param aNumberOfZoomStates The media.
       
   189         * @param aBitmapFile The bitmap file.
       
   190         * @param aStartBitmap The resource id of the start bitmap.
       
   191         * @param aEndBitmap The resource id of the start bitmap.
       
   192         * @return None.
       
   193         */
       
   194         IMPORT_C static void UpdateBitmaps( TUid aMedia, 
       
   195                                             TInt& aNumberOfZoomStates, 
       
   196                                             TFileName& aBitmapFile,
       
   197                                             TInt& aStartBitmap,
       
   198                                             TInt& aEndBitmap );
       
   199 
       
   200         /**
       
   201         * Create icons according to given media
       
   202         * @param aMedia The used media.
       
   203         * @param aIconArray The IconArray used by the caller
       
   204         */
       
   205         IMPORT_C static void CreateIconsL( TUid aMedia, CArrayPtr<CBitmapArray>* aIconArrays);  
       
   206 
       
   207         /**
       
   208          * Checks if backup process is running 
       
   209          */
       
   210         IMPORT_C TBool static IsBackupRunning();
       
   211         
       
   212         /**
       
   213         * Prepares dialog for execution
       
   214         * @param aResourceID Resource ID of the dialog
       
   215         * @param aDialog Dialog
       
   216         */
       
   217         void static PrepareDialogExecuteL( const TInt& aResourceID, CEikDialog* aDialog );
       
   218         
       
   219         /**
       
   220         * Check if cover display is enabled
       
   221         * return True if enabled
       
   222         */
       
   223         TBool static IsCoverDisplayL();
       
   224         
       
   225         /**
       
   226          * Check if process with given id is active now
       
   227          * return True if is active
       
   228          */
       
   229         TBool static ProcessExists( const TSecureId& aSecureId );
       
   230         
       
   231         /**
       
   232          * A dummy class for opening CMsvSession.
       
   233          */
       
   234          class CDummySessionObserver : public CBase , public MMsvSessionObserver
       
   235              {
       
   236              public:
       
   237                  void HandleSessionEventL( TMsvSessionEvent/*aEvent*/,
       
   238                      TAny* /*aArg1*/,
       
   239                      TAny* /*aArg2*/,
       
   240                      TAny* /*aArg3*/ ) {};
       
   241              };
       
   242     };
       
   243 
       
   244 #endif      // COBEXUTILSUILAYER_H
       
   245             
       
   246 // End of File