|
1 /* |
|
2 * Copyright (c) 2010 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 BTDELEGATEREMOTEDEVNAME_H |
|
19 #define BTDELEGATEREMOTEDEVNAME_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <btmanclient.h> |
|
23 //#include <btengconnman.h> |
|
24 //#include <btengdevman.h> |
|
25 #include <btservices/btsimpleactive.h> |
|
26 #include "btabstractdelegate.h" |
|
27 |
|
28 class BtuiModel; |
|
29 |
|
30 enum RequestIdentifiers { |
|
31 Unknown = 0, // using a different number space than TBTVisibilityMode |
|
32 AddDevice, |
|
33 ModifyFriendlyName |
|
34 }; |
|
35 |
|
36 /*! |
|
37 \class BtDelegateRemoteDevName |
|
38 \brief the base class for handling Bluetooth Local Name. |
|
39 */ |
|
40 class BtDelegateRemoteDevName : public BtAbstractDelegate, public MBtSimpleActiveObserver |
|
41 { |
|
42 Q_OBJECT |
|
43 |
|
44 public: |
|
45 explicit BtDelegateRemoteDevName( BtSettingModel* settingModel, |
|
46 BtDeviceModel* deviceModel, QObject *parent = 0 ); |
|
47 |
|
48 virtual ~BtDelegateRemoteDevName(); |
|
49 |
|
50 virtual void exec( const QVariant ¶ms ); |
|
51 |
|
52 // from MBtSimpleActiveObserver |
|
53 virtual void RequestCompletedL( CBtSimpleActive* aActive, TInt aStatus ); |
|
54 |
|
55 virtual void CancelRequest( TInt aRequestId ); |
|
56 |
|
57 virtual void HandleError( CBtSimpleActive* aActive, TInt aError ); |
|
58 |
|
59 |
|
60 private: |
|
61 bool validateName(QString &name ); |
|
62 |
|
63 RBTRegistry mBtRegistry; |
|
64 |
|
65 RBTRegServ mBtRegServ; |
|
66 |
|
67 CBtSimpleActive* mRegistryActive; |
|
68 |
|
69 QString mNewName; |
|
70 |
|
71 RBuf16 mSymName; |
|
72 |
|
73 TBTDevAddr mSymaddr; |
|
74 |
|
75 |
|
76 private: |
|
77 |
|
78 Q_DISABLE_COPY(BtDelegateRemoteDevName) |
|
79 |
|
80 }; |
|
81 |
|
82 #endif // BTDELEGATEREMOTEDEVNAME_H |