|
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 the License "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 * Declaration of class MCommsModel. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef MCOMMS_MODEL_H |
|
22 #define MCOMMS_MODEL_H |
|
23 |
|
24 // FORWARD DECLARATION |
|
25 |
|
26 // class CApListItem; |
|
27 class CApListItemList; |
|
28 class CActiveApDb; |
|
29 class CCommsDatabase; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Observer mixin class for Comms Model changes. |
|
35 * The main difference between being this observer and MActiveApDbObserver is |
|
36 * that when an MActiveApDbObserver is notified, the database can be locked |
|
37 * (so the notification is quite useless). An MCommsModelObserver is notified |
|
38 * about the change only when the changes are successfully read by |
|
39 * MCommsModelObserver - that is, in HandleCommsModelChangeL implementation |
|
40 * you can safely read cached AP-s from CommsModel (and never get KErrLocked). |
|
41 */ |
|
42 class MCommsModelObserver |
|
43 { |
|
44 public: // new methods |
|
45 |
|
46 /** |
|
47 * Handle change in comms model (AP-s). Derived classes must provide |
|
48 * this method. |
|
49 */ |
|
50 virtual void HandleCommsModelChangeL() = 0; |
|
51 |
|
52 }; |
|
53 |
|
54 /** |
|
55 * Comms model for the WML Browser. |
|
56 * Provides CommsDb / AP database handling. |
|
57 */ |
|
58 class MCommsModel |
|
59 { |
|
60 public: // new methods |
|
61 |
|
62 /** |
|
63 * Get Access Point Engine object. |
|
64 * @return Access Point Engine object. |
|
65 */ |
|
66 virtual CActiveApDb& ApDb() const = 0; |
|
67 |
|
68 /** |
|
69 * Get CommsDb object. |
|
70 * @return CommsDb object. |
|
71 */ |
|
72 virtual CCommsDatabase& CommsDb() const = 0; |
|
73 |
|
74 /** |
|
75 * Get a copy of access points in a list. |
|
76 * @return List of access points. The caller is responsible for |
|
77 * destroying the returned list. |
|
78 * @return List of access points. |
|
79 */ |
|
80 virtual CApListItemList* CopyAccessPointsL() = 0; |
|
81 |
|
82 /** |
|
83 * Get the pointer to model's cached access points. |
|
84 * The owner of the list is the model. List contents may be updated |
|
85 * if database update occurs. |
|
86 * @return List of access points. |
|
87 */ |
|
88 virtual const CApListItemList* AccessPointsL() = 0; |
|
89 |
|
90 /** |
|
91 * Refresh the cached access points. |
|
92 */ |
|
93 virtual void RefreshAccessPointsL() = 0; |
|
94 |
|
95 public: // observer support |
|
96 |
|
97 /** |
|
98 * Add an observer. Duplicates allowed. |
|
99 * @param aObserver The observer to add. |
|
100 */ |
|
101 virtual void AddObserverL( MCommsModelObserver& aObserver ) = 0; |
|
102 |
|
103 /** |
|
104 * Remove an observer. Does nothing if not added / already removed. |
|
105 * @param aObserver The observer to remove. |
|
106 */ |
|
107 virtual void RemoveObserver( MCommsModelObserver& aObserver ) = 0; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif |
|
112 |
|
113 // End of file |