imservices/imfeatureplugin/srcimprocessor/protocolimdatahostimp.cpp
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     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 "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:  Im connection host
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #include <protocolimdatahost.h>
       
    20 #include <ximpprotocolconnection.h>
       
    21 #include <protocolimfeatures.h>
       
    22 #include <imobjectfactory.h>
       
    23 #include <protocolimconversationdatahost.h>
       
    24 #include "ximpapiobjbase.h"
       
    25 #include "imapiobjbase.h"
       
    26 #include "imobjectfactoryimp.h"
       
    27 #include "imdatacacheimp.h"
       
    28 #include "protocolimdatahostimp.h"
       
    29 #include "protocolimconversationdatahostimp.h"
       
    30 //#include "ximpprotocolrequestcompleteeventimp.h"
       
    31 #include "imlogutils.h"
       
    32 #include "imdatacacheimp.h"
       
    33 
       
    34 
       
    35 
       
    36 // ======== MEMBER FUNCTIONS ========
       
    37 
       
    38 
       
    39 // This should be variated. Branding variation can be one
       
    40 // possibility. One is to leave adaptation deside how soon
       
    41 // cleanup will be done.
       
    42 // Now 5 sec used for testing purposes. Better value could be
       
    43 // some minutes.
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // CProtocolImDataHostImp::CProtocolImDataHostImp()
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CProtocolImDataHostImp::CProtocolImDataHostImp( MXIMPHost& aHost )
       
    50 :iHost( aHost )
       
    51     {
       
    52     XImLogger::Log(_L("CProtocolImDataHostImp::CProtocolImDataHostImp Started"));
       
    53     XImLogger::Log(_L("CProtocolImDataHostImp::CProtocolImDataHostImp Completed"));
       
    54     }
       
    55 
       
    56 
       
    57 // ---------------------------------------------------------------------------
       
    58 // CProtocolImDataHostImp::ConstructL()
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 void CProtocolImDataHostImp::ConstructL()
       
    62     {
       
    63     XImLogger::Log(_L("CProtocolImDataHostImp::ConstructL Started"));
       
    64     iConvDataHost = CProtocolImConversationDataHostImp::NewL( iHost );
       
    65     iImObjFactory = CImObjectFactoryImp::NewL();
       
    66     iImDataCache = CImDataCache::NewL( iHost );
       
    67     
       
    68     XImLogger::Log(_L("CProtocolImDataHostImp::ConstructL Completed"));
       
    69     }
       
    70 
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // CProtocolImDataHostImp::NewLC()
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 CProtocolImDataHostImp* CProtocolImDataHostImp::NewLC( MXIMPHost& aHost )
       
    77     {
       
    78     XImLogger::Log(_L("CProtocolImDataHostImp::NewLC Started"));
       
    79     CProtocolImDataHostImp* self = new( ELeave ) CProtocolImDataHostImp( aHost );
       
    80     CleanupStack::PushL( self );
       
    81     self->ConstructL();
       
    82     XImLogger::Log(_L("CProtocolImDataHostImp::NewLC Completed"));
       
    83     return self;
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CProtocolImDataHostImp::NewL()
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 CProtocolImDataHostImp* CProtocolImDataHostImp::NewL( MXIMPHost& aHost )
       
    91     {
       
    92     XImLogger::Log(_L("CProtocolImDataHostImp::NewL Started"));
       
    93     CProtocolImDataHostImp* self = new( ELeave ) CProtocolImDataHostImp( aHost );
       
    94     CleanupStack::PushL( self );
       
    95     self->ConstructL();
       
    96     CleanupStack::Pop( self );
       
    97     XImLogger::Log(_L("CProtocolImDataHostImp::NewL Completed"));
       
    98     return self;
       
    99     }
       
   100 // ---------------------------------------------------------------------------
       
   101 // CProtocolImDataHostImp::~CProtocolImDataHostImp()
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 CProtocolImDataHostImp::~CProtocolImDataHostImp()
       
   105     {
       
   106     XImLogger::Log(_L("CProtocolImDataHostImp::~CProtocolImDataHostImp Started"));
       
   107     delete iConvDataHost;
       
   108     delete iImDataCache;
       
   109     delete iImObjFactory;
       
   110     XImLogger::Log(_L("CProtocolImDataHostImp::~CProtocolImDataHostImp Completed"));
       
   111     }
       
   112 
       
   113 // ---------------------------------------------------------------------------
       
   114 // Implement supported interface access.
       
   115 // ---------------------------------------------------------------------------
       
   116 //
       
   117 //XIMPIMP_IF_BASE_GET_INTERFACE_BEGIN( CProtocolImDataHostImp, MProtocolImDataHost )
       
   118 //XIMPIMP_IF_BASE_GET_INTERFACE_END()
       
   119 //XIMPIMP_IF_BASE_GET_CONST_INTERFACE_BEGIN( CProtocolImDataHostImp, MProtocolImDataHost )
       
   120 //XIMPIMP_IF_BASE_GET_INTERFACE_END()
       
   121 
       
   122 
       
   123 // ---------------------------------------------------------------------------
       
   124 // CProtocolImDataHostImp::ImObjectFactory()
       
   125 // ---------------------------------------------------------------------------
       
   126 //
       
   127 MImObjectFactory& CProtocolImDataHostImp::ImObjectFactory()
       
   128     {
       
   129     XImLogger::Log(_L("CProtocolImDataHostImp::ImObjectFactory Started"));
       
   130     XImLogger::Log(_L("CProtocolImDataHostImp::ImObjectFactory Completed"));
       
   131     return *iImObjFactory;
       
   132     }
       
   133 
       
   134 // ---------------------------------------------------------------------------
       
   135 // CProtocolImDataHostImp::ConversationDataHost()
       
   136 // ---------------------------------------------------------------------------
       
   137 //
       
   138 MProtocolImConversationDataHost& CProtocolImDataHostImp::ConversationDataHost()
       
   139     {
       
   140     XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Started"));
       
   141     XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Completed"));
       
   142     return *iConvDataHost;
       
   143     }
       
   144 
       
   145 // ---------------------------------------------------------------------------
       
   146 // CProtocolImDataHostImp::SearchDataHost()
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 //MProtocolImSearchDataHost& CProtocolImDataHostImp::SearchDataHost()
       
   150 //    {
       
   151 //    XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Started"));
       
   152     //return *iSearchDataHost;
       
   153 //    XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Completed"));
       
   154 //    }
       
   155 
       
   156 // ---------------------------------------------------------------------------
       
   157 // CProtocolImDataHostImp::GroupDataHost()
       
   158 // ---------------------------------------------------------------------------
       
   159 // 
       
   160 //MProtocolImGroupDataHost& CProtocolImDataHostImp::GroupDataHost()
       
   161 //    {
       
   162 //    XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Started"));
       
   163     //return *iGroupDataHost;
       
   164 //    XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Completed"));
       
   165 //    }
       
   166     
       
   167 // ---------------------------------------------------------------------------
       
   168 // CProtocolImDataHostImp::InvitationDataHost()
       
   169 // ---------------------------------------------------------------------------
       
   170 //
       
   171 //MProtocolImInvitationDataHost& CProtocolImDataHostImp::InvitationDataHost()
       
   172 //    {
       
   173 //    XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Started"));
       
   174     //return *iInvitationDataHost;
       
   175 //    XImLogger::Log(_L("CProtocolImDataHostImp::ConversationDataHost Completed"));
       
   176 //    }
       
   177 
       
   178 
       
   179 // ---------------------------------------------------------------------------
       
   180 // CProtocolImDataHostImp::ConversationDataAccess()
       
   181 // ---------------------------------------------------------------------------
       
   182 //
       
   183 CProtocolImConversationDataHostImp& CProtocolImDataHostImp::ConversationDataAccess()
       
   184     {
       
   185     return *iConvDataHost;
       
   186     }
       
   187     
       
   188 // ---------------------------------------------------------------------------
       
   189 // CProtocolDataHostImp::ImDataCache()
       
   190 // ---------------------------------------------------------------------------
       
   191 //
       
   192 CImDataCache& CProtocolImDataHostImp::ImDataCache()
       
   193     {
       
   194     return *iImDataCache;
       
   195     }
       
   196 
       
   197 
       
   198     
       
   199 // End of file
       
   200