musicplayer_plat/mpx_music_player_app_api/inc/mpxtlshelper.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 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:  MPX TLS helper implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_MPXTLSHELPER_H
       
    21 #define C_MPXTLSHELPER_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <mpxconstants.h>
       
    27 
       
    28 
       
    29 // DATA TYPES
       
    30 
       
    31 /**
       
    32  * Structure used to store information in TLS.
       
    33  */
       
    34 NONSHARABLE_STRUCT( TMPXTlsStruct )
       
    35     {
       
    36     /**
       
    37      * Host application UID. Used in embedded mode.
       
    38      */
       
    39     TUid iHostUid;
       
    40 
       
    41     /**
       
    42      * Flag to indicate save is allowed. Used in embedded mode.
       
    43      */
       
    44     TBool iNeedSave;
       
    45 
       
    46     /**
       
    47      * Flag to indicate move is allowed. Used in embedded mode.
       
    48      */
       
    49     TBool iAllowMove;
       
    50 
       
    51     /**
       
    52      * Player init mode. Used in embedded mode.
       
    53      */
       
    54     TMPXLaunchMode iLaunchMode;
       
    55 
       
    56     /**
       
    57      * Usage count.
       
    58      */
       
    59     TInt useCount;
       
    60 
       
    61     /**
       
    62      * File Name of the saved clip
       
    63      */
       
    64     TFileName iFilePath;
       
    65     };
       
    66 
       
    67 
       
    68 // CLASS DECLARATION
       
    69 
       
    70 /**
       
    71  *  MPX TLS Helper.
       
    72  *
       
    73  *  @lib mpxcommonui.lib
       
    74  *  @since S60 v3.2.3
       
    75  */
       
    76 NONSHARABLE_CLASS( MPXTlsHelper )
       
    77     {
       
    78 public:
       
    79 
       
    80     /**
       
    81      * Initialize TLS for storing application information.
       
    82      *
       
    83      * @since S60 v3.2.3
       
    84      */
       
    85     IMPORT_C static void InitializeL();
       
    86 
       
    87     /**
       
    88      * Uninitialize TLS data storage. Must be called
       
    89      * before exiting application to unload resources.
       
    90      *
       
    91      * @since S60 v3.2.3
       
    92      */
       
    93     IMPORT_C static void Uninitialize();
       
    94 
       
    95     /**
       
    96      * Store host application UID to TLS.
       
    97      *
       
    98      * @since S60 v3.2.3
       
    99      * @param aUid Host application UIDs
       
   100      */
       
   101     IMPORT_C static void SetHostUidL( const TUid& aUid );
       
   102 
       
   103     /**
       
   104      * Fetch host application UID from TLS.
       
   105      *
       
   106      * @since S60 v3.2.3
       
   107      * @return Host application UID if application is in embedded mode
       
   108      */
       
   109     IMPORT_C static TUid HostUid();
       
   110 
       
   111     /**
       
   112      * Set 'need save' flag. If the flag is set,
       
   113      * user is asked to save the track when exiting embedded mode.
       
   114      *
       
   115      * @since S60 v3.2.3
       
   116      * @param aNeedSave ETrue if save query should be shown on exit
       
   117      */
       
   118     IMPORT_C static void SetNeedSave( TBool aNeedSave );
       
   119 
       
   120     /**
       
   121      * Get 'need save' flag. If the flag is set,
       
   122      * user is asked to save the track when exiting embedded mode.
       
   123      *
       
   124      * @since S60 v3.2.3
       
   125      * @return ETrue If save query should be shown on exit
       
   126      */
       
   127     IMPORT_C static TBool NeedSave();
       
   128 
       
   129     /**
       
   130      * Sets Allow Move flag.
       
   131      *
       
   132      * @since S60 v3.2.3
       
   133      * @param aAllowMove ETrue if the clip should be moved instead of copy
       
   134      */
       
   135     IMPORT_C static void SetAllowMove( TBool aAllowMove );
       
   136 
       
   137     /**
       
   138      * Gets Allow Move flag.
       
   139      *
       
   140      * @since S60 v3.2.3
       
   141      * @return ETrue if the clip should be moved instead of copy
       
   142      */
       
   143     IMPORT_C static TBool AllowMove();
       
   144 
       
   145     /**
       
   146      * Set launch mode.
       
   147      *
       
   148      * @since S60 v3.2.3
       
   149      * @param aMode Launch mode in embedded mode, see TMPXLaunchMode
       
   150      */
       
   151     IMPORT_C static void SetLaunchModeL( TMPXLaunchMode aMode );
       
   152 
       
   153     /**
       
   154      * Get launch mode.
       
   155      *
       
   156      * @since S60 v3.2.3
       
   157      * @return Launch mode in embedded mode, see TMPXLaunchMode
       
   158      */
       
   159     IMPORT_C static TMPXLaunchMode LaunchMode();
       
   160 
       
   161     /**
       
   162      * Get the full path of saved file name.
       
   163      *
       
   164      * @since S60 v3.2.3
       
   165      * @return path to saved clip
       
   166      */
       
   167     IMPORT_C static TFileName FilePath();
       
   168 
       
   169     /**
       
   170      * Set the full path of saved file name.
       
   171      *
       
   172      * @since S60 v3.2.3
       
   173      * @param aFilePath
       
   174      */
       
   175     IMPORT_C static void SetFilePath( const TDesC& aFilePath );
       
   176     };
       
   177 
       
   178 #endif  // C_MPXTLSHELPER_H
       
   179 
       
   180 // End of File