widgetmodel/alfwidgetmodel/inc/alfhostapiimpl.h
branchRCL_3
changeset 26 0e9bb658ef58
parent 0 e83bab7cf002
equal deleted inserted replaced
25:4ea6f81c838a 26:0e9bb658ef58
       
     1 /*
       
     2 * Copyright (c) 2007 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 "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:  The private implementation of AlfHostAPI.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALFHOSTAPIIMPL_H
       
    20 #define ALFHOSTAPIIMPL_H
       
    21 
       
    22 #include <osn/ustring.h>
       
    23 #include <osn/alfptrvector.h>
       
    24 #include <memory>
       
    25 
       
    26 #include "ialfhostapi.h"
       
    27 
       
    28 namespace Alf
       
    29     {
       
    30 
       
    31 class CAlfWidgetControl;
       
    32 class AlfWidget;
       
    33 /**
       
    34  *  The private implementation of CAlfHostAPIImpl.
       
    35  *
       
    36  *  @lib alfwidgetmodel.lib
       
    37  *  @since S60 ?S60_version
       
    38  */
       
    39 class AlfHostAPIImpl:public IAlfHostAPI
       
    40     {
       
    41 public:
       
    42 
       
    43     /**
       
    44      * Constructor.
       
    45      *
       
    46      * @since S60 ?S60_version
       
    47      */
       
    48     AlfHostAPIImpl();
       
    49 
       
    50     /**
       
    51      * Destructor.
       
    52      *
       
    53      * @since S60 ?S60_version
       
    54      */
       
    55     virtual ~AlfHostAPIImpl();
       
    56     
       
    57     /**
       
    58      * Set the host control.Should be set before any IAlfHostAPI call is made
       
    59      */
       
    60     void setHostControl(CAlfWidgetControl& aControl);
       
    61     /**
       
    62      * setConnection.
       
    63      *
       
    64      * @since S60 ?S60_version
       
    65      */
       
    66     void setConnection(CAlfWidgetControl& aControl, AlfRole aRole);
       
    67     /**
       
    68      * getConnection.
       
    69      *
       
    70      * @since S60 ?S60_version
       
    71      */
       
    72     CAlfWidgetControl* getConnection(int aIndex) const;
       
    73     
       
    74     /**
       
    75      * gets the number of connections
       
    76      *
       
    77      * @since S60 ?S60_version
       
    78      */
       
    79     int getConnectionCount() const;
       
    80     
       
    81     /**
       
    82      * gets the connection index of aControl
       
    83      *
       
    84      * @since S60 ?S60_version
       
    85      * @param aControl control, which index to return.
       
    86      */
       
    87     int getConnectionIndex(CAlfWidgetControl& aControl) const;
       
    88         
       
    89     /**
       
    90      * removeConnection.
       
    91      *
       
    92      * @since S60 ?S60_version
       
    93      */
       
    94     void removeConnection(CAlfWidgetControl& aControl);
       
    95     /**
       
    96      * setBaseLayout.
       
    97      *
       
    98      * @since S60 ?S60_version
       
    99      */
       
   100     void setBaseLayout(IAlfLayoutManager& aLayout);
       
   101     /**
       
   102      * getBaseLayout.
       
   103      *
       
   104      * @since S60 ?S60_version
       
   105      */
       
   106     IAlfLayoutManager* getBaseLayout() const;
       
   107     /**
       
   108      * Template getter for interfaces provided by the control classes.
       
   109      * The type of the queried interface is specified by the
       
   110      * template parameter.
       
   111      *
       
   112      * @since S60 ?S60_version
       
   113      * @param aControl The control to get the interface for.
       
   114      * @return The queried interface, or NULL if the interface is not
       
   115      *         supported or available.
       
   116      */
       
   117     template <class T>
       
   118     static T* makeInterface( AlfHostAPIImpl* aControl );
       
   119     /**
       
   120      * From MAlfInterfaceBase.
       
   121      * Getter for interfaces provided by the control classes.
       
   122      * Derived classes should always call the base class method
       
   123      * from the overridden makeInterface.
       
   124      *
       
   125      * @since S60 ?S60_version
       
   126      * @param aType A descriptor to identify the type of the queried interface.
       
   127      * @return The queried interface, or NULL if the interface is not
       
   128      *         supported or available.
       
   129      */
       
   130     virtual IAlfInterfaceBase* makeInterface( const IfId& aType );
       
   131 private:
       
   132     /**
       
   133      * Base layout of container widget.
       
   134      */
       
   135     auto_ptr<IAlfLayoutManager> mBaseLayout;
       
   136     /**
       
   137      * Host control for IAlfHostAPIs. Not Owned.
       
   138      */
       
   139     CAlfWidgetControl *mHostControl;
       
   140     }; //class AlfHostAPIImpl
       
   141     } // namespace Alf
       
   142 
       
   143 #endif // C_ALFHOSTAPIIMPL_H