bluetoothengine/btui/inc/btqtconstants.h
changeset 40 997690c3397a
parent 33 837dcc42fd6a
child 57 5ebadcda06cb
equal deleted inserted replaced
37:91746b151f97 40:997690c3397a
    17 
    17 
    18 #ifndef BTQTCONSTANTS_H
    18 #ifndef BTQTCONSTANTS_H
    19 #define BTQTCONSTANTS_H
    19 #define BTQTCONSTANTS_H
    20 
    20 
    21 #include <btengconstants.h>
    21 #include <btengconstants.h>
       
    22 #include <btserversdkcrkeys.h>
    22 
    23 
    23 
    24 
    24 // RSSI value range: -127dB ~ +20dB
    25 // RSSI value range: -127dB ~ +20dB
    25 const int RssiMinRange = -127;
    26 const int RssiMinRange = -127;
    26 
    27 
    30 
    31 
    31 const int RssiHighStrength = -46;
    32 const int RssiHighStrength = -46;
    32 
    33 
    33 const int RssiInvalid = RssiMinRange - 1;
    34 const int RssiInvalid = RssiMinRange - 1;
    34 
    35 
       
    36 enum PowerStateQtValue {
       
    37     BtPowerOff = 0,
       
    38     BtPowerOn,     
       
    39     BtPowerUnknown  // only for error situations
       
    40 };
       
    41 
       
    42 enum DisconnectOption {
       
    43     ServiceLevel = 0,
       
    44     PhysicalLink, 
       
    45     AllOngoingConnections,
       
    46     DisconUnknown
       
    47 };
       
    48 
    35 enum VisibilityMode {
    49 enum VisibilityMode {
    36     BtHidden = 0x10,  // using a different number space than TBTVisibilityMode
    50     BtHidden = 0x10,  // using a different number space than TBTVisibilityMode
    37     BtVisible,
    51     BtVisible,
    38     BtTemporary,
    52     BtTemporary,
    39     BtUnknown
    53     BtVisibilityUnknown
    40     
       
    41 };
    54 };
    42 
    55 
    43 // used for mapping between UI row and VisibilityMode item
    56 // used for mapping between UI row and VisibilityMode item
    44 enum VisibilityModeUiRowMapping {
    57 enum VisibilityModeUiRowMapping {
    45     UiRowBtHidden = 0,
    58     UiRowBtHidden = 0,
    46     UiRowBtVisible,
    59     UiRowBtVisible,
    47     UiRowBtTemporary
    60     UiRowBtTemporary,
       
    61     UiRowBtUnknown
    48 };
    62 };
       
    63 
    49 
    64 
    50 inline VisibilityMode QtVisibilityMode(TBTVisibilityMode btEngMode)
    65 inline VisibilityMode QtVisibilityMode(TBTVisibilityMode btEngMode)
    51 {
    66 {
    52     VisibilityMode mode; 
    67     VisibilityMode mode; 
    53     switch(btEngMode) {
    68     switch(btEngMode) {
    59         break;
    74         break;
    60     case EBTVisibilityModeTemporary:
    75     case EBTVisibilityModeTemporary:
    61         mode = BtTemporary;
    76         mode = BtTemporary;
    62         break;
    77         break;
    63     default:
    78     default:
    64         mode = BtUnknown;
    79         mode = BtVisibilityUnknown;
    65     }
    80     }
    66     return mode;
    81     return mode;
    67 }
    82 }
    68 
    83 
    69 inline TBTVisibilityMode  BtEngVisibilityMode(VisibilityMode btQtMode)
    84 inline TBTVisibilityMode  BtEngVisibilityMode(VisibilityMode btQtMode)
    83         mode = (TBTVisibilityMode)KErrUnknown;
    98         mode = (TBTVisibilityMode)KErrUnknown;
    84     }
    99     }
    85     return mode;
   100     return mode;
    86 }
   101 }
    87 
   102 
       
   103 inline PowerStateQtValue QtPowerMode(TBTPowerStateValue btEngMode)
       
   104 {
       
   105     PowerStateQtValue mode; 
       
   106     switch(btEngMode) {
       
   107     case EBTPowerOff:
       
   108         mode = BtPowerOff;
       
   109         break;
       
   110     case EBTPowerOn:
       
   111         mode = BtPowerOn;
       
   112         break;
       
   113     default:
       
   114         mode = BtPowerUnknown;  // error
       
   115     }
       
   116     return mode;
       
   117 }
       
   118 
       
   119 inline TBTPowerStateValue BtEngPowerState(PowerStateQtValue qtPowerState)
       
   120 {
       
   121     TBTPowerStateValue btEngPowerState;
       
   122     switch (qtPowerState){
       
   123     case BtPowerOff:
       
   124         btEngPowerState = EBTPowerOff;
       
   125         break;
       
   126     case BtPowerOn:
       
   127         btEngPowerState = EBTPowerOn;
       
   128         break;
       
   129     default:
       
   130         btEngPowerState = (TBTPowerStateValue)KErrUnknown;
       
   131     }
       
   132     return btEngPowerState;
       
   133 }
    88 
   134 
    89 #endif // BTQTCONSTANTS_H
   135 #endif // BTQTCONSTANTS_H