1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 |
|
18 #ifndef CPPROFILEMODEL_H |
|
19 #define CPPROFILEMODEL_H |
|
20 |
|
21 #include "cpprofilewrappermacro.h" |
|
22 #include <QtCore/qglobal.h> |
|
23 #include <QString> |
|
24 #include <QtCore/QObject> |
|
25 class CpProfileModelPrivate; |
|
26 |
|
27 /*! |
|
28 Profile id is defined in profile engine |
|
29 */ |
|
30 enum ProfileWrapperProfileId |
|
31 { |
|
32 EProfileWapperStart = -1, |
|
33 EProfileWrapperGeneralId = 0, |
|
34 EProfileWrapperMeetingId = 2, |
|
35 EPRofileWrapperEnd |
|
36 }; |
|
37 class CpProfileSettings |
|
38 { |
|
39 public: |
|
40 QString mRingTone; |
|
41 QString mMessageTone; |
|
42 QString mEmailTone; |
|
43 QString mReminderTone; |
|
44 bool mNotificationTone; |
|
45 int mKeyTouchScreenTone; // 0-5 |
|
46 |
|
47 int mKeyTouchScreenVibra; //0-5 |
|
48 }; |
|
49 class PROFILE_WRAPPER_EXPORT CpProfileModel : QObject |
|
50 { |
|
51 Q_OBJECT |
|
52 public: |
|
53 CpProfileModel(QObject *parent = 0); |
|
54 ~CpProfileModel(); |
|
55 |
|
56 public: |
|
57 QString profileName(int profileId)const; |
|
58 QStringList profileNames()const; |
|
59 int activateProfile(int profileId); |
|
60 int activeProfileId() const; |
|
61 |
|
62 void profileSettings(int profileId, CpProfileSettings& profileSettings); |
|
63 void setProfileSettings(int profileId, CpProfileSettings& profileSettings ); |
|
64 |
|
65 QString ringTone() const; |
|
66 void setRingTone(const QString& filePath); |
|
67 |
|
68 int masterVolume() const; |
|
69 void setMasterVolume(int volume); |
|
70 |
|
71 |
|
72 bool masterVibra() const; |
|
73 void setMasterVibra(bool isVibra); |
|
74 |
|
75 bool silenceMode() const; |
|
76 void setSilenceMode(bool isSlience); |
|
77 |
|
78 /*! |
|
79 * For profile settings |
|
80 */ |
|
81 |
|
82 QString ringTone(int profileId)const; |
|
83 void setRingTone(int profileId, const QString& filePath); |
|
84 QString messageTone(int profileId) const; |
|
85 void setMessageTone(int profileId, const QString& filePath); |
|
86 QString emailTone(int profileId) const; |
|
87 void setEmailTone(int profileId, const QString& filePath); |
|
88 QString reminderTone(int profileId) const; |
|
89 void setReminderTone(int profileId, const QString& filePath); |
|
90 |
|
91 bool notificationTone(int profileId) const; |
|
92 void setNotificationTone(int profileId, bool isActive); |
|
93 |
|
94 int keyTouchScreenTone(int profileId) const; |
|
95 void setKeyTouchScreenTone(int profileId, int level); |
|
96 |
|
97 int keyTouchScreenVibra(int profileId)const; |
|
98 void setKeyTouchScreenVibra(int profileId, int level); |
|
99 |
|
100 private: |
|
101 CpProfileModelPrivate *const d_ptr; |
|
102 |
|
103 private: |
|
104 Q_DISABLE_COPY(CpProfileModel) |
|
105 Q_DECLARE_PRIVATE_D(d_ptr,CpProfileModel) |
|
106 }; |
|
107 |
|
108 #endif |
|