25
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2005 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: Phone ringing tone server definitions.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __PHONERINGINGTONESRV_H
|
|
20 |
#define __PHONERINGINGTONESRV_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <f32file.h>
|
|
24 |
#include <Profile.hrh>
|
|
25 |
#include "mphoneringingtonesrv.h"
|
|
26 |
|
|
27 |
// CONSTANTS
|
|
28 |
_LIT( KRingingToneServerName, "PhoneRingingToneSrv" );
|
|
29 |
const TInt KRingingToneSrvVersionMajor = 1;
|
|
30 |
const TInt KRingingToneSrvVersionMinor = 0;
|
|
31 |
const TInt KRingingToneSrvVersionBuild = 0;
|
|
32 |
|
|
33 |
// FORWARD DECLARATIONS
|
|
34 |
class CPhoneRingingToneSrvPlayerAO;
|
|
35 |
|
|
36 |
// CLASS DECLARATION
|
|
37 |
class CPhoneRingingToneServer : public CServer2,
|
|
38 |
public MPhoneRingingToneServer
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Two-phased constructor.
|
|
44 |
* @return new instance.
|
|
45 |
*/
|
|
46 |
static CPhoneRingingToneServer* NewLC();
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Destructor.
|
|
50 |
*/
|
|
51 |
~CPhoneRingingToneServer();
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Start session.
|
|
55 |
*/
|
|
56 |
TInt StartSession();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Close session.
|
|
60 |
*/
|
|
61 |
void CloseSession();
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Thread entry function.
|
|
65 |
*/
|
|
66 |
static TInt ThreadEntryFunc( TAny* aPtr );
|
|
67 |
|
|
68 |
/**
|
|
69 |
* From CServer, create a new session.
|
|
70 |
* @param aVersion It is the version of the client api.
|
|
71 |
* @param aMessage Connect message from Client.
|
|
72 |
* @return Returns a new session.
|
|
73 |
*/
|
|
74 |
CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
|
|
75 |
|
|
76 |
private:
|
|
77 |
/**
|
|
78 |
* C++ default constructor.
|
|
79 |
*/
|
|
80 |
CPhoneRingingToneServer();
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Symbian 2nd phase constructor.
|
|
84 |
*/
|
|
85 |
void ConstructL();
|
|
86 |
|
|
87 |
public:
|
|
88 |
// Ringing tone settings
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Sets extended security required flag.
|
|
92 |
* @param aNeeded Extended security required.
|
|
93 |
*/
|
|
94 |
void SetExtendedSecurityNeeded( TBool aNeeded );
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Sets extended security required flag.
|
|
98 |
* @param aLimit Extended security required.
|
|
99 |
*/
|
|
100 |
void SetToneFileSizeLimit( TInt aLimit );
|
|
101 |
|
|
102 |
/**
|
|
103 |
* Sets ringing tone.
|
|
104 |
*/
|
|
105 |
void SetRingingToneL( const RMessage2& aMessage );
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Sets default ringing tone.
|
|
109 |
* @param aMessage Message from Client.
|
|
110 |
*/
|
|
111 |
void SetDefaultRingingToneL( const RMessage2& aMessage );
|
|
112 |
|
|
113 |
// Playback control
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Play audio ring tone.
|
|
117 |
* @return True if the client message should not be completed.
|
|
118 |
* @param aMessage Message from Client.
|
|
119 |
*/
|
|
120 |
TBool PlayAudioRingTone( const RMessage2& aMessage );
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Play TTS tone simultaneously with Personal or Default tones.
|
|
124 |
* This method does not command phone to play TTS immediately. Instead
|
|
125 |
* it registers a request to play TTS, when Personal or default tones
|
|
126 |
* are played.
|
|
127 |
* @param aMessage Message from Client.
|
|
128 |
*/
|
|
129 |
void PlayTtsTone( const RMessage2& aMessage );
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Play default tone.
|
|
133 |
* @param aMessage Message from Client.
|
|
134 |
*/
|
|
135 |
void PlayDefaultTone( const RMessage2& aMessage );
|
|
136 |
|
|
137 |
/**
|
|
138 |
* Play backup tone.
|
|
139 |
* @param aMessage Message from Client.
|
|
140 |
*/
|
|
141 |
void PlayBackupTone( const RMessage2& aMessage );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Play silent tone. No_sound.wav will be played. If vibration alert
|
|
145 |
* is ON, it will vibrate.
|
|
146 |
*/
|
|
147 |
void PlaySilentTone();
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Playing the Beep once.
|
|
151 |
* @param aMessage Message from Client.
|
|
152 |
*/
|
|
153 |
void BeepOnce( const RMessage2& aMessage );
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Play unsecure VoIP tone.
|
|
157 |
* Play tone if secure call fails and call is changed to unsecure call.
|
|
158 |
*/
|
|
159 |
void PlayUnsecureVoIPTone();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Mutes ringing tone.
|
|
163 |
*/
|
|
164 |
void MuteRingingTone();
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Stops playing the ringing tone.
|
|
168 |
* Method does not do anything if ringing tone is not playing.
|
|
169 |
*/
|
|
170 |
void StopPlaying();
|
|
171 |
|
|
172 |
private:
|
|
173 |
|
|
174 |
/**
|
|
175 |
* Runs server.
|
|
176 |
*/
|
|
177 |
static void RunServerL();
|
|
178 |
|
|
179 |
private:
|
|
180 |
// File server connection
|
|
181 |
RFs iFs;
|
|
182 |
|
|
183 |
// Indicates is session already in use
|
|
184 |
TBool iSessionInUse;
|
|
185 |
|
|
186 |
// Player active object
|
|
187 |
CPhoneRingingToneSrvPlayerAO* iPlayer;
|
|
188 |
};
|
|
189 |
|
|
190 |
#endif
|