services/terminalmodeservice_plat/inc/upnpremotableapp.h
branchRCL_3
changeset 29 5c72fd91570d
equal deleted inserted replaced
7:8116cc943311 29:5c72fd91570d
       
     1 /**
       
     2 * Copyright (c) 2010 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: CUpnpRemotableApp class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __UPNPREMOTABLEAPP_H__
       
    19 #define __UPNPREMOTABLEAPP_H__
       
    20 
       
    21 #include <e32base.h>    
       
    22 #include <upnpterminalmodeicon.h>
       
    23 #include <upnptminfoelement.h>
       
    24 
       
    25 /**
       
    26 * Class represents a Remotable App or just "app" in the 
       
    27 * context of Terminal Mode Service. 
       
    28 * The Automotive Server (or equivalent) is responsible for creating an object 
       
    29 * of this class and registering it with the Terminal Mode Service. 
       
    30 * The Terminal Mode Service will maintain a list of these registered apps throughout 
       
    31 * it's lifetime. The Automotive Server can remove apps from this list by 
       
    32 * unregistering them. 
       
    33 */
       
    34 class CUpnpRemotableApp : public CBase
       
    35     {
       
    36 public: 
       
    37     /**
       
    38     * Standard Symbian Two-Phase constructor
       
    39     * @param	aAppId			The locally unique ID of the App being registered.
       
    40 	*							The Terminal Mode Service will check for the uniqueness
       
    41 	*							of this ID when this Remotable app object is registered.
       
    42 	* @param	aAppName		The Name of the App being registered. The Terminal Mode
       
    43 	*							Service will *not* check for uniqueness. However, it's 
       
    44 	*							recommended that this is unique as well.
       
    45 	* @see	CUpnpTmServer::RegisterAppL, CUpnpTmServer::RegisterAppsL
       
    46     */    
       
    47     IMPORT_C static CUpnpRemotableApp* NewL( TUint aAppId ,const TDesC8& aAppName );
       
    48 	
       
    49 	~CUpnpRemotableApp();	
       
    50     /**
       
    51      * Method that sets the brief description about the application( remotable app )
       
    52      * An optional element.
       
    53      * @param aDescription Description of the Application
       
    54      */
       
    55     IMPORT_C void SetAppDescriptionL( const TDesC8& aDescription );
       
    56     /**
       
    57      * Method to set the list of allowed profile IDs associated with the remotable app.
       
    58      * An optional element.
       
    59      * @aProfileIdList  Reference to an array of profile IDs.
       
    60      *                  A copy of array is maintained.
       
    61      */
       
    62     IMPORT_C void SetAllowedProfileIdListL( const RArray<TUint>& aProfileIdList );
       
    63     /**
       
    64     * Method that adds a new icon to this Remotable App.
       
    65     * An optional element.
       
    66     * @param	aIcon	[in] The Icon object. Must be instantiated by the caller prior to
       
    67 	*					this call. Should be non-NULL.
       
    68 	*					The ownership is transferred to the CUpnpRemotableApp object.
       
    69 	* @see	CUpnpTerminalModeIcon
       
    70     */    
       
    71 	IMPORT_C void AddIconL( CUpnpTerminalModeIcon* aIcon );
       
    72     /**
       
    73     * Method that creates a new terminal mode info object and adds it to the list of
       
    74 	* terminal mode info objects supported by this app. The terminal mode info object thus 
       
    75 	* created will be internally maintained by Remotable App object.A reference of the same
       
    76 	* will be returned to the caller. 
       
    77 	* Only protocolID of the remotingInfo element is the required element as per the schema,
       
    78 	* otherwise all other info types and their elements are optional.
       
    79     * @param aTerminalModeInfoType	Terminal Mode Info Type as an Enum value. 
       
    80 	* @see	CUpnpTerminalModeInfoElement
       
    81     */    
       
    82 	IMPORT_C CUpnpTmInfoElement& CreateTmInfoElementL( CUpnpTmInfoElement
       
    83 	                                ::TTerminalModeInfoType aTerminalModeInfoType );
       
    84     /**
       
    85     * Method is used to define the current status of the resource.
       
    86     * An optional element.
       
    87     * @param aResourceStatus  Status of the resource. Can take one of these values;
       
    88     *        Free, busy or NA
       
    89     */    
       
    90 	IMPORT_C void SetResourceStatusL( const TDesC8& aResourceStatus );
       
    91     /**
       
    92     * "Getter" method for retrieving the list of icons associated with this
       
    93 	* Remotable app object.An optional element.
       
    94     * @return Returns RPointerArray of icons.
       
    95 	* @see CUpnpTerminalModeIcon
       
    96     */    
       
    97 	inline const RPointerArray<CUpnpTerminalModeIcon>& IconList()const;
       
    98     /**
       
    99     * "Getter" Method for retrieving the list of terminal mode info details associated with
       
   100     * this Remotable app object.
       
   101     * @return Returns RPointerArray of terminal mode info objects. 
       
   102     * @see  CUpnpTerminalModeInfo
       
   103     */    
       
   104     inline const RPointerArray<CUpnpTmInfoElement>& TmInfoElementList()const;
       
   105 
       
   106 	// inlined "Getter" methods 
       
   107 	inline TUint AppId()const;
       
   108 	inline const TDesC8& AppName()const;
       
   109 	inline const TDesC8& AppDescription()const;
       
   110 	inline const TDesC8& ResourceStatus()const;
       
   111 	inline const RArray<TUint>& AllowedProfileIdList()const;
       
   112 	
       
   113 protected:
       
   114 	CUpnpRemotableApp( TUint aAppId );
       
   115     void ConstructL( const TDesC8& aAppName );
       
   116 
       
   117 private:
       
   118     TUint                                   iAppId;
       
   119     RBuf8                                   iAppName;
       
   120     RBuf8                                   iAppDescription;
       
   121     RBuf8                                   iResourceStatus;
       
   122 	RPointerArray<CUpnpTerminalModeIcon>    iIconList;
       
   123 	RPointerArray<CUpnpTmInfoElement>       iTmInfoElementList;
       
   124 	RArray<TUint>                           iProfileIdList;
       
   125     };
       
   126 
       
   127 #include <upnpremotableapp.inl>
       
   128 
       
   129 #endif //__UPNPREMOTABLEAPP_H__
       
   130