1 /* |
|
2 * Copyright (c) 2004-2007 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: Handles activation of sound files linked to skins. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PSLNSOUNDACTIVATOR_H |
|
20 #define PSLNSOUNDACTIVATOR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 #include <AknsItemID.h> |
|
25 |
|
26 class CPslnProfileSettingsLoader; |
|
27 |
|
28 // TYPE DEFINITIONS |
|
29 |
|
30 // Struct containing sound activation data. |
|
31 struct TPslnSoundActivatorEntry |
|
32 { |
|
33 // Filename for the audio file. |
|
34 TFileName iFullName; |
|
35 // Skin instance id. |
|
36 TAknsItemID iID; |
|
37 }; |
|
38 |
|
39 /** |
|
40 * Class that handles the activation of sound files linked to skins. |
|
41 * |
|
42 * @since 2.5 |
|
43 */ |
|
44 class CPslnSoundActivator : public CBase |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 * @return new instance of CPslnSoundActivator. |
|
51 */ |
|
52 static CPslnSoundActivator* NewLC(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CPslnSoundActivator(); |
|
58 |
|
59 /** |
|
60 * Collects sound files of the current. Call to this method |
|
61 * must precede any other calls (except construction). |
|
62 * @param aSkinPath path to collect from. |
|
63 * @param number of sound files found. |
|
64 */ |
|
65 void CollectSoundsL( const TDesC& aSkinPath, TInt& aCount ); |
|
66 |
|
67 /** |
|
68 * Activates sound files into profiles. |
|
69 */ |
|
70 void ActivateToProfilesL(); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * Symbian 2nd phase constructor can leave. |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 /** |
|
80 * Find the complete filename of the given sound file. |
|
81 */ |
|
82 void FindSoundFile( |
|
83 TDes& aFullName, |
|
84 const TDesC& aSoundFile, |
|
85 const TDesC& aSkinPath ); |
|
86 |
|
87 /** |
|
88 * Moves the sound files possibly in the skin directory. |
|
89 */ |
|
90 void MoveSoundFilesL(); |
|
91 |
|
92 /** |
|
93 * C++ default constructor. |
|
94 */ |
|
95 CPslnSoundActivator(); |
|
96 |
|
97 private: // Data |
|
98 |
|
99 /* |
|
100 * Array of sound activation entries. |
|
101 */ |
|
102 RArray<TPslnSoundActivatorEntry> iSoundArray; |
|
103 |
|
104 /* |
|
105 * Has the Profiles Tone Settings DLL already been loaded. |
|
106 */ |
|
107 TBool iProfilesDllLoaded; |
|
108 |
|
109 /* |
|
110 * A handle to a dynamically loadable DLL. |
|
111 */ |
|
112 RLibrary iProfilesDll; |
|
113 |
|
114 /* |
|
115 * Loads Profiles Tone Settings DLL dynamically to memory. |
|
116 * Allows use of the DLL through this pointer, but only for |
|
117 * methods implemented within. |
|
118 * Own. |
|
119 */ |
|
120 CPslnProfileSettingsLoader* iProfilesSetter; |
|
121 }; |
|
122 |
|
123 #endif // PSLNSOUNDACTIVATOR_H |
|
124 |
|
125 // End of File |
|