hti/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/messageservicesearcher.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Message service searcher.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __MESSAGESERVICESEARCHER_H__
       
    20 #define __MESSAGESERVICESEARCHER_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "btservicesearcher.h"
       
    25 
       
    26 // CLASS DECLARATIONS
       
    27 /**
       
    28 * CMessageServiceSearcher
       
    29 * Searches for a message service.
       
    30 */
       
    31 class CMessageServiceSearcher : public CBTServiceSearcher
       
    32     {
       
    33     public:     // Constructors and destructor
       
    34 
       
    35         /*
       
    36         * NewL()
       
    37         * Create a CMessageServiceSearcher object
       
    38         * @return a pointer to the created instance of
       
    39         * CMessageServiceSearcher
       
    40         */
       
    41         static CMessageServiceSearcher* NewL();
       
    42 
       
    43         /**
       
    44         * NewLC()
       
    45         * Create a CMessageServiceSearcher object
       
    46         * @return a pointer to the created instance of
       
    47         * CMessageServiceSearcher
       
    48         */
       
    49         static CMessageServiceSearcher* NewLC();
       
    50 
       
    51         /**
       
    52         * ~CMessageServiceSearcher()
       
    53         * Destroy the object and release all memory objects.
       
    54         */
       
    55         virtual ~CMessageServiceSearcher();
       
    56 
       
    57     public: // New functions
       
    58 
       
    59         /**
       
    60         * Port()
       
    61         * Retrieve the port on which the service is installed
       
    62         * @param aIndex index number of the service whose port number to get
       
    63         * @return the port number or KErrNotFound if aIndex negative or greater
       
    64         * than returned by ServiceCount()
       
    65         */
       
    66         TInt Port( TInt aIndex = 0 );
       
    67 
       
    68         /**
       
    69         * AppendPort()
       
    70         * Adds a new port number to the port number array. If the port number
       
    71         * already exists in the array a duplicate is not added.
       
    72         * @param aPort the port number to add
       
    73         * */
       
    74         void AppendPort( TInt aPort );
       
    75 
       
    76         /**
       
    77          * ServiceCount()
       
    78          * Get the amount of requested services found from the remote machine
       
    79          * @return the count of services (= ports)
       
    80          */
       
    81          TInt ServiceCount();
       
    82 
       
    83     protected:  // New functions
       
    84 
       
    85         /**
       
    86         * ServiceClass()
       
    87         * @return the service class uid.
       
    88         */
       
    89         const TUUID& ServiceClass() const;
       
    90 
       
    91         /**
       
    92         * ProtocolList()
       
    93         * @return the attribute list.
       
    94         */
       
    95         const TSdpAttributeParser::TSdpAttributeList& ProtocolList() const;
       
    96 
       
    97         /**
       
    98         * FoundElementL()
       
    99         * Read the data element
       
   100         * @param aKey a key that identifies the element
       
   101         * @param aValue the data element
       
   102         */
       
   103         virtual void FoundElementL( TInt aKey, CSdpAttrValue& aValue );
       
   104 
       
   105     private:    // Constructors
       
   106 
       
   107         /**
       
   108         * CMessageServiceSearcher()
       
   109         * Constructs this object
       
   110         * @param aLog the log to send output to
       
   111         */
       
   112         CMessageServiceSearcher();
       
   113 
       
   114         /**
       
   115         * ConstructL()
       
   116         * Performs second phase construction of this object
       
   117         */
       
   118         void ConstructL();
       
   119 
       
   120     private:    // data
       
   121 
       
   122         /** iServiceClass the service class UUID to search for */
       
   123         TUUID iServiceClass;
       
   124 
       
   125         /**
       
   126         * iPortNumbers array of port numbers that has the remote
       
   127         * service installed
       
   128         */
       
   129         RArray<TInt> iPortNumbers;
       
   130     };
       
   131 
       
   132 #endif // __MESSAGESERVICESEARCHER_H__
       
   133 
       
   134 // End of File