|
1 // QR3ProductPlugin.h |
|
2 // |
|
3 // Copyright (c) 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "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 // Accenture - Initial contribution |
|
11 // |
|
12 #ifndef QR3PRODUCTPLUGIN_H |
|
13 #define QR3PRODUCTPLUGIN_H |
|
14 |
|
15 enum TPluginEnumValues |
|
16 { |
|
17 // More types will be added to this as we support more plugins. |
|
18 // Anyone writing a plugin will be assigned a set of EPluginx values that they should use. |
|
19 // This is to avoid conflicts |
|
20 |
|
21 EPlugin1CommandsOrControls = 0x3000, |
|
22 EPlugin1Tabs = 0x3490, |
|
23 EPlugin1Max = 0x3499, |
|
24 |
|
25 EPlugin2CommandsOrControls = 0x3500, |
|
26 EPlugin2Tabs = 0x3990, |
|
27 EPlugin2Max = 0x3999, |
|
28 |
|
29 EPluginMax = 0x9999 |
|
30 }; |
|
31 |
|
32 #define KQr3ProductPluginEcomUid 0x102831C5 |
|
33 |
|
34 #ifdef __cplusplus |
|
35 // We reuse this file as an HRH as well, so we have to escape everything for when we're being run by rcomp |
|
36 |
|
37 #include <e32base.h> |
|
38 #include <COECOBS.H> // TCoeEvent |
|
39 #include <COEDEF.H> // For key handling stuff |
|
40 #include <W32STD.H> // Ditto |
|
41 |
|
42 class CQikMultiPageViewBase; |
|
43 class CQikCommand; |
|
44 class CCoeControl; |
|
45 |
|
46 class MProductPluginV1 // This corresponds to version 1 in your ECOM rss file |
|
47 { |
|
48 // Do not add any virtual functions to this class! If you need to do that, create a new class MProductPluginV2 |
|
49 // that derives from MProductPluginV1 and add them there. This ensures BC between plugin versions. If you do, be |
|
50 // sure to update CDefaultProductPlugin to not call through to plugins too old to support the new methods. |
|
51 // Or better yet talk to me first! -Tom |
|
52 public: |
|
53 enum TError |
|
54 { |
|
55 ECouldntSetDebugPort, |
|
56 }; |
|
57 |
|
58 enum TValueType |
|
59 { |
|
60 EHal, |
|
61 EKey, |
|
62 EFeature, |
|
63 }; |
|
64 |
|
65 // Non-UI device attributes |
|
66 virtual TPtrC8 TraceFlagName(TInt aWord, TInt aBit)=0; |
|
67 virtual void FormatValue(TDes& aDes, TValueType aType, TInt aAttrib, TInt aVal)=0; |
|
68 virtual TUint32 GetDeviceType()=0; |
|
69 virtual TBool HandleErrorL(TError aType, TInt aErr)=0; // Return ETrue to handle. |
|
70 virtual TBool ConsumeMemoryKeys(TBool aDisk, TDes& aCheckboxName, TInt& aUpKeyCode, TInt& aDownKeyCode, TInt& aLogKeyCode)=0; |
|
71 virtual void Release(TBool aAppIsShuttingDown)=0; // aAppIsShuttingDown may be useful for things with complex interactions with CEikonEnv |
|
72 |
|
73 // View related functions |
|
74 virtual TKeyResponse OfferKeyEventL(TKeyEvent& aEvent, TEventCode aCode)=0; |
|
75 virtual void DoViewConstructL(CQikMultiPageViewBase* aParentView)=0; |
|
76 virtual TBool DoDynInitOrDeleteCommandL(CQikCommand*& aCommand, const CCoeControl& aControlAddingCommands)=0; |
|
77 virtual void DoHandleControlEventL(CCoeControl *aControl, MCoeControlObserver::TCoeEvent aEventType)=0; |
|
78 |
|
79 virtual void RefreshTabL(TInt aTab)=0; |
|
80 }; |
|
81 |
|
82 class MProductPluginV2 : public MProductPluginV1 |
|
83 { |
|
84 public: |
|
85 virtual void EnablePanicChecking(TBool aEnable)=0; // This function should disable any device-specific crash capture behaviour that may be invoked as a result of calls to User::Panic. This is because QResources is about to call code that might panic, but it should continue regardless and not (eg) cause the phone to reboot on debug builds. |
|
86 virtual TBool PanicCheckingIsEnabled()=0; |
|
87 }; |
|
88 |
|
89 class MProductPluginV3 : public MProductPluginV2 |
|
90 { |
|
91 public: |
|
92 virtual void GetFeatureUidsL(RArray<TUid>& aUids)=0; // Populates aUids with any device-specific entries in feature registry |
|
93 }; |
|
94 |
|
95 class MProductPluginV4 : public MProductPluginV3 |
|
96 { |
|
97 public: |
|
98 virtual TBool ConsumeMemoryKeys(TBool aDisk, TDes& aCheckboxName, TInt& aUpKeyCode, TInt& aUpScanCode, TInt& aDownKeyCode, TInt& aDownScanCode, TInt& aLogKeyCode, TInt& aLogScanCode)=0; |
|
99 }; |
|
100 |
|
101 /* |
|
102 * MProductPlugin is always typedef'd to the latest plugin version |
|
103 * This means that plugin writers can always derive from MProductPlugin, |
|
104 * and not usually have to worry about it, but you get the BC advantages of |
|
105 * versioning. If there is a new version which you don't want to implement when |
|
106 * you rebuild your plugin, then just change the declaration to explicitly derive |
|
107 * from the old version (eg change "class Cx : public CBase, public MProductPlugin" to |
|
108 * "class Cx : public CBase, public MProductPluginV1" |
|
109 * |
|
110 * Remember that what you derive from must match the version number in your ecom rss |
|
111 * file! (Strictly speaking, the rss version num must be <= the class derived) |
|
112 */ |
|
113 typedef MProductPluginV4 MProductPlugin; |
|
114 |
|
115 #endif |
|
116 #endif |