|
1 /* |
|
2 * Copyright (c) 2007-2008 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: The effect info class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __SHWEFFECTINFO_H__ |
|
22 #define __SHWEFFECTINFO_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <e32base.h> |
|
27 |
|
28 #include "shwconstants.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * TShwEffectInfo, encapsulates the human readable name |
|
36 * and the uid of an effect. |
|
37 */ |
|
38 NONSHARABLE_CLASS( TShwEffectInfo ) |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Constructor. Initializes the object |
|
43 */ |
|
44 inline TShwEffectInfo() |
|
45 : iName( 0 ), |
|
46 iId( KNullUid ) |
|
47 {} |
|
48 |
|
49 /** |
|
50 * Assignment operator. Ensure that data members get |
|
51 * properly set |
|
52 */ |
|
53 inline void operator=( const TShwEffectInfo& aRhs ) |
|
54 { |
|
55 // need to set value as TPtrC does not have assignment |
|
56 // operator |
|
57 iName = aRhs.iName; |
|
58 iId = aRhs.iId; |
|
59 } |
|
60 |
|
61 /** |
|
62 * Comparison operator. |
|
63 * @param aRhs, the object to compare against |
|
64 */ |
|
65 inline TBool operator==( const TShwEffectInfo& aRhs ) |
|
66 { |
|
67 // just check the id |
|
68 return iId == aRhs.iId; |
|
69 } |
|
70 |
|
71 public: |
|
72 |
|
73 /** |
|
74 * Helper struct to identify the effects |
|
75 */ |
|
76 struct TEffectId |
|
77 { |
|
78 /** |
|
79 * Default constructor |
|
80 */ |
|
81 inline TEffectId (TUid aEffectUid, TInt aEffectIndex = 0) |
|
82 : iPluginUid (aEffectUid), iIndex (aEffectIndex) |
|
83 { |
|
84 } |
|
85 |
|
86 /** |
|
87 * Comparison operator |
|
88 * @param aRhs, the object to compare against |
|
89 */ |
|
90 inline TBool operator==( const TEffectId& aRhs ) |
|
91 { |
|
92 return iPluginUid == aRhs.iPluginUid && |
|
93 iIndex == aRhs.iIndex; |
|
94 } |
|
95 |
|
96 TUid iPluginUid; |
|
97 TUint iIndex; |
|
98 }; |
|
99 |
|
100 TEffectId iId; |
|
101 TBuf< NShwSlideshow::KMaxEffectNameLen > iName; |
|
102 |
|
103 }; |
|
104 |
|
105 |
|
106 |
|
107 #endif // __SHWEFFECTINFO_H__ |