radioengine/utils/inc/cradioenginetls.h
changeset 13 46974bebc798
child 28 075425b8d9a4
equal deleted inserted replaced
0:f3d95d9c00ab 13:46974bebc798
       
     1 /*
       
     2 * Copyright (c) 2009 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 C_RADIOENGINETLS_H
       
    20 #define C_RADIOENGINETLS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class MRadioEngineLogger;
       
    25 class CCoeEnv;
       
    26 class RFs;
       
    27 
       
    28 /**
       
    29  * TLS handler
       
    30  */
       
    31 class CRadioEngineTls : public CBase
       
    32     {
       
    33 
       
    34 friend class RadioEngineUtils;
       
    35 
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Returns the CRadioEngineTls instance from TLS
       
    40      *
       
    41      * @since Live TV UI v1.0
       
    42      * @return Reference to CRadioEngineTls instance
       
    43      */
       
    44     static CRadioEngineTls& Instance();
       
    45 
       
    46     /**
       
    47      * Return the logger storage if logging is enabled
       
    48      *
       
    49      * @since Live TV UI v1.0
       
    50      */
       
    51     static MRadioEngineLogger* Logger();
       
    52 
       
    53     /**
       
    54      * Return the eikon environment
       
    55      *
       
    56      * @since Live TV UI v1.0
       
    57      * @return Pointer to CEikonEnv
       
    58      */
       
    59     static CCoeEnv* Env();
       
    60 
       
    61     /**
       
    62      * Returns the file server session
       
    63      *
       
    64      * @since Live TV UI v1.0
       
    65      * @return Reference to file server session
       
    66      */
       
    67     static RFs& FsSession();
       
    68 
       
    69     /**
       
    70      * Increase reference count
       
    71      */
       
    72     void AddRef();
       
    73 
       
    74     /**
       
    75      * Decrease reference count
       
    76      * Deletes self when ref count reaches zero.
       
    77      */
       
    78     void Release();
       
    79 
       
    80 private:
       
    81 
       
    82     static void InitializeL( CCoeEnv* aEnv = NULL, RFs* aFs = NULL );
       
    83 
       
    84     CRadioEngineTls( CCoeEnv* aEnv, RFs* aFs );
       
    85 
       
    86     ~CRadioEngineTls();
       
    87 
       
    88     void ConstructL();
       
    89 
       
    90 #ifdef LOGGING_ENABLED
       
    91     /**
       
    92      * File logger
       
    93      * Own.
       
    94      */
       
    95     CRadioEngineLogger* iLogger;
       
    96 #endif
       
    97 
       
    98     /**
       
    99      * Pointer to the eikon environment
       
   100      * Not own.
       
   101      */
       
   102     CCoeEnv*    iEnv;
       
   103 
       
   104     /**
       
   105      * Flag to indicate whether or not the file server session is owned
       
   106      */
       
   107     TBool       iFsOwned;
       
   108 
       
   109     /**
       
   110      * File server session.
       
   111      * Own status determined by iFsOwned member variable
       
   112      */
       
   113     RFs*        iFs;
       
   114 
       
   115     /**
       
   116      * Reference count
       
   117      */
       
   118     TInt        iRefs;
       
   119 
       
   120     };
       
   121 
       
   122 #endif // C_RADIOENGINETLS_H