|
1 /* |
|
2 * Copyright (c) 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: MXIMPRestrictedObjectCollection implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CXIMPRESTRICTEDOBJECTCOLLECTIONIMP_H |
|
19 #define CXIMPRESTRICTEDOBJECTCOLLECTIONIMP_H |
|
20 |
|
21 #include <e32std.h> |
|
22 #include <ximprestrictedobjectcollection.h> |
|
23 #include "ximpapiobjbase.h" |
|
24 |
|
25 |
|
26 /** |
|
27 * |
|
28 * @since S60 v3.2 |
|
29 */ |
|
30 class CXIMPRestrictedObjectCollectionImp : public CXIMPApiObjBase, |
|
31 public MXIMPRestrictedObjectCollection |
|
32 { |
|
33 public: |
|
34 |
|
35 /** The class ID. */ |
|
36 enum { KClassId = XIMPIMP_CLSID_CXIMPRESTRICTEDOBJECTCOLLECTIONIMP }; |
|
37 |
|
38 public: |
|
39 |
|
40 /* |
|
41 * Construction of instance |
|
42 * @param aObjectOwning. ETrue objects are owned by instance. |
|
43 * EFalse objects are not owned by instance. |
|
44 * Default = ETrue |
|
45 */ |
|
46 IMPORT_C static CXIMPRestrictedObjectCollectionImp* NewLC( TBool aObjectOwning = ETrue ); |
|
47 |
|
48 /* |
|
49 * Construction of instance |
|
50 * @param aObjectOwning. ETrue objects are owned by instance. |
|
51 * EFalse objects are not owned by instance. |
|
52 * Default = ETrue |
|
53 */ |
|
54 IMPORT_C static CXIMPRestrictedObjectCollectionImp* NewL( TBool aObjectOwning = ETrue ); |
|
55 |
|
56 |
|
57 public: |
|
58 |
|
59 /** |
|
60 * Destruction |
|
61 */ |
|
62 ~CXIMPRestrictedObjectCollectionImp(); |
|
63 |
|
64 |
|
65 private: |
|
66 |
|
67 /** |
|
68 * Construction |
|
69 * @param aObjectOwning. ETrue objects are owned by instance. |
|
70 * EFalse objects are not owned by instance. |
|
71 */ |
|
72 CXIMPRestrictedObjectCollectionImp( TBool aObjectOwning ); |
|
73 |
|
74 |
|
75 public: // From MXIMPBase |
|
76 |
|
77 /** |
|
78 * Implementation of MXIMPBase interface methods |
|
79 * @see MXIMPBase |
|
80 */ |
|
81 XIMPIMP_DECLARE_IF_BASE_METHODS |
|
82 |
|
83 public: // From MXIMPRestrictedObjectCollection |
|
84 |
|
85 void LookupByType( const MXIMPBase*& aObject, TInt32 aInterfaceId ) const; |
|
86 void AddOrReplaceTypeL( MXIMPBase* aObject ); |
|
87 void GetByType( MXIMPBase*& aObject, TInt32 aInterfaceId ); |
|
88 |
|
89 |
|
90 |
|
91 public: // New methods |
|
92 |
|
93 /** |
|
94 * Set object ownership |
|
95 * @param aObjectOwning. ETrue objects are owned by instance. |
|
96 * EFalse objects are not owned by instance. |
|
97 * Default = ETrue |
|
98 */ |
|
99 IMPORT_C void SetObjectOwnership( TBool aObjectOwning = ETrue ); |
|
100 |
|
101 private: // Helpers |
|
102 static TInt OrderIfIdAndApiObject( const TInt32* aIfId, |
|
103 const CXIMPApiObjBase& aRhs ); |
|
104 |
|
105 static TInt OrderApiObjects( const CXIMPApiObjBase& aLhs, |
|
106 const CXIMPApiObjBase& aRhs ); |
|
107 |
|
108 |
|
109 |
|
110 private: // data |
|
111 |
|
112 /** |
|
113 * Owning of objects. ETrue, Owns, EFalse does not own. |
|
114 */ |
|
115 TBool iOwnObjects; |
|
116 |
|
117 /** |
|
118 * OWN: Check iOwnObjects |
|
119 */ |
|
120 RXIMPObjOwningPtrArray< CXIMPApiObjBase > iApiObjects; |
|
121 |
|
122 }; |
|
123 |
|
124 |
|
125 #endif // CXIMPRESTRICTEDOBJECTCOLLECTIONIMP_H |
|
126 |
|
127 |
|
128 |
|
129 |