equal
deleted
inserted
replaced
|
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 "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 * Abstract interface for creating logs extensions. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __MLogsUiExtensionBase_H |
|
22 #define __MLogsUiExtensionBase_H |
|
23 |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * @internal This interface is internal to Logs. |
|
33 * |
|
34 * Base interface for Logs UI extensions. |
|
35 */ |
|
36 class MLogsUiExtensionBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Pushes this object on the cleanup stack. |
|
41 */ |
|
42 void PushL(); |
|
43 |
|
44 protected: |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~MLogsUiExtensionBase() =0; |
|
49 |
|
50 private: |
|
51 friend void Release(MLogsUiExtensionBase*); |
|
52 static void CleanupRelease(TAny* aObj); |
|
53 |
|
54 /** |
|
55 * Implement to release this object and any resources it owns. |
|
56 */ |
|
57 virtual void DoRelease() =0; |
|
58 }; |
|
59 |
|
60 inline void MLogsUiExtensionBase::PushL() |
|
61 { |
|
62 CleanupStack::PushL(TCleanupItem(CleanupRelease,this)); |
|
63 } |
|
64 |
|
65 inline MLogsUiExtensionBase::~MLogsUiExtensionBase() |
|
66 { |
|
67 } |
|
68 |
|
69 /** |
|
70 * Releases aObj. |
|
71 */ |
|
72 inline void Release(MLogsUiExtensionBase* aObj) |
|
73 { |
|
74 if (aObj) |
|
75 { |
|
76 aObj->DoRelease(); |
|
77 } |
|
78 } |
|
79 |
|
80 inline void MLogsUiExtensionBase::CleanupRelease(TAny* aObj) |
|
81 { |
|
82 Release(static_cast<MLogsUiExtensionBase*>(aObj)); |
|
83 } |
|
84 |
|
85 #endif |
|
86 |
|
87 |
|
88 // End of File |