|
1 /* |
|
2 * Copyright (c) 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: Network identity related prioritizer. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AIPUBLISHPRIORITIZER_H |
|
20 #define C_AIPUBLISHPRIORITIZER_H |
|
21 |
|
22 // System includes |
|
23 #include <e32def.h> |
|
24 |
|
25 // User includes |
|
26 #include "ainwidpriorities.h" |
|
27 #include "aiprioritizer.h" |
|
28 |
|
29 // Forward declarations |
|
30 class CHsContentPublisher; |
|
31 |
|
32 |
|
33 /** |
|
34 * @ingroup group_devicestatusplugin |
|
35 * |
|
36 * Network identity related prioritizer. |
|
37 * |
|
38 * This class is used as proxy between publishers which publish data that |
|
39 * needs to be priorised and content observers. It keeps record of published |
|
40 * data and decides if new published data has high enough priority to go |
|
41 * through to content observer. |
|
42 * |
|
43 * @since S60 3.2 |
|
44 */ |
|
45 |
|
46 NONSHARABLE_CLASS( CAiPublishPrioritizer ) : public CBase, |
|
47 public MAiPublishPrioritizer |
|
48 { |
|
49 public: |
|
50 |
|
51 static CAiPublishPrioritizer* NewL( MAiContentObserver& aContentObserver, |
|
52 CHsContentPublisher& aPropertyExtension ); |
|
53 |
|
54 virtual ~CAiPublishPrioritizer(); |
|
55 |
|
56 |
|
57 // from MAiPublishPrioritizer |
|
58 |
|
59 void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, |
|
60 TInt aContent, |
|
61 TInt aResource, |
|
62 TInt aPriority ); |
|
63 |
|
64 void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, |
|
65 TInt aContent, |
|
66 const TDesC16& aText, |
|
67 TInt aPriority ); |
|
68 |
|
69 void TryToPublishL( MAiPublisherBroadcaster& aBroadcaster, |
|
70 TInt aContent, |
|
71 const TDesC8& aBuf, |
|
72 TInt aPriority ); |
|
73 |
|
74 void TryToCleanL( MAiPublisherBroadcaster& aBroadcaster, |
|
75 TInt aContent, |
|
76 TInt aPriority ); |
|
77 |
|
78 TInt NextPriority() const; |
|
79 |
|
80 |
|
81 private: |
|
82 |
|
83 CAiPublishPrioritizer( MAiContentObserver& aContentObserver, |
|
84 CHsContentPublisher& aPropertyExtension ); |
|
85 |
|
86 |
|
87 private: // data |
|
88 |
|
89 /** |
|
90 * Content observer. |
|
91 */ |
|
92 MAiContentObserver& iContentObserver; |
|
93 |
|
94 /** |
|
95 * Property extension. |
|
96 */ |
|
97 CHsContentPublisher& iPropertyExtension; |
|
98 |
|
99 /// Current priority |
|
100 TInt iPriority; |
|
101 }; |
|
102 |
|
103 |
|
104 #endif // C_AIPUBLISHPRIORITIZER_H |