|
1 /******************************************************************************* |
|
2 * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. This program and the accompanying materials |
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
|
5 * which accompanies this distribution, and is available at |
|
6 * http://www.eclipse.org/legal/epl-v10.html |
|
7 * |
|
8 * Contributors: |
|
9 * Nokia Corporation - S60 implementation |
|
10 *******************************************************************************/ |
|
11 |
|
12 |
|
13 #ifndef SWTMOBILEDEVICE_H |
|
14 #define SWTMOBILEDEVICE_H |
|
15 |
|
16 |
|
17 #include <aknappui.h> |
|
18 #include "eswtmobileextensions.h" |
|
19 #include "swtflipwatch.h" |
|
20 |
|
21 |
|
22 /** |
|
23 * CSwtMobileDevice |
|
24 * @lib eswt |
|
25 */ |
|
26 NONSHARABLE_CLASS(CSwtMobileDevice) |
|
27 : public CBase |
|
28 , public MSwtMobileDevice |
|
29 , public MSwtFlipObserver |
|
30 { |
|
31 // Types |
|
32 public: |
|
33 /** Input info */ |
|
34 struct TSwtHwInput |
|
35 { |
|
36 TInt iType; |
|
37 TInt iLocation; |
|
38 }; |
|
39 |
|
40 // Own Methods |
|
41 public: |
|
42 static CSwtMobileDevice* NewL(MSwtDisplay& aDisplay, TSwtPeer aPeer); |
|
43 static TInt HwScreenCount(); |
|
44 static void GetHwInputs(RArray<TSwtHwInput>& aInputs); |
|
45 private: |
|
46 inline CSwtMobileDevice(MSwtDisplay& aDisplay, TSwtPeer aPeer); |
|
47 virtual ~CSwtMobileDevice(); |
|
48 void ConstructL(); |
|
49 |
|
50 // From MSwtMobileDevice |
|
51 public: |
|
52 void Alert(TAlertLevel aLevel); |
|
53 TSwtPeer Dispose(); |
|
54 TInt GetInputNumber() const; |
|
55 TInt GetScreenNumber() const; |
|
56 TBool IsOpen() const; |
|
57 TBool AddObserverL(const MSwtMobileDeviceObserver* aObserver); |
|
58 TBool RemoveObserver(const MSwtMobileDeviceObserver* aObserver); |
|
59 |
|
60 // From MSwtFlipObserver |
|
61 public: |
|
62 void FlipChangingL(); |
|
63 void FlipChangedL(TBool aState); |
|
64 |
|
65 // Data |
|
66 private: |
|
67 MSwtDisplay& iDisplay; |
|
68 const TSwtPeer iPeer; |
|
69 TBool iFlipOpen; |
|
70 TBool iFlipChanging; |
|
71 TInt iScreenCount; |
|
72 TInt iActiveScreenId; |
|
73 RPointerArray<MSwtMobileDeviceObserver> iObservers; |
|
74 CSwtFlipWatch* iFlipWatch; |
|
75 }; |
|
76 |
|
77 |
|
78 #endif // SWTMOBILEDEVICE_H |