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