profilesservices/ProfileEngine/EngSrc/CProfileVibraSettingsImpl.cpp
author hgs
Fri, 25 Jun 2010 17:09:30 +0800
changeset 40 6465d5bb863a
parent 36 48848d132687
permissions -rw-r--r--
201025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Profile PTT settings implementation.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include "CProfileVibraSettingsImpl.h"
hgs
parents:
diff changeset
    19
#include "ProfileEngUtils.h"
hgs
parents:
diff changeset
    20
#include "ProfileEnginePrivateCRKeys.h"
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include <ProfileInternal.hrh>
hgs
parents:
diff changeset
    23
#include <centralrepository.h>
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
// ============================ MEMBER FUNCTIONS ===============================
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
//Default Constructor
hgs
parents:
diff changeset
    29
CProfileVibraSettingsImpl::CProfileVibraSettingsImpl() : iAlertVibra( 0 )
hgs
parents:
diff changeset
    30
    {
hgs
parents:
diff changeset
    31
    
hgs
parents:
diff changeset
    32
    }
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    35
// CProfileTonesImpl::ConstructL
hgs
parents:
diff changeset
    36
// Symbian 2nd phase constructor can leave.
hgs
parents:
diff changeset
    37
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    38
//
hgs
parents:
diff changeset
    39
void CProfileVibraSettingsImpl::ConstructL()
hgs
parents:
diff changeset
    40
    {
hgs
parents:
diff changeset
    41
    
hgs
parents:
diff changeset
    42
    }
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    46
// CProfilePresenceImpl::NewL
hgs
parents:
diff changeset
    47
// Two-phased constructor.
hgs
parents:
diff changeset
    48
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    49
//
hgs
parents:
diff changeset
    50
CProfileVibraSettingsImpl *CProfileVibraSettingsImpl::NewL()
hgs
parents:
diff changeset
    51
    {
hgs
parents:
diff changeset
    52
    CProfileVibraSettingsImpl* self = new( ELeave ) CProfileVibraSettingsImpl;
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
    55
    self->ConstructL();
hgs
parents:
diff changeset
    56
    CleanupStack::Pop();
hgs
parents:
diff changeset
    57
hgs
parents:
diff changeset
    58
    return self;
hgs
parents:
diff changeset
    59
    }
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
// Destructor
hgs
parents:
diff changeset
    62
CProfileVibraSettingsImpl::~CProfileVibraSettingsImpl()
hgs
parents:
diff changeset
    63
    {
hgs
parents:
diff changeset
    64
    
hgs
parents:
diff changeset
    65
    }
hgs
parents:
diff changeset
    66
hgs
parents:
diff changeset
    67
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    68
// CProfileVibraSettingsImpl::InternalizeL
hgs
parents:
diff changeset
    69
//
hgs
parents:
diff changeset
    70
// (other items were commented in a header).
hgs
parents:
diff changeset
    71
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    72
//
hgs
parents:
diff changeset
    73
void CProfileVibraSettingsImpl::InternalizeL( CRepository& aCenRep,
hgs
parents:
diff changeset
    74
                                           TInt aProfileId )
hgs
parents:
diff changeset
    75
    {
hgs
parents:
diff changeset
    76
    User::LeaveIfError(
hgs
parents:
diff changeset
    77
            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngAlertVibra,
hgs
parents:
diff changeset
    78
            aProfileId ), iAlertVibra) );
hgs
parents:
diff changeset
    79
    }
hgs
parents:
diff changeset
    80
hgs
parents:
diff changeset
    81
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    82
// CProfileVibraSettingsImpl::ExternalizeL
hgs
parents:
diff changeset
    83
//
hgs
parents:
diff changeset
    84
// (other items were commented in a header).
hgs
parents:
diff changeset
    85
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    86
//
hgs
parents:
diff changeset
    87
void CProfileVibraSettingsImpl::ExternalizeL( CRepository& aCenRep,
hgs
parents:
diff changeset
    88
                                           TInt aProfileId ) const
hgs
parents:
diff changeset
    89
    {
hgs
parents:
diff changeset
    90
    User::LeaveIfError(
hgs
parents:
diff changeset
    91
            aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngAlertVibra,
hgs
parents:
diff changeset
    92
            aProfileId ), iAlertVibra ) );
hgs
parents:
diff changeset
    93
    }
hgs
parents:
diff changeset
    94
hgs
parents:
diff changeset
    95
hgs
parents:
diff changeset
    96
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    97
// CProfileVibraSettingsImpl::AlertVibra
hgs
parents:
diff changeset
    98
//
hgs
parents:
diff changeset
    99
// (other items were commented in a header).
hgs
parents:
diff changeset
   100
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   101
//
hgs
parents:
diff changeset
   102
TInt CProfileVibraSettingsImpl::AlertVibra() const
hgs
parents:
diff changeset
   103
    {
hgs
parents:
diff changeset
   104
    return iAlertVibra;
hgs
parents:
diff changeset
   105
    }
