multimediacommsengine/mmceshared/src/mceevents.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include "mceevents.h"
       
    22 #include "mcecommediastream.h"
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // TMceEvent::TMceEvent
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 TMceEvent::TMceEvent()
       
    32     : iIds( NULL ), 
       
    33       iMessage( NULL ),
       
    34       iContent( NULL ) 
       
    35     {
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // TMceEvent::TMceEvent
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 TMceEvent::TMceEvent( TMceIds& aIds, CBase* aMessage, HBufC8* aContent )
       
    43     : iIds( &aIds ), 
       
    44       iMessage( aMessage ),
       
    45       iContent( aContent )
       
    46     {
       
    47     }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // TMceEvent::Id
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 TMceIds& TMceEvent::Id()
       
    54     {
       
    55     return *iIds;
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // TMceEvent::Action
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 TUint TMceEvent::Action()
       
    63     {
       
    64     return iIds->iCallbackID;
       
    65     }
       
    66     
       
    67 // -----------------------------------------------------------------------------
       
    68 // TMceEvent::ActionData
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 TUint32 TMceEvent::ActionData()
       
    72     {
       
    73     return iIds->iState;
       
    74     }
       
    75     
       
    76 // -----------------------------------------------------------------------------
       
    77 // TMceEvent::MessageType
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 TUint TMceEvent::MessageType()
       
    81     {
       
    82     return iIds->iMsgType;
       
    83     }
       
    84     
       
    85 // -----------------------------------------------------------------------------
       
    86 // TMceEvent::Message
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 CBase* TMceEvent::Message()
       
    90     {
       
    91     return iMessage;
       
    92     }
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 // TMceEvent::Content
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 HBufC8* TMceEvent::Content()
       
    99     {
       
   100     HBufC8* ret = iContent;
       
   101     iContent = NULL;
       
   102     return ret;
       
   103     }
       
   104 
       
   105 
       
   106 // ============================ MEMBER FUNCTIONS ===============================
       
   107 
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // TMceComEvent::TMceComEvent
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 TMceComEvent::TMceComEvent( TMceIds& aIds, CBase* aMessage, 
       
   114                             TMceItcFunctions aAction, 
       
   115                             MMceEventHandler& aHandler )
       
   116     : TMceEvent( aIds, aMessage, NULL ),
       
   117       iAction( aAction ),
       
   118       iHandler( aHandler ) 
       
   119     {
       
   120     }
       
   121 
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // TMceComEvent::Action
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 TUint TMceComEvent::Action()
       
   128     {
       
   129     return iAction;
       
   130     }
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // TMceComEvent::Handler
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 MMceEventHandler& TMceComEvent::Handler()
       
   137     {
       
   138     return iHandler;
       
   139     }
       
   140 
       
   141 
       
   142 // -----------------------------------------------------------------------------
       
   143 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   144 // -----------------------------------------------------------------------------
       
   145 //
       
   146 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession, 
       
   147                                                     TMceSipEventCode aCode )
       
   148   : iSession( &aSession ),
       
   149     iCode( (TUint)aCode ),
       
   150     iEventSource( EMceSip ),
       
   151     iIds( NULL ),
       
   152     iClientMessage( NULL ),
       
   153     iMccEvent( NULL ),
       
   154     iStatus( KErrNone ),
       
   155     iDialog ( NULL )
       
   156     {
       
   157     }
       
   158 
       
   159 
       
   160 
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   164 // -----------------------------------------------------------------------------
       
   165 //
       
   166 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession, 
       
   167                                                     TMceSipEventCode aCode,
       
   168                                                     CSIPDialog& aDialog )
       
   169   : iSession( &aSession ),
       
   170     iCode( (TUint)aCode ),
       
   171     iEventSource( EMceSip ),
       
   172     iIds( NULL ),
       
   173     iClientMessage( NULL ),
       
   174     iMccEvent( NULL ),
       
   175     iStatus( KErrNone ),
       
   176     iDialog ( &aDialog )
       
   177     {
       
   178     }
       
   179 
       
   180 
       
   181 // -----------------------------------------------------------------------------
       
   182 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   183 // -----------------------------------------------------------------------------
       
   184 //
       
   185 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession, 
       
   186                                                     TMceSipEventCode aCode,
       
   187                                                     TInt aStaus )
       
   188   : iSession( &aSession ),
       
   189     iCode( (TUint)aCode ),
       
   190     iEventSource( EMceSip ),
       
   191     iIds( NULL ),
       
   192     iClientMessage( NULL ),
       
   193     iMccEvent( NULL ),
       
   194     iStatus( aStaus ),
       
   195     iDialog ( NULL )
       
   196     {
       
   197     }
       
   198 
       
   199 
       
   200 
       
   201     
       
   202 // -----------------------------------------------------------------------------
       
   203 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   204 // -----------------------------------------------------------------------------
       
   205 //
       
   206 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession, 
       
   207                                                     TMceItcFunctions aCode,
       
   208                                                     TMceIds& aIds,
       
   209                                                     CMceMsgBase& aClientMessage )
       
   210   : iSession( &aSession ),
       
   211     iCode( (TUint)aCode ),
       
   212     iEventSource( EMceClient ),
       
   213     iIds( &aIds ),
       
   214     iClientMessage( &aClientMessage ),
       
   215     iMccEvent( NULL ),
       
   216     iStatus( KErrNone ),
       
   217     iDialog ( NULL )
       
   218     {
       
   219     }
       
   220 
       
   221 // -----------------------------------------------------------------------------
       
   222 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   223 // -----------------------------------------------------------------------------
       
   224 //
       
   225 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession, 
       
   226                                                     TMceItcFunctions aCode,
       
   227                                                     TMceIds& aIds )
       
   228   : iSession( &aSession ),
       
   229     iCode( (TUint)aCode ),
       
   230     iEventSource( EMceClient ),
       
   231     iIds( &aIds ),
       
   232     iClientMessage( NULL ),
       
   233     iMccEvent( NULL ),
       
   234     iStatus( KErrNone ),
       
   235     iDialog ( NULL )
       
   236     {
       
   237     }
       
   238 
       
   239 
       
   240 // -----------------------------------------------------------------------------
       
   241 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   242 // -----------------------------------------------------------------------------
       
   243 //
       
   244 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession, 
       
   245                                                     TMceMediaEventCode aCode )
       
   246   : iSession( &aSession ),
       
   247     iCode( (TUint)aCode ),
       
   248     iEventSource( EMceMedia ),
       
   249     iIds( NULL ),
       
   250     iClientMessage( NULL ),
       
   251     iMccEvent( NULL ),
       
   252     iStatus( KErrNone ),
       
   253     iDialog ( NULL )
       
   254     {
       
   255     }
       
   256 
       
   257     
       
   258 // -----------------------------------------------------------------------------
       
   259 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   260 // -----------------------------------------------------------------------------
       
   261 //
       
   262 TMceStateTransitionEvent::TMceStateTransitionEvent( CMceSipSession& aSession,
       
   263                                                     TMceMccComEvent& aEvent, 
       
   264                                                     TMceMediaEventCode aCode )
       
   265   : iSession( &aSession ),
       
   266     iCode( (TUint)aCode ),
       
   267     iEventSource( EMceMedia ),
       
   268     iIds( NULL ),
       
   269     iClientMessage( NULL ),
       
   270     iMccEvent( &aEvent ),
       
   271     iStatus( aEvent.iError ),
       
   272     iDialog ( NULL )
       
   273     {
       
   274     }
       
   275     
       
   276 // -----------------------------------------------------------------------------
       
   277 // TMceStateTransitionEvent::TMceStateTransitionEvent
       
   278 // -----------------------------------------------------------------------------
       
   279 //
       
   280 TMceStateTransitionEvent::TMceStateTransitionEvent()
       
   281   : iSession( NULL ),
       
   282     iCode( 0 ),
       
   283     iEventSource( EMceMedia ),
       
   284     iIds( NULL ),
       
   285     iClientMessage( NULL ),
       
   286     iMccEvent( NULL ),
       
   287     iStatus( KErrNone ),
       
   288     iDialog ( NULL )
       
   289     {
       
   290     }
       
   291 
       
   292 // -----------------------------------------------------------------------------
       
   293 // TMceStateTransitionEvent::Session
       
   294 // -----------------------------------------------------------------------------
       
   295 //
       
   296 CMceSipSession& TMceStateTransitionEvent::Session()
       
   297     {
       
   298     return *iSession;
       
   299     }
       
   300     
       
   301 // -----------------------------------------------------------------------------
       
   302 // TMceStateTransitionEvent::EventSource
       
   303 // -----------------------------------------------------------------------------
       
   304 //
       
   305 TMceEventSource TMceStateTransitionEvent::EventSource()
       
   306     {
       
   307     return iEventSource;
       
   308     }
       
   309 
       
   310 // -----------------------------------------------------------------------------
       
   311 // TMceStateTransitionEvent::Code
       
   312 // -----------------------------------------------------------------------------
       
   313 //
       
   314 TUint& TMceStateTransitionEvent::Code()
       
   315     {
       
   316     return iCode;
       
   317     }
       
   318 
       
   319 // -----------------------------------------------------------------------------
       
   320 // TMceStateTransitionEvent::ParamIDs
       
   321 // -----------------------------------------------------------------------------
       
   322 //
       
   323 TMceIds& TMceStateTransitionEvent::ParamIDs()
       
   324     {
       
   325     return *iIds;
       
   326     }
       
   327 
       
   328 
       
   329 // -----------------------------------------------------------------------------
       
   330 // TMceStateTransitionEvent::ParamClientMessage
       
   331 // -----------------------------------------------------------------------------
       
   332 //
       
   333 CMceMsgBase& TMceStateTransitionEvent::ParamClientMessage()
       
   334     {
       
   335     return *iClientMessage;
       
   336     }
       
   337     
       
   338     
       
   339 // -----------------------------------------------------------------------------
       
   340 // TMceStateTransitionEvent::ParamMccEvent
       
   341 // -----------------------------------------------------------------------------
       
   342 //
       
   343 TMceMccComEvent* TMceStateTransitionEvent::ParamMccEvent()
       
   344     {
       
   345     return iMccEvent;
       
   346     }
       
   347 
       
   348     
       
   349 // -----------------------------------------------------------------------------
       
   350 // TMceStateTransitionEvent::Status
       
   351 // -----------------------------------------------------------------------------
       
   352 //
       
   353 TInt& TMceStateTransitionEvent::ParamStatus()
       
   354     {
       
   355     return iStatus;
       
   356     }
       
   357 
       
   358 // -----------------------------------------------------------------------------
       
   359 // TMceStateTransitionEvent::Status
       
   360 // -----------------------------------------------------------------------------
       
   361 //    
       
   362 void TMceStateTransitionEvent::SetParamIDs( TMceIds& aIds )
       
   363     {
       
   364     if ( iIds )
       
   365         {
       
   366         iIds->Copy( aIds );
       
   367         }
       
   368     }
       
   369 
       
   370 // -----------------------------------------------------------------------------
       
   371 // TMceStateTransitionEvent::SetParamClientMessage
       
   372 // -----------------------------------------------------------------------------
       
   373 //
       
   374 void TMceStateTransitionEvent::SetParamClientMessage( CMceMsgBase* aMsg )
       
   375     {
       
   376     iClientMessage = aMsg;
       
   377     }
       
   378 
       
   379 
       
   380 
       
   381 // -----------------------------------------------------------------------------
       
   382 // TMceStateTransitionEvent::Dialog
       
   383 // -----------------------------------------------------------------------------
       
   384 //
       
   385 CSIPDialog* TMceStateTransitionEvent::Dialog( )
       
   386     {
       
   387     return iDialog;
       
   388     }
       
   389 
       
   390 
       
   391 // End of File
       
   392