|
1 /* |
|
2 * Copyright (c) 2002 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 * Interface for CBS Client |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __RCbsUi_h |
|
21 #define __RCbsUi_h |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include <e32base.h> |
|
25 #include <CbsCommon.h> |
|
26 #include <RCbs.h> |
|
27 |
|
28 #include "MCbs.h" |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Delecates calls to RCbs. |
|
35 */ |
|
36 class RCbsUi : public MCbs |
|
37 { |
|
38 public: // Constructor and destructor |
|
39 |
|
40 /** |
|
41 * Constructor. |
|
42 */ |
|
43 RCbsUi(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 ~RCbsUi(); |
|
49 |
|
50 public: // From MCbs |
|
51 |
|
52 TInt Connect(); |
|
53 void Close(); |
|
54 TVersion Version() const; |
|
55 |
|
56 // === Settings-related methods |
|
57 void GetReceptionStatus( TBool& aStatus ); |
|
58 TInt SetReceptionStatus( TBool aStatus ); |
|
59 void GetTopicDetectionStatus( TBool& aStatus ); |
|
60 TInt SetTopicDetectionStatus( TBool aStatus ); |
|
61 void GetLanguages( TCbsSettingsLanguages& aLanguages ); |
|
62 TInt SetLanguages( const TCbsSettingsLanguages& aLanguages ); |
|
63 void NotifySettingsChanged( TRequestStatus& aStatus, TCbsSettingsEvent& aEvent ); |
|
64 void NotifySettingsChangedCancel(); |
|
65 |
|
66 // === Topic Collection-related methods |
|
67 void StartCollectionBrowsing(); |
|
68 TBool HasNextCollectionTopic(); |
|
69 TInt NextCollectionTopic( TCbsTopicInfo& aInfo ); |
|
70 |
|
71 // === Topic list-related methods |
|
72 void GetTopicCount( TInt& aCount ); |
|
73 TInt GetTopic( const TInt aIndex, TCbsTopic& aTopic ); |
|
74 TInt FindTopicByNumber( TCbsTopicNumber aNumber, TCbsTopic& aTopic ); |
|
75 TInt DeleteTopic( TCbsTopicNumber aNumber ); |
|
76 TInt DeleteAllTopics(); |
|
77 TInt AddTopic( TCbsTopic& aTopic ); |
|
78 TInt ChangeTopicNameAndNumber( |
|
79 TCbsTopicNumber aOldNumber, |
|
80 TCbsTopicNumber aNewNumber, |
|
81 const TCbsTopicName& aName ); |
|
82 TInt ChangeTopicSubscriptionStatus( |
|
83 TCbsTopicNumber aNumber, TBool aNewStatus ); |
|
84 TInt ChangeTopicHotmarkStatus( TCbsTopicNumber aNumber, |
|
85 TBool aNewStatus ); |
|
86 void NotifyOnTopicListEvent( |
|
87 TRequestStatus& aStatus, |
|
88 const TInt aRequested, |
|
89 TCbsTopicListEvent& aEvent, |
|
90 TCbsTopicNumber& aNumber ); |
|
91 void NotifyOnTopicListEventCancel(); |
|
92 TInt GetNewTopicsCount( TInt& aCount ); |
|
93 TInt GetLatestTopicNumber( TCbsTopicNumber& aNumber ); |
|
94 void GetUnreadMessageCount( TInt& aCount ); |
|
95 void GetHotmarkedMessageHandle( TCbsMessageHandle& aMessage ); |
|
96 TInt NumberOfUnreadHotmarkedMessages(); |
|
97 TInt GetNextAndPrevTopicNumber( |
|
98 const TCbsTopicNumber& aCurrentTopicNumber, |
|
99 TCbsTopicNumber& aPrevTopicNumber, |
|
100 TCbsTopicNumber& aNextTopicNumber, |
|
101 TInt& aPosition ); |
|
102 |
|
103 // === Topic Messages-related methods |
|
104 TInt GetMessageCount( TCbsTopicNumber aNumber, TInt& aCount ); |
|
105 TInt GetMessage( TCbsTopicNumber aNumber, TInt aIndex, |
|
106 TCbsMessage& aMessage ); |
|
107 TInt FindMessageByHandle( |
|
108 const TCbsMessageHandle& aHandle, |
|
109 TCbsMessage& aMessage ); |
|
110 TInt GetMessageIndexByHandle( |
|
111 const TCbsMessageHandle& aHandle, TInt& aIndex ); |
|
112 TInt DeleteMessage( const TCbsMessageHandle& aHandle ); |
|
113 TInt SaveMessage( const TCbsMessageHandle& aHandle ); |
|
114 TInt LockMessage( const TCbsMessageHandle& aHandle ); |
|
115 TInt ReadMessage( const TCbsMessageHandle& aHandle ); |
|
116 TInt GetMessageContents( |
|
117 const TCbsMessageHandle& aHandle, |
|
118 TDes& aBuffer ); |
|
119 TInt GetNextAndPrevMessageHandle( |
|
120 const TCbsMessageHandle& aCurrentMsgHandle, |
|
121 TCbsMessageHandle& aPrevMsgHandle, |
|
122 TCbsMessageHandle& aNextMsgHandle, |
|
123 TInt& aPosition ); |
|
124 |
|
125 // Other methods |
|
126 TBool Connected() const; |
|
127 void Shutdown() const; |
|
128 |
|
129 private: // Data |
|
130 |
|
131 // Real cbs client |
|
132 RCbs iServer; |
|
133 |
|
134 }; |
|
135 |
|
136 #endif // __RCbsUi_h |
|
137 |
|
138 // End of file |