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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "tmssyncvol.h" |
|
20 #include "tmsclientserver.h" |
|
21 #include "tmsutility.h" |
|
22 |
|
23 using namespace TMS; |
|
24 |
|
25 // CONSTANTS |
|
26 _LIT_SECURITY_POLICY_PASS(KTMSServerReadPolicy); |
|
27 _LIT_SECURITY_POLICY_C1(KTMSServerWritePolicy, ECapabilityWriteUserData); |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // TMSSyncVol::TMSSyncVol |
|
31 // C++ default constructor can NOT contain any code, that |
|
32 // might leave. |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 TMSSyncVol::TMSSyncVol() |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // TMSSyncVol::ConstructL |
|
41 // Symbian 2nd phase constructor can leave. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 void TMSSyncVol::ConstructL() |
|
45 { |
|
46 TRACE_PRN_FN_ENT; |
|
47 TInt err = RProperty::Define(ESyncVolume, RProperty::EInt, |
|
48 KTMSServerReadPolicy, KTMSServerWritePolicy); |
|
49 TRACE_PRN_N1(_L("TMSSyncVol::ConstructL err:%d"),err); |
|
50 |
|
51 if (err != KErrAlreadyExists) |
|
52 { |
|
53 User::LeaveIfError(err); |
|
54 } |
|
55 TRACE_PRN_FN_EXT; |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // TMSSyncVol::NewL |
|
60 // Two-phased constructor. |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 TMSSyncVol* TMSSyncVol::NewL() |
|
64 { |
|
65 TMSSyncVol* self = new (ELeave) TMSSyncVol(); |
|
66 CleanupStack::PushL(self); |
|
67 self->ConstructL(); |
|
68 CleanupStack::Pop(self); |
|
69 return self; |
|
70 } |
|
71 |
|
72 // Destructor |
|
73 TMSSyncVol::~TMSSyncVol() |
|
74 { |
|
75 TRACE_PRN_FN_ENT; |
|
76 TInt err = RProperty::Delete(KTMSPropertyCategory, ESyncVolume); |
|
77 TRACE_PRN_N1(_L("TMSSyncVol::~TMSSyncVol err:%d"),err); |
|
78 TRACE_PRN_FN_ENT; |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // TMSSyncVol::SetSyncVol |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 void TMSSyncVol::SetSyncVol(TBool syncvol) |
|
86 { |
|
87 TRACE_PRN_FN_ENT; |
|
88 // TInt err(KErrNone); |
|
89 if (syncvol) |
|
90 { |
|
91 /*err =*/RProperty::Set(KTMSPropertyCategory, ESyncVolume, syncvol); |
|
92 } |
|
93 |
|
94 //TRACE_PRN_N1(_L("TMSSyncVol::SetSyncVol err:%d"),err); |
|
95 TRACE_PRN_FN_EXT; |
|
96 } |
|
97 |
|
98 // End of File |
|