|
1 /* |
|
2 * Copyright (c) 2002-2008 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: Defines an internal class CAknsAppSkinInstanceCacheEntry which |
|
15 * encapsulates a single skin instance cache entry. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "AknsASICacheEntry.h" |
|
22 |
|
23 #include "AknsDebug.h" |
|
24 |
|
25 // ============================ MEMBER FUNCTIONS =============================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // C++ constructor can NOT contain any code, that |
|
29 // might leave. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CAknsAppSkinInstanceCacheEntry::CAknsAppSkinInstanceCacheEntry( |
|
33 const TAknsItemID& aID, CAknsItemData* aData ) |
|
34 // Explicit initialization required here! |
|
35 : iID( aID ), iRefCount(0), iData( aData ) |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // Two-phased constructor. |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CAknsAppSkinInstanceCacheEntry* CAknsAppSkinInstanceCacheEntry::NewL( |
|
44 const TAknsItemID& aID, CAknsItemData* aData ) |
|
45 { |
|
46 return new (ELeave) CAknsAppSkinInstanceCacheEntry( aID, aData ); |
|
47 } |
|
48 //lint -esym(1714,CAknsAppSkinInstanceCacheEntry::NewL) Defined for completeness |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // Destructor |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 CAknsAppSkinInstanceCacheEntry::~CAknsAppSkinInstanceCacheEntry() |
|
55 { |
|
56 delete iData; |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CAknsAppSkinInstanceCacheEntry::IncreaseRefCount() |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 void CAknsAppSkinInstanceCacheEntry::IncreaseRefCount() |
|
64 { |
|
65 iRefCount++; |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CAknsAppSkinInstanceCacheEntry::DecreaseRefCount() |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 void CAknsAppSkinInstanceCacheEntry::DecreaseRefCount() |
|
73 { |
|
74 __ASSERT_DEBUG(iRefCount>0,AKNS_DEBUG_PANIC(EAknsDPanicInvalidRefCount)); |
|
75 iRefCount--; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CAknsAppSkinInstanceCacheEntry::IsReferenced() |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 TBool CAknsAppSkinInstanceCacheEntry::IsReferenced() const |
|
83 { |
|
84 return (iRefCount > 0); |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CAknsAppSkinInstanceCacheEntry::LinearOrder() |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 TInt CAknsAppSkinInstanceCacheEntry::LinearOrder( |
|
92 const CAknsAppSkinInstanceCacheEntry& aFirst, |
|
93 const CAknsAppSkinInstanceCacheEntry& aSecond ) |
|
94 { |
|
95 return TAknsItemID::LinearOrder( aFirst.iID, aSecond.iID ); |
|
96 } |
|
97 |
|
98 // End of File |