|
1 /* |
|
2 * Copyright (c) 2009 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: This header contains the base class that each service derives. |
|
15 * |
|
16 */ |
|
17 #ifndef __DMEVENTSERVICEBASE_H__ |
|
18 #define __DMEVENTSERVICEBASE_H__ |
|
19 |
|
20 //User include |
|
21 #include "DmEventNotifierCommon.h" |
|
22 #include "DmEventNotifierInternal.h" |
|
23 |
|
24 /** |
|
25 * The base class which defines the interface for a service |
|
26 * |
|
27 * @since S60 v5.2 |
|
28 */ |
|
29 class CDmEventServiceBase : public CBase |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Returns the publish subscribe key with the condition |
|
35 * |
|
36 * @since S60 v5.2 |
|
37 * @return P/S key with condition |
|
38 */ |
|
39 TPSKeyCondition GetPSKeyCondition() { return iPSKeyCondition;} |
|
40 |
|
41 /** |
|
42 * This function will wait until a service operation is complete. For example, during software uninstallation |
|
43 * this function returns only when the uninstallation is complete. |
|
44 * |
|
45 * @since S60 v5.2 |
|
46 * @return None. Can leave with system wide error |
|
47 */ |
|
48 |
|
49 virtual void WaitForRequestCompleteL() = 0; |
|
50 |
|
51 /** |
|
52 * This functions tells if the publish subscribe key exists or not. It is called |
|
53 * before registering the condition schedule. |
|
54 * |
|
55 * @since S60 v5.2 |
|
56 * @return ETrue if exists, otherwise EFalse |
|
57 */ |
|
58 virtual TBool IsKeyValid() = 0; |
|
59 |
|
60 /** |
|
61 * Returns the task name of the service, which should be unique in this application. |
|
62 * |
|
63 * @since S60 v5.2 |
|
64 * @return task name |
|
65 */ |
|
66 virtual const TDesC& TaskName() = 0; |
|
67 |
|
68 /** |
|
69 * Gets the service id and operation |
|
70 * |
|
71 * @since S60 v5.2 |
|
72 * @return task name |
|
73 */ |
|
74 void GetServiceIdAndOperation(THandlerServiceId& aService, THandlerOperation& aOperation ) |
|
75 { |
|
76 aService = iServiceId; |
|
77 aOperation = iOperation; |
|
78 } |
|
79 protected: |
|
80 |
|
81 /** |
|
82 * The Constructor |
|
83 * |
|
84 * @since S60 v5.2 |
|
85 * @param aPsKeyCondition - which holds the publish subscribe key detail and condition |
|
86 * @return the object |
|
87 */ |
|
88 CDmEventServiceBase(const TPSKeyCondition& aPsKeyCondition, THandlerServiceId aServiceId): |
|
89 iPSKeyCondition(aPsKeyCondition), iServiceId(aServiceId), iOperation(ENoOpn){}; |
|
90 |
|
91 protected: |
|
92 |
|
93 /** |
|
94 * The service |
|
95 */ |
|
96 THandlerServiceId iServiceId; |
|
97 |
|
98 /** |
|
99 * The operation in the service |
|
100 */ |
|
101 THandlerOperation iOperation; |
|
102 |
|
103 |
|
104 private: |
|
105 |
|
106 /** |
|
107 * Holds the publish subscribe key detail and condition |
|
108 */ |
|
109 const TPSKeyCondition iPSKeyCondition; |
|
110 |
|
111 }; |
|
112 |
|
113 #endif /* __DMEVENTSERVICEBASE_H__ */ |
|
114 // End of File |