49 */ |
50 */ |
50 class CWidgetClient: public CBase, public MJSWidgetCallbacks |
51 class CWidgetClient: public CBase, public MJSWidgetCallbacks |
51 { |
52 { |
52 |
53 |
53 public: |
54 public: |
54 static CWidgetClient* NewL(MWidgetCallback& aWidgetCallback, MWidgetEngineCallbacks& aWidgetEngineCallback, WidgetPreferences* preferences); |
55 static CWidgetClient* NewL(MWidgetCallback& aWidgetCallback, MJSObjectProtector* aProtector, MWidgetEngineCallbacks& aWidgetEngineCallback, WidgetPreferences* preferences); |
55 virtual ~CWidgetClient(); |
56 virtual ~CWidgetClient(); |
56 |
57 |
57 public: |
58 public: |
58 KJS::JSWidget* jswidget() { return m_jswidget; } |
59 KJS::JSWidget* jswidget() { return m_jswidget; } |
59 void onShowSelected(); |
60 void onShowSelected(); |
67 public: // From MJSWidgetCallbacks |
68 public: // From MJSWidgetCallbacks |
68 void openApplication( const TUid& aAppUid, const TDesC& aParam ); |
69 void openApplication( const TUid& aAppUid, const TDesC& aParam ); |
69 void openUrl( const TDesC& aUrl ); |
70 void openUrl( const TDesC& aUrl ); |
70 TDesC& getWidgetBundleId(); |
71 TDesC& getWidgetBundleId(); |
71 void setNavigationEnabled( TBool aEnable ); |
72 void setNavigationEnabled( TBool aEnable ); |
|
73 void setNavigationType( const TDesC& aType ); |
72 void prepareForTransition( const TDesC& aTransition ); |
74 void prepareForTransition( const TDesC& aTransition ); |
73 void performTransition(); |
75 void performTransition(); |
74 TInt preferenceForKey( const TDesC& aKey, TPtrC& aValue ); |
76 TInt preferenceForKey( const TDesC& aKey, HBufC*& aValue ); |
75 void setPreferenceForKey( const TDesC& aKey, const TDesC& aValue ); |
77 void setPreferenceForKey( const TDesC& aKey, const TDesC& aValue ); |
76 void removePreferenceForKey( const TDesC& aKey, const TDesC& aValue ); |
78 void removePreferenceForKey( const TDesC& aKey, const TDesC& aValue ); |
77 void setDisplayLandscape(); |
79 void setDisplayLandscape(); |
78 void setDisplayPortrait(); |
80 void setDisplayPortrait(); |
79 |
81 |
80 private: |
82 private: |
81 void launchApplicationL( const TUid& aUid, const TDesC& aParam ); |
83 void launchApplicationL( const TUid& aUid, const TDesC& aParam ); |
82 |
84 |
83 protected: |
85 protected: |
84 void ConstructL(MWidgetEngineCallbacks& aWidgetEngineCallback); |
86 void ConstructL(MWidgetEngineCallbacks& aWidgetEngineCallback, MJSObjectProtector* protector); |
85 CWidgetClient(MWidgetCallback& aWidgetCallback, MWidgetEngineCallbacks& aWidgetEngineCallback, WidgetPreferences* preferences); |
87 CWidgetClient(MWidgetCallback& aWidgetCallback, MWidgetEngineCallbacks& aWidgetEngineCallback, WidgetPreferences* preferences); |
86 |
88 |
87 private: |
89 private: |
88 WidgetPreferences* m_preferences; //not owned |
90 WidgetPreferences* m_preferences; //not owned |
89 WidgetRenderer* m_renderer; |
91 WidgetRenderer* m_renderer; |