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