hgs
parents:
diff changeset
   106
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   109
// CProfileVibraSettingsImpl::RingAlertVibra
hgs
parents:
diff changeset
   110
//
hgs
parents:
diff changeset
   111
// (other items were commented in a header).
hgs
parents:
diff changeset
   112
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   113
//
hgs
parents:
diff changeset
   114
TBool CProfileVibraSettingsImpl::RingAlertVibra() const
hgs
parents:
diff changeset
   115
    {
hgs
parents:
diff changeset
   116
    return iAlertVibra & EProfileRingAlertVibra;
hgs
parents:
diff changeset
   117
    }
hgs
parents:
diff changeset
   118
hgs
parents:
diff changeset
   119
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   120
// CProfileVibraSettingsImpl::MessageAlertVibra
hgs
parents:
diff changeset
   121
//
hgs
parents:
diff changeset
   122
// (other items were commented in a header).
hgs
parents:
diff changeset
   123
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   124
// 
hgs
parents:
diff changeset
   125
TBool CProfileVibraSettingsImpl::MessageAlertVibra() const
hgs
parents:
diff changeset
   126
    {
hgs
parents:
diff changeset
   127
    return iAlertVibra & EProfileMessageAlertVibra;
hgs
parents:
diff changeset
   128
    }
hgs
parents:
diff changeset
   129
hgs
parents:
diff changeset
   130
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   131
// CProfileVibraSettingsImpl::EmailAlertVibra
hgs
parents:
diff changeset
   132
//
hgs
parents:
diff changeset
   133
// (other items were commented in a header).
hgs
parents:
diff changeset
   134
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   135
// 
hgs
parents:
diff changeset
   136
TBool CProfileVibraSettingsImpl::EmailAlertVibra() const
hgs
parents:
diff changeset
   137
    {
hgs
parents:
diff changeset
   138
    return iAlertVibra & EProfileEmailAlertVibra;
hgs
parents:
diff changeset
   139
    }
hgs
parents:
diff changeset
   140
hgs
parents:
diff changeset
   141
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   142
// CProfileVibraSettingsImpl::ReminderAlarmVibra
hgs
parents:
diff changeset
   143
//
hgs
parents:
diff changeset
   144
// (other items were commented in a header).
hgs
parents:
diff changeset
   145
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   146
// 
hgs
parents:
diff changeset
   147
TBool CProfileVibraSettingsImpl::ReminderAlarmVibra() const
hgs
parents:
diff changeset
   148
    {
hgs
parents:
diff changeset
   149
    return iAlertVibra & EProfileReminderAlarmVibra;
hgs
parents:
diff changeset
   150
    }
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   153
// CProfileVibraSettingsImpl::InformationVibra
hgs
parents:
diff changeset
   154
//
hgs
parents:
diff changeset
   155
// (other items were commented in a header).
hgs
parents:
diff changeset
   156
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   157
// 
hgs
parents:
diff changeset
   158
TBool CProfileVibraSettingsImpl::InformationVibra() const
hgs
parents:
diff changeset
   159
    {
hgs
parents:
diff changeset
   160
    return iAlertVibra & EProfileInformationVibra;
hgs
parents:
diff changeset
   161
    }
hgs
parents:
diff changeset
   162
hgs
parents:
diff changeset
   163
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   164
// CProfileVibraSettingsImpl::SetAlertVibra
hgs
parents:
diff changeset
   165
//
hgs
parents:
diff changeset
   166
// (other items were commented in a header).
hgs
parents:
diff changeset
   167
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   168
// 
hgs
parents:
diff changeset
   169
void CProfileVibraSettingsImpl::SetAlertVibra(TInt aAlertVibra)
hgs
parents:
diff changeset
   170
    {
hgs
parents:
diff changeset
   171
    iAlertVibra = aAlertVibra;
hgs
parents:
diff changeset
   172
    }
hgs
parents:
diff changeset
   173
hgs
parents:
diff changeset
   174
hgs
parents:
diff changeset
   175
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   176
// CProfileVibraSettingsImpl::SetRingAlertVibra
hgs
parents:
diff changeset
   177
//
hgs
parents:
diff changeset
   178
// (other items were commented in a header).
hgs
parents:
diff changeset
   179
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   180
// 
hgs
parents:
diff changeset
   181
void CProfileVibraSettingsImpl::SetRingAlertVibra(TBool aRingAlertVibra)
hgs
parents:
diff changeset
   182
    {
hgs
parents:
diff changeset
   183
    if ( aRingAlertVibra )
hgs
parents:
diff changeset
   184
        {
hgs
parents:
diff changeset
   185
        iAlertVibra |= EProfileRingAlertVibra;
hgs
parents:
diff changeset
   186
        }
hgs
parents:
diff changeset
   187
    else
hgs
parents:
diff changeset
   188
        {
hgs
parents:
diff changeset
   189
        iAlertVibra &= ~EProfileRingAlertVibra;
hgs
parents:
diff changeset
   190
        }
hgs
parents:
diff changeset
   191
    }
