|
1 /* |
|
2 * Copyright (c) 2002-2007 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 concrete class CAknsContainerDataContext |
|
15 * which implements a data context suitable for containers. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef AKNSCONTAINERDATACONTEXT_H |
|
21 #define AKNSCONTAINERDATACONTEXT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <AknsDataContext.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Concrete data context suitable for containers. |
|
30 * Implements data context that passes item reservation requests to root |
|
31 * data context and releases all items reserved when lifetime of the context |
|
32 * ends. Release requests are ignored. |
|
33 * AknsUtils::CreateDataContextForContainerL() creates contexts of this type. |
|
34 * |
|
35 * This is an internal class that contains no exported functions. |
|
36 * The class is not intended for derivation outside the library. |
|
37 * |
|
38 * @since 2.0 |
|
39 * |
|
40 * @internal |
|
41 */ |
|
42 NONSHARABLE_CLASS(CAknsContainerDataContext) : public CBase, public MAknsDataContext |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @par Exceptions: |
|
49 * If construction fails, leaves with an error code. |
|
50 * |
|
51 * @internal |
|
52 */ |
|
53 static CAknsContainerDataContext* NewL(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 * Releases all the items reserved using this context. |
|
58 * |
|
59 * @internal |
|
60 */ |
|
61 virtual ~CAknsContainerDataContext(); |
|
62 |
|
63 public: // Functions from MAknsDataContext |
|
64 |
|
65 /** |
|
66 * @copydoc MAknsDataContext::ReserveItemL() |
|
67 * |
|
68 * CAknsContainerDataContext implementation forwards request to the |
|
69 * root data context of application skin item. |
|
70 */ |
|
71 void ReserveItemL( const TAknsItemID& aID ); |
|
72 |
|
73 /** |
|
74 * @copydoc MAknsDataContext::ReleaseItem() |
|
75 * |
|
76 * CAknsContainerDataContext ignores release requests. Items are |
|
77 * released by destructor when the lifetime of the context ends. |
|
78 */ |
|
79 void ReleaseItem( const TAknsItemID& aID ); |
|
80 |
|
81 private: // Private constructors |
|
82 |
|
83 /** |
|
84 * C++ default constructor. |
|
85 * |
|
86 * @internal |
|
87 */ |
|
88 CAknsContainerDataContext(); |
|
89 |
|
90 private: // Data |
|
91 |
|
92 /** |
|
93 * Array for storing IDs of reserved items. |
|
94 */ |
|
95 RAknsItemIDArray iIDArray; |
|
96 |
|
97 }; |
|
98 |
|
99 #endif // AKNSCONTAINERDATACONTEXT_H |
|
100 |
|
101 // End of File |