|
1 /* |
|
2 * Copyright (c) 2005-2006 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CONTENTPRIORITYMAP_H |
|
20 #define C_CONTENTPRIORITYMAP_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32hashtab.h> |
|
24 |
|
25 namespace AiUtility { |
|
26 |
|
27 /** |
|
28 * Content priority map for UI controllers. |
|
29 * |
|
30 * @lib aiutils.lib |
|
31 * @since S60 3.2 |
|
32 */ |
|
33 class CContentPriorityMap : public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 /** |
|
38 * Creates and returns a new instance of this class. |
|
39 * |
|
40 * @post CurrentPriority(*) == KErrNotFound |
|
41 */ |
|
42 IMPORT_C static CContentPriorityMap* NewL(); |
|
43 |
|
44 virtual ~CContentPriorityMap(); |
|
45 |
|
46 /** |
|
47 * Returns the current priority assigned to UI element. |
|
48 * |
|
49 * @param aUiElementId textual identifier of the UI element. |
|
50 * @return Current priority set to ui element or KErrNotFound if not set. |
|
51 */ |
|
52 IMPORT_C TInt CurrentPriority( const TDesC8& aUiElementId ) const; |
|
53 |
|
54 /** |
|
55 * Sets the current priority assigned to UI element. |
|
56 * |
|
57 * @param aUiElementId textual identifier of the UI element. |
|
58 * @param aPriority priority value to set. |
|
59 * @return KErrNone if priority was set succesfully, otherwise one of |
|
60 * the system-wide error codes. |
|
61 * @post CurrentPriority(aUiElementId) == aPriority |
|
62 */ |
|
63 IMPORT_C TInt SetCurrentPriority( const TDesC8& aUiElementId, TInt aPriority ); |
|
64 |
|
65 /** |
|
66 * Clears the current priority assigned to UI element. |
|
67 * |
|
68 * @param aUiElementId textual identifier of the UI element. |
|
69 * @post CurrentPriority(aUiElementId) == KErrNotFound |
|
70 */ |
|
71 IMPORT_C void ClearPriority( const TDesC8& aUiElementId ); |
|
72 |
|
73 /** |
|
74 * Clears all priority assignments of this map. |
|
75 */ |
|
76 IMPORT_C void Reset(); |
|
77 |
|
78 /** |
|
79 * Tests if content with given priority may override |
|
80 * current content in given ui element. |
|
81 * |
|
82 * @param aUiElementId textual identifier of the UI element. |
|
83 * @param aNewPriority priority of the new content. |
|
84 */ |
|
85 IMPORT_C TBool OverrideContent( const TDesC8& aUiElementId, TInt aNewPriority ) const; |
|
86 |
|
87 private: |
|
88 |
|
89 CContentPriorityMap(); |
|
90 |
|
91 private: // data |
|
92 |
|
93 RPtrHashMap<TDesC8,TInt> iPriorityMap; |
|
94 |
|
95 }; |
|
96 |
|
97 |
|
98 } // namespace AiUtility |
|
99 |
|
100 #endif // C_CONTENTPRIORITYMAP_H |