javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstartermessages.h
changeset 35 85266cc22c7f
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
       
     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:  PreinstallerStarterMessages
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef PREINSTALLERSTARTERMESSAGES_H
       
    19 #define PREINSTALLERSTARTERMESSAGES_H
       
    20 
       
    21 #include "logger.h"
       
    22 #include "commsmessage.h"
       
    23 
       
    24 namespace java
       
    25 {
       
    26 namespace captain
       
    27 {
       
    28 
       
    29 using namespace java::util;
       
    30 using namespace java::comms;
       
    31 
       
    32 // This event is sent when preinstaller process has exited
       
    33 const int PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C = 30;
       
    34 
       
    35 const char PREINSTALLER_EVENT_PROVIDER[] = "preinstaller";
       
    36 
       
    37 
       
    38 inline void setPreinstallerExitedMessageParams(CommsMessage& aMessage, const int& aExitStatus)
       
    39 {
       
    40     aMessage.setMessageId(PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C);
       
    41     aMessage << aExitStatus;
       
    42 }
       
    43 
       
    44 inline void getPreinstallerExitedMessageParams(CommsMessage& aMessage, int& aExitStatus)
       
    45 {
       
    46     if (aMessage.getMessageId() == PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C)
       
    47     {
       
    48         aMessage >> aExitStatus;
       
    49     }
       
    50     else
       
    51     {
       
    52         ELOG2(EJavaCaptain, "wrong MessageId!: %d should be %d",
       
    53               aMessage.getMessageId(), PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C);
       
    54         aExitStatus = 0;
       
    55     }
       
    56 }
       
    57 
       
    58 
       
    59 } // namespace captain
       
    60 } // namespace java
       
    61 
       
    62 #endif // PREINSTALLERSTARTERMESSAGES_H