webengine/widgetengine/inc/WidgetClient.h
changeset 0 dd21522fd290
child 5 10e98eab6f85
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  This class represents the Widget Extension object
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __WIDGETCLIENT_
       
    19 #define __WIDGETCLIENT_
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include "BrCtlInterface.h"
       
    24 #include "WidgetCallbacks.h"
       
    25 #include "WidgetEngineCallbacks.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATION
       
    36 class WidgetRenderer;
       
    37 class WidgetPreferences;
       
    38 
       
    39 namespace KJS {
       
    40     class JSWidget;
       
    41 }
       
    42 
       
    43 // CLASS DECLARATION
       
    44 /**
       
    45 *  CWidgetClient
       
    46 *
       
    47 *  @lib browserengine.dll
       
    48 *  @since 3.2
       
    49 */
       
    50 class CWidgetClient: public CBase, public MJSWidgetCallbacks
       
    51 {
       
    52 
       
    53 public:
       
    54     static CWidgetClient* NewL(MWidgetCallback& aWidgetCallback, MWidgetEngineCallbacks& aWidgetEngineCallback, WidgetPreferences* preferences);
       
    55     virtual ~CWidgetClient();
       
    56 
       
    57 public:
       
    58     KJS::JSWidget* jswidget() { return m_jswidget; }
       
    59     void onShowSelected();
       
    60     void onHideSelected();
       
    61     void onExitCalled();
       
    62     WidgetRenderer* renderer() { return m_renderer; }
       
    63         
       
    64 public: // From MWidgetExtension
       
    65     TBool HandleCommandL( TInt aCommandId );        
       
    66 
       
    67 public: // From MJSWidgetCallbacks
       
    68     void openApplication( const TUid& aAppUid, const TDesC& aParam );
       
    69     void openUrl( const TDesC& aUrl );
       
    70     TDesC& getWidgetBundleId();
       
    71     void setNavigationEnabled( TBool aEnable );
       
    72     void prepareForTransition( const TDesC& aTransition );
       
    73     void performTransition();        
       
    74     TInt preferenceForKey( const TDesC& aKey, TPtrC& aValue );
       
    75     void setPreferenceForKey( const TDesC& aKey, const TDesC& aValue );
       
    76     void removePreferenceForKey( const TDesC& aKey, const TDesC& aValue );
       
    77     void setDisplayLandscape();
       
    78     void setDisplayPortrait();
       
    79     
       
    80 private:
       
    81     void launchApplicationL( const TUid& aUid, const TDesC& aParam );
       
    82 
       
    83 protected:
       
    84     void ConstructL(MWidgetEngineCallbacks& aWidgetEngineCallback);
       
    85     CWidgetClient(MWidgetCallback& aWidgetCallback, MWidgetEngineCallbacks& aWidgetEngineCallback, WidgetPreferences* preferences);
       
    86 
       
    87 private:
       
    88     WidgetPreferences*     m_preferences; //not owned
       
    89     WidgetRenderer*        m_renderer;
       
    90 
       
    91     MWidgetCallback*       m_widgetcallback;
       
    92     MWidgetEngineCallbacks* m_widgetenginecallback;
       
    93     KJS::JSWidget*         m_jswidget;
       
    94 
       
    95 };
       
    96 
       
    97 
       
    98 #endif
       
    99