|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #ifndef MMFMEDIACLIENTEXTDISPLAYINTERFACE_H_ |
|
22 #define MMFMEDIACLIENTEXTDISPLAYINTERFACE_H_ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <graphics/surface.h> |
|
26 |
|
27 /** |
|
28 |
|
29 Mixin class capable of handling events and requests from provider |
|
30 |
|
31 */ |
|
32 class MExtDisplayConnectionProviderCallback |
|
33 { |
|
34 public: |
|
35 virtual void MedcpcExtDisplayCalculateExtentAndViewportL(TRect& aExtent, TRect& aViewport, TRect& aExternalDisplayRect) = 0; |
|
36 virtual void MedcpcExtDisplayNotifyConnected(TBool aExtDisplayConnected) = 0; |
|
37 }; |
|
38 |
|
39 /** |
|
40 |
|
41 Base class for external display connection provider plugins. |
|
42 |
|
43 */ |
|
44 class CExtDisplayConnectionProviderInterface : public CBase |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 Determines if external displays are supported by checking if any implementations for |
|
50 supporting external displays are available. |
|
51 |
|
52 @return ETrue if supported otherwise EFalse |
|
53 |
|
54 */ |
|
55 static TBool ExternalDisplaySupportedL(); |
|
56 |
|
57 /** |
|
58 Allocates and constructs a new provider plugin. |
|
59 |
|
60 Uses ECOM to instantiate a new provider plugin. Can leave with any of the system-wide error codes. |
|
61 |
|
62 @param aCallback |
|
63 A reference to an object that can be used by the provider to send |
|
64 events back to the client and make request on the client. |
|
65 @param aSurfaceId |
|
66 The surfaceId. |
|
67 @leave KErrNotSupported There is no support for external displays. |
|
68 @return A pointer to the new provider plugin. |
|
69 |
|
70 */ |
|
71 static CExtDisplayConnectionProviderInterface* NewL(MExtDisplayConnectionProviderCallback& aCallback, TSurfaceId& aSurfaceId); |
|
72 |
|
73 /** |
|
74 Function to be implemented by connection provider that indicates whether an external display is |
|
75 connected. |
|
76 |
|
77 @return ETrue if external display is connectde otherwise EFalse. |
|
78 */ |
|
79 virtual TBool ExtDisplayConnectedL() = 0; |
|
80 |
|
81 /** |
|
82 Default destructor. |
|
83 */ |
|
84 IMPORT_C virtual ~CExtDisplayConnectionProviderInterface(); |
|
85 |
|
86 protected: |
|
87 /** |
|
88 Constructor. |
|
89 */ |
|
90 IMPORT_C CExtDisplayConnectionProviderInterface(); |
|
91 |
|
92 /** |
|
93 The callback handler for the provider plugin. |
|
94 */ |
|
95 MExtDisplayConnectionProviderCallback* iCallback; // not owned |
|
96 |
|
97 /** |
|
98 The surface Id. |
|
99 */ |
|
100 TSurfaceId iSurfaceId; // not owned |
|
101 |
|
102 private: |
|
103 /** |
|
104 This is internal and not intended for use. |
|
105 */ |
|
106 void ConstructL(MExtDisplayConnectionProviderCallback& aCallback, TSurfaceId& aSurfaceId); |
|
107 |
|
108 private: |
|
109 /** |
|
110 Required by ECOM. |
|
111 */ |
|
112 TUid iInstanceKey; |
|
113 }; |
|
114 |
|
115 #endif /* MMFMEDIACLIENTEXTDISPLAYINTERFACE_H_ */ |