ipcm_plat/connection_settings_shim_api/inc/cmconnectionmethod_shim.h
changeset 20 9c97ad6591ae
child 40 c5b848e6c7d1
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
       
     1 /*
       
     2  * Copyright (c) 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:  
       
    15  * Wrapper for CM Manager Symbian interface.
       
    16  */
       
    17 
       
    18 #ifndef CMCONNECTIONMETHOD_SHIM_H
       
    19 #define CMCONNECTIONMETHOD_SHIM_H
       
    20 
       
    21 // System includes
       
    22 
       
    23 #include <QString>
       
    24 #include <cmconnectionmethod.h>
       
    25 #include <cmconnectionmethoddef.h>
       
    26 #include <cmmanagerdefines_shim.h>
       
    27 
       
    28 // User includes
       
    29 
       
    30 // Forward declarations
       
    31 
       
    32 class CmConnectionMethodShimPrivate;
       
    33 
       
    34 // External data types
       
    35 
       
    36 // Constants
       
    37 
       
    38 // Class declaration
       
    39 
       
    40 /*!
       
    41     \class CmConnectionMethodShim
       
    42     \brief Implementation class for CM Manager Connection Method Shim.
       
    43 
       
    44     Wrapper for CM Manager Symbian interface.
       
    45     
       
    46     NOTE! This shim is supposed to be used only in middleware code. Usage
       
    47     must be agreed with ipconnmgmt package owner. Applications should use
       
    48     the Qt Bearer Management API instead.
       
    49 */
       
    50 
       
    51 class CONNECTIONSETTINGSSHIMDLL_EXPORT CmConnectionMethodShim
       
    52 {
       
    53 
       
    54 public:
       
    55 
       
    56     // Data types
       
    57 
       
    58     /*!
       
    59      *  Constructor.
       
    60      *  
       
    61      *  @param[in] cm CM Manager connection method object.
       
    62      */
       
    63     CmConnectionMethodShim(RCmConnectionMethod &cm);
       
    64 
       
    65     /*!
       
    66      *  Destructor.
       
    67      */
       
    68     ~CmConnectionMethodShim();
       
    69     
       
    70     /*!
       
    71      * Gets the value for a uint attribute.
       
    72      * Note: even though the name suggests int attribute, return value is
       
    73      * actually uint. This is how the function is specified in public
       
    74      * RCmConnectionMethod class as well.
       
    75      * 
       
    76      * @param attribute Identifies the attribute to be retrived.
       
    77      * @return Contains the requested uint attribute.
       
    78      */
       
    79     uint getIntAttribute(
       
    80         CMManagerShim::ConnectionMethodAttribute attribute) const;
       
    81 
       
    82     /*!
       
    83      * Gets the value for a bool attribute.
       
    84      * 
       
    85      * @param attribute Identifies the attribute to be retrived.
       
    86      * @return Contains the requested bool attribute.
       
    87      */
       
    88     bool getBoolAttribute(
       
    89         CMManagerShim::ConnectionMethodAttribute attribute) const;
       
    90 
       
    91     /*!
       
    92      * Gets the value for a 16 bit QString attribute.
       
    93      * 
       
    94      * @param attribute Identifies the attribute to be retrived.
       
    95      * @return Contains the requested QString attribute.
       
    96      */
       
    97     QString getStringAttribute(
       
    98         CMManagerShim::ConnectionMethodAttribute attribute) const;
       
    99     
       
   100     /*!
       
   101      * Gets the value for an 8 bit QString attribute.
       
   102      * 
       
   103      * @param attribute Identifies the attribute to be retrived.
       
   104      * @return Contains the requested QString attribute.
       
   105      */
       
   106     QString getString8Attribute(
       
   107         CMManagerShim::ConnectionMethodAttribute attribute) const;
       
   108     
       
   109     /*!
       
   110      * Sets the value for an uint attribute.
       
   111      * Note: even though the name suggests int attribute, parameter is
       
   112      * actually uint. This is how the function is specified in public
       
   113      * RCmConnectionMethod class as well.
       
   114      * 
       
   115      * @param attribute Identifies the attribute to be set.
       
   116      * @param value The value to be set.
       
   117      */
       
   118     void setIntAttribute(
       
   119         CMManagerShim::ConnectionMethodAttribute attribute,
       
   120         uint value);
       
   121 
       
   122     /*!
       
   123      * Sets the value for a bool attribute.
       
   124      * 
       
   125      * @param attribute Identifies the attribute to be set.
       
   126      * @param value The value to be set.
       
   127      */
       
   128     void setBoolAttribute(
       
   129         CMManagerShim::ConnectionMethodAttribute attribute,
       
   130         bool value);
       
   131 
       
   132     /*!
       
   133      * Sets the value for a 16 bit QString attribute.
       
   134      * 
       
   135      * @param attribute Identifies the attribute to be set.
       
   136      * @param value The value to be set.
       
   137      */
       
   138     void setStringAttribute(
       
   139         CMManagerShim::ConnectionMethodAttribute attribute, 
       
   140         QString value);
       
   141     
       
   142     /*!
       
   143      * Sets the value for an 8 bit QString attribute.
       
   144      * 
       
   145      * @param attribute Identifies the attribute to be set.
       
   146      * @param value The value to be set.
       
   147      */
       
   148     void setString8Attribute(
       
   149         CMManagerShim::ConnectionMethodAttribute attribute, 
       
   150         QString value);
       
   151     
       
   152     /*!
       
   153      * Try to delete the connection method. If it is referenced from 
       
   154      * any destination, then the references are removed and the connection
       
   155      * method is deleted.
       
   156      * 
       
   157      * @return True if connection method deleted.
       
   158      */
       
   159     bool deleteConnectionMethod();
       
   160     
       
   161     /*!
       
   162      * Update in the database.
       
   163      */        
       
   164     void update();
       
   165     
       
   166     /*!
       
   167      * Reload the contents of the connection method from database.
       
   168      * Any current changes made to the connection method are lost.
       
   169      */
       
   170     void refresh();
       
   171     
       
   172 protected:
       
   173     
       
   174 private:
       
   175     
       
   176 private: // data
       
   177     
       
   178     CmConnectionMethodShimPrivate *d_ptr;  //!< Private implementation
       
   179     
       
   180     // Friend classes
       
   181     
       
   182     /*
       
   183      * CmDestinationShimPrivate::AddConnectionMethodL needs direct access
       
   184      * to Connection Methods it is adding to the Destination.
       
   185      */
       
   186     friend class CmDestinationShimPrivate;
       
   187 };
       
   188 
       
   189 #endif /* CMCONNECTIONMETHOD_SHIM_H */