localconnectivityservice/dun/client/inc/dunactive.h
branchRCL_3
changeset 20 4a793f564d72
parent 19 0aa8cc770c8a
child 21 74aa6861c87d
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Controls asynchronous requests between LOCOD and DUN server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CDUNACTIVE_H
       
    20 #define C_CDUNACTIVE_H
       
    21 
       
    22 #include <locodservicepluginobserver.h>
       
    23 
       
    24 class CDunPlugin;
       
    25 
       
    26 /**
       
    27  *  Class for accessing bearer statuses of CDunActive class
       
    28  *
       
    29  *  @since S60 v3.2
       
    30  */
       
    31 NONSHARABLE_CLASS( MDunActive )
       
    32     {
       
    33 
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Bearer
       
    38      *
       
    39      * @since S60 3.2
       
    40      * @return Bearer
       
    41      */
       
    42     virtual TLocodBearer Bearer() = 0;
       
    43 
       
    44     /**
       
    45      * Bearer status
       
    46      *
       
    47      * @since S60 3.2
       
    48      * @return Bearer status
       
    49      */
       
    50     virtual TBool BearerStatus() = 0;
       
    51 
       
    52     };
       
    53 
       
    54 /**
       
    55  *  Class that controls asynchronous requests between LOCOD and DUN server
       
    56  *
       
    57  *  @since S60 v3.2
       
    58  */
       
    59 NONSHARABLE_CLASS( CDunActive ) : public CActive, public MDunActive
       
    60     {
       
    61 
       
    62 public:
       
    63 
       
    64     /**
       
    65      * Two-phased constructor.
       
    66      * @param aPlugin Plugin
       
    67      * @param aBearer Brearer
       
    68      * @param aBearerStatus Bearer status
       
    69      * @return Instance of self
       
    70      */
       
    71     static CDunActive* NewL( CDunPlugin* aPlugin,
       
    72                              TLocodBearer aBearer,
       
    73                              TBool aBearerStatus );
       
    74 
       
    75     /**
       
    76      * Two-phased constructor.
       
    77      * @param aPlugin Plugin
       
    78      * @param aBearer Brearer
       
    79      * @param aBearerStatus Bearer status
       
    80      * @return Instance of self
       
    81      */
       
    82     static CDunActive* NewLC( CDunPlugin* aPlugin,
       
    83                               TLocodBearer aBearer,
       
    84                               TBool aBearerStatus );
       
    85 
       
    86     /**
       
    87     * Destructor.
       
    88     */
       
    89     virtual ~CDunActive();
       
    90 
       
    91     /**
       
    92      * Request function
       
    93      *
       
    94      * @since S60 3.2
       
    95      * @return Symbian Error code
       
    96      */
       
    97     TInt ServiceRequest();
       
    98 
       
    99 private:
       
   100 
       
   101     CDunActive( CDunPlugin* aPlugin,
       
   102                 TLocodBearer aBearer,
       
   103                 TBool aBearerStatus );
       
   104 
       
   105     void ConstructL();
       
   106 
       
   107 // from base class CActive
       
   108 
       
   109     /**
       
   110      * From CActive.
       
   111      * Called when read or write operation is ready.
       
   112      *
       
   113      * @since S60 3.2
       
   114      * @return None
       
   115      */
       
   116     void RunL();
       
   117 
       
   118     /**
       
   119      * From CActive.
       
   120      * Cancel current activity.
       
   121      *
       
   122      * @since S60 3.2
       
   123      * @return None
       
   124      */
       
   125     void DoCancel();
       
   126 
       
   127 // from base class MDunActive
       
   128 
       
   129     /**
       
   130      * From MDunActive.
       
   131      * Bearer
       
   132      *
       
   133      * @since S60 3.2
       
   134      * @return Bearer
       
   135      */
       
   136     TLocodBearer Bearer();
       
   137 
       
   138     /**
       
   139      * From MDunActive.
       
   140      * Bearer status
       
   141      *
       
   142      * @since S60 3.2
       
   143      * @return Bearer status
       
   144      */
       
   145     TBool BearerStatus();
       
   146 
       
   147 private:  // data
       
   148 
       
   149     /**
       
   150      * CDunPlugin
       
   151      * Not own. Passed by DunPlugin
       
   152      */
       
   153     CDunPlugin* iPlugin;
       
   154 
       
   155     /**
       
   156      * Bearer
       
   157      * Not own. Passed by DunPlugin
       
   158      */
       
   159     TLocodBearer iBearer;
       
   160 
       
   161     /**
       
   162      * Service state
       
   163      * Not own. Passed by DunPlugin
       
   164      */
       
   165     TBool iBearerStatus;
       
   166 
       
   167     };
       
   168 
       
   169 #endif  // C_CDUNACTIVE_H