hgs
parents:
diff changeset
   192
hgs
parents:
diff changeset
   193
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   194
// CProfileVibraSettingsImpl::SetMessageAlertVibra
hgs
parents:
diff changeset
   195
//
hgs
parents:
diff changeset
   196
// (other items were commented in a header).
hgs
parents:
diff changeset
   197
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   198
//  
hgs
parents:
diff changeset
   199
void CProfileVibraSettingsImpl::SetMessageAlertVibra(TBool aMessageAlertVibra)
hgs
parents:
diff changeset
   200
    {
hgs
parents:
diff changeset
   201
    if ( aMessageAlertVibra )
hgs
parents:
diff changeset
   202
        {
hgs
parents:
diff changeset
   203
        iAlertVibra |= EProfileMessageAlertVibra;
hgs
parents:
diff changeset
   204
        }
hgs
parents:
diff changeset
   205
    else
hgs
parents:
diff changeset
   206
        {
hgs
parents:
diff changeset
   207
        iAlertVibra &= ~EProfileMessageAlertVibra;
hgs
parents:
diff changeset
   208
        }
hgs
parents:
diff changeset
   209
    }
hgs
parents:
diff changeset
   210
hgs
parents:
diff changeset
   211
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   212
// CProfileVibraSettingsImpl::SetEmailAlertVibra
hgs
parents:
diff changeset
   213
//
hgs
parents:
diff changeset
   214
// (other items were commented in a header).
hgs
parents:
diff changeset
   215
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   216
// 
hgs
parents:
diff changeset
   217
void CProfileVibraSettingsImpl::SetEmailAlertVibra(TBool aEmailAlertVibra)
hgs
parents:
diff changeset
   218
    {
hgs
parents:
diff changeset
   219
    if ( aEmailAlertVibra )
hgs
parents:
diff changeset
   220
        {
hgs
parents:
diff changeset
   221
        iAlertVibra |= EProfileEmailAlertVibra;
hgs
parents:
diff changeset
   222
        }
hgs
parents:
diff changeset
   223
    else
hgs
parents:
diff changeset
   224
        {
hgs
parents:
diff changeset
   225
        iAlertVibra &= ~EProfileEmailAlertVibra;
hgs
parents:
diff changeset
   226
        }
hgs
parents:
diff changeset
   227
    }
hgs
parents:
diff changeset
   228
hgs
parents:
diff changeset
   229
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   230
// CProfileVibraSettingsImpl::SetReminderAlarmVibra
hgs
parents:
diff changeset
   231
//
hgs
parents:
diff changeset
   232
// (other items were commented in a header).
hgs
parents:
diff changeset
   233
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   234
// 
hgs
parents:
diff changeset
   235
void CProfileVibraSettingsImpl::SetReminderAlarmVibra(TBool aReminderAlarmVibra)
hgs
parents:
diff changeset
   236
    {
hgs
parents:
diff changeset
   237
    if ( aReminderAlarmVibra )
hgs
parents:
diff changeset
   238
        {
hgs
parents:
diff changeset
   239
        iAlertVibra |= EProfileReminderAlarmVibra;
hgs
parents:
diff changeset
   240
        }
hgs
parents:
diff changeset
   241
    else
hgs
parents:
diff changeset
   242
        {
hgs
parents:
diff changeset
   243
        iAlertVibra &= ~EProfileReminderAlarmVibra;
hgs
parents:
diff changeset
   244
        }   
hgs
parents:
diff changeset
   245
    }
hgs
parents:
diff changeset
   246
hgs
parents:
diff changeset
   247
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   248
// CProfileVibraSettingsImpl::SetInformationVibra
hgs
parents:
diff changeset
   249
//
hgs
parents:
diff changeset
   250
// (other items were commented in a header).
hgs
parents:
diff changeset
   251
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   252
// 
hgs
parents:
diff changeset
   253
void CProfileVibraSettingsImpl::SetInformationVibra(TBool aInformationVibra)
hgs
parents:
diff changeset
   254
    {
hgs
parents:
diff changeset
   255
    if ( aInformationVibra )
hgs
parents:
diff changeset
   256
        {
hgs
parents:
diff changeset
   257
        iAlertVibra |= EProfileInformationVibra;
hgs
parents:
diff changeset
   258
        }
hgs
parents:
diff changeset
   259
    else
hgs
parents:
diff changeset
   260
        {
hgs
parents:
diff changeset
   261
        iAlertVibra &= ~EProfileInformationVibra;
hgs
parents:
diff changeset
   262
        }   
hgs
parents:
diff changeset
   263
    }
hgs
parents:
diff changeset
   264
hgs
parents:
diff changeset
   265
//End of File