1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // |
|
15 // apacln.h |
|
16 // |
15 |
17 |
16 |
18 |
17 #if !defined(__APACLN_H__) |
19 #ifndef __APACLN_H__ |
18 #define __APACLN_H__ |
20 #define __APACLN_H__ |
19 |
21 |
20 #if !defined(__APPARC_H__) |
|
21 #include <apparc.h> |
22 #include <apparc.h> |
22 #endif |
|
23 |
23 |
24 |
|
25 class TApaDocCleanupItem |
|
26 /** Allows CApaDocument-derived objects to be safely put onto the cleanup |
24 /** Allows CApaDocument-derived objects to be safely put onto the cleanup |
27 stack, by calling CApaProcess::DestroyDocument() should a leave or a call |
25 stack, by calling CApaProcess::DestroyDocument() should a leave or a call |
28 to CleanupStack::PopAndDestroy() occur. |
26 to CleanupStack::PopAndDestroy() occur. |
29 |
27 |
30 It is used as follows. |
28 It is used as follows. |
49 /** The document to destroy as part of cleanup. */ |
48 /** The document to destroy as part of cleanup. */ |
50 CApaDocument* iApaDoc; |
49 CApaDocument* iApaDoc; |
51 }; |
50 }; |
52 |
51 |
53 |
52 |
54 inline TApaDocCleanupItem::TApaDocCleanupItem(CApaProcess* aProcess,CApaDocument* aDoc) |
|
55 : iApaProcess(aProcess), iApaDoc(aDoc) |
|
56 /** Constructs a cleanup item object for the specified document. |
53 /** Constructs a cleanup item object for the specified document. |
57 |
54 |
58 @param aProcess A pointer to the process object that will be used to destroy the document. |
55 @param aProcess A pointer to the process object that will be used to destroy the document. |
59 @param aDoc The document to destroy as part of cleanup. */ |
56 @param aDoc The document to destroy as part of cleanup. */ |
|
57 inline TApaDocCleanupItem::TApaDocCleanupItem(CApaProcess* aProcess,CApaDocument* aDoc) |
|
58 : iApaProcess(aProcess), iApaDoc(aDoc) |
60 {} |
59 {} |
61 |
60 |
62 inline TApaDocCleanupItem::operator TCleanupItem() |
|
63 /** A TCleanupItem cast operator that enables the TApaDocCleanupItem object to be pushed to |
61 /** A TCleanupItem cast operator that enables the TApaDocCleanupItem object to be pushed to |
64 the cleanup stack as a TCleanupItem, so that the document will be properly destroyed |
62 the cleanup stack as a TCleanupItem, so that the document will be properly destroyed |
65 (by a call to CApaProcess::DestroyDocument()) should a leave or a call to |
63 (by a call to CApaProcess::DestroyDocument()) should a leave or a call to |
66 CleanupStack::PopAndDestroy() occur. */ |
64 CleanupStack::PopAndDestroy() occur. */ |
|
65 inline TApaDocCleanupItem::operator TCleanupItem() |
67 {return TCleanupItem(DoCleanup,this);} |
66 {return TCleanupItem(DoCleanup,this);} |
68 |
67 |
69 #endif |
68 #endif // __APACLN_H__ |