|
1 /* |
|
2 * Copyright (c) 2002-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: Action interface in CF. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_CFACTIONINTERFACE_H |
|
20 #define M_CFACTIONINTERFACE_H |
|
21 |
|
22 class CCFActionSubscription; |
|
23 class MCFActionSubscriptionListener; |
|
24 class MCFActionOwner; |
|
25 class RThread; |
|
26 |
|
27 /** |
|
28 * Interface for actions. |
|
29 */ |
|
30 class MCFActionInterface |
|
31 { |
|
32 public: |
|
33 |
|
34 /** |
|
35 * Defines action. |
|
36 * Action is identified by an identifier and security policy. |
|
37 * Possible error values: |
|
38 * - KErrAlreadyExists, action already defined |
|
39 * |
|
40 * @since S60 5.0 |
|
41 * @param aActionIdentifier Action identifier. |
|
42 * @param aSecurityPolicy Security level for the action. |
|
43 * @param aOwnerPtr Pointer to the owner. |
|
44 * @return None |
|
45 */ |
|
46 virtual TInt DefineAction( const TDesC& aActionIdentifier, |
|
47 const TSecurityPolicy& aSecurityPolicy, |
|
48 const TUid& aOwnerUid, |
|
49 MCFActionOwner* aOwner ) = 0; |
|
50 |
|
51 /** |
|
52 * Subscribes for an action. When action is triggered |
|
53 * a notification is given through MCFActionSubscriptionListner |
|
54 * interface. |
|
55 * Possible error codes: |
|
56 * - KErrNotFound, specified action not defined |
|
57 * - KErrAccessDenied, not enough capabilities for the action |
|
58 * |
|
59 * @since S60 5.0 |
|
60 * @param aActionSubscription Action subscription. |
|
61 * @param aListener Action notification listener. |
|
62 * @param aClientThread Client thread. |
|
63 * @return KErrNone if no errors. |
|
64 */ |
|
65 virtual TInt SubscribeAction( |
|
66 CCFActionSubscription* aActionSubscription, |
|
67 MCFActionSubscriptionListener* aListener, |
|
68 RThread& aClientThread ) = 0; |
|
69 |
|
70 /** |
|
71 * Unsubscribes an action. |
|
72 * |
|
73 * @since S60 5.0 |
|
74 * @param aActionSubscription Action subscription. |
|
75 * @param aListener Action notification listener. |
|
76 * @return None |
|
77 */ |
|
78 virtual void UnsubscribeAction( CCFActionSubscription& aActionSubscription, |
|
79 MCFActionSubscriptionListener& aListener ) = 0; |
|
80 |
|
81 /** |
|
82 * Removes all subscriptions from the particular subscriber. |
|
83 * |
|
84 * @since S60 5.0 |
|
85 * @param aListener Subscription listener. |
|
86 * @return None. |
|
87 */ |
|
88 virtual void UnsubscribeActions( MCFActionSubscriptionListener& aListener ) = 0; |
|
89 |
|
90 /** |
|
91 * Inactivates actions defined by the client when the client |
|
92 * session is closed. |
|
93 * |
|
94 * @since S60 5.0 |
|
95 * @param aOwnerPtr Matching pointer to the owner. |
|
96 * @return None. |
|
97 */ |
|
98 virtual void DeregisterActions( MCFActionOwner* aOwner ) = 0; |
|
99 |
|
100 protected: |
|
101 |
|
102 // Deny destruction through this class |
|
103 virtual ~MCFActionInterface(){}; |
|
104 }; |
|
105 |
|
106 #endif//M_CFACTIONINTERFACE_H |