imgtools/imglib/filesystem/source/messagehandler.cpp
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2006-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 the License "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 * This Class responsible to manage the instance of messageimplementation 
       
    16 * class.
       
    17 * @internalComponent
       
    18 * @released
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #include "messagehandler.h"
       
    24 
       
    25 Message* MessageHandler::iInstance=0;
       
    26 
       
    27 /**
       
    28 Function Get Instance of class Message Implementation and initializing messages.
       
    29 
       
    30 @internalComponent
       
    31 @released
       
    32 
       
    33 @return Instance of MessageImplementation
       
    34 */
       
    35 Message * MessageHandler::GetInstance()
       
    36 {
       
    37     if(iInstance == 0)
       
    38 	{
       
    39 		iInstance = new MessageImplementation();
       
    40 		iInstance->InitializeMessages();
       
    41 	}
       
    42 	return iInstance;
       
    43 }
       
    44 
       
    45 /**
       
    46 Function to call StartLogging function of class Message Implementation.
       
    47 
       
    48 @internalComponent
       
    49 @released
       
    50 
       
    51 @param aFileName
       
    52 Name of the Log File
       
    53 */
       
    54 void MessageHandler::StartLogging(char *aFileName)
       
    55 {
       
    56     GetInstance()->StartLogging(aFileName);
       
    57 }
       
    58 
       
    59 /**
       
    60 Function to delete instance of class MessageImplementation
       
    61 
       
    62 @internalComponent
       
    63 @released
       
    64 */
       
    65 void MessageHandler::CleanUp()
       
    66 {
       
    67 	delete iInstance;
       
    68 	iInstance = NULL;
       
    69 }
       
    70 
       
    71 /**
       
    72 Function to report message to class MessageImplementation
       
    73 
       
    74 @internalComponent
       
    75 @released
       
    76 */
       
    77 void MessageHandler::ReportMessage(int aMsgType, int aMsgIndex,char* aName)
       
    78 {
       
    79 	GetInstance()->ReportMessage(aMsgType,aMsgIndex,aName);
       
    80 }