|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CSENDASACTIVECONTAINER_H__ |
|
17 #define __CSENDASACTIVECONTAINER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 #include "msendassenderobserver.h" |
|
22 #include "msendaseditobserver.h" |
|
23 |
|
24 // forward declarations |
|
25 class CSendAsSender; |
|
26 class CSendAsEditWatcher; |
|
27 class CSendAsServer; |
|
28 |
|
29 /** |
|
30 A single instance of this class is owned by the sendas server and is used to |
|
31 observe background sendas operations, e.g. background sends and launched editors. |
|
32 |
|
33 Once an ownership of an operation has been moved to this class, the requesting |
|
34 subsession may be closed. |
|
35 |
|
36 When all outstanding tasks are completed, the container notifies the server, |
|
37 which can then shut down if it also has no open sessions. |
|
38 |
|
39 @internalComponent |
|
40 @released |
|
41 */ |
|
42 class CSendAsActiveContainer : public CActive, public MSendAsSenderObserver, public MSendAsEditObserver |
|
43 { |
|
44 public: |
|
45 static CSendAsActiveContainer* NewL(CSendAsServer& aServer); |
|
46 virtual ~CSendAsActiveContainer(); |
|
47 // |
|
48 void AddSenderL(CSendAsSender& aSender); |
|
49 void AddEditWatcherL(CSendAsEditWatcher& aEditorWatcher); |
|
50 TBool IsEmpty() const; |
|
51 void PurgeInactive(); |
|
52 private: |
|
53 CSendAsActiveContainer(CSendAsServer& aServer); |
|
54 void ConstructL(); |
|
55 // from CActive |
|
56 virtual void RunL(); |
|
57 virtual void DoCancel(); |
|
58 // from MSendAsSenderObserver |
|
59 virtual void SenderComplete(TInt aError); |
|
60 // from MSendAsEditObserver |
|
61 virtual void EditComplete(TInt aError); |
|
62 private: |
|
63 CSendAsServer& iServer; |
|
64 RPointerArray<CActive> iActiveList; |
|
65 }; |
|
66 |
|
67 #endif // __CSENDASACTIVECONTAINER_H__ |