imsrv_plat/im_cache_server_api/inc/cinstantmsgindicator.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:27:45 +0100
branchRCL_3
changeset 22 113b91e0a2ad
parent 21 cfd5c2994f10
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  base class declaration for accessing the cache information
*
*/



#ifndef __CINSTNATMSGINDICATOR_H
#define __CINSTNATMSGINDICATOR_H
// INCLUDES
#include <e32base.h>
#include <ecom/ecom.h>

//Constants
// interface uid for the instantmessagecache.
const TUid KINSTANTMSGINTERFACEUID={0x20026768};

// The general rule is that the (category) UID must be the same as the Security ID (the SID)
// of the process in which the code that is performing the define operation is running. 
// In effect, this forms a data cage, preventing a process from defining, or "occupying", 
// another process's property. 
// hence this is the uid of imcacheserver.
const TUid KIMStatusProperty={0x2001242A};
enum TIMStatusPropertyKeys
    {
    EIMStatusPropertyMessageCount,
    EIMStatusPropertyServiceId,
    EIMStatusPropertySenderId,
    EIMMultipleSender
    };

 /**
  * An interface for setting/resetting statuspane icon
  *
  * @since 5.0
  */
 class CInstantMsgIndicator: public CBase
     {
      public:
        
        static CInstantMsgIndicator* CreateImplementationL( TUid aUid );
       
        virtual ~CInstantMsgIndicator();
     public:
         
         /**
          * sets/resets the status pane indicator
          * @param aNewMessages, new message count
          * @param aSeriveId, service id.
          * @param aSenderId, message sender id.
          * @param aMultipleSender, count of number of P-2_p chats.
          * @param aCloseConversation, indicates that this even came from closing the 
          * conversation and hence no need to paly the tone if there were already new messages.
          */
 	   virtual void MessageInfoL(TInt aNewMessages, TInt aSeriveId,const TDesC& aSenderId,
 	                             TInt aMultipleSenders,TBool aCloseConversation = EFalse) = 0;	
		 
     private:
         /**
          * Instance identifier key. When instance of an implementation is
          * created by ECOM framework, the framework will assign a UID for
          * it. The UID is used in the destructor to notify framework that
          * this instance is being destroyed and resources can be released.
          * Plugin implementations should leave this untouched, as the inline
          * destructor and constructor method take care of ECom releasing.
          */
         TUid iDtor_ID_Key; 
     };
 
 inline CInstantMsgIndicator* CInstantMsgIndicator::CreateImplementationL( TUid aUid )
     {
     TAny* ptr = REComSession::CreateImplementationL( aUid, _FOFF( CInstantMsgIndicator, iDtor_ID_Key ) );
     CInstantMsgIndicator* impl = static_cast<CInstantMsgIndicator*> (ptr);
     return impl;
     }

 inline CInstantMsgIndicator::~CInstantMsgIndicator()
     {
     REComSession::DestroyedImplementation( iDtor_ID_Key );
     }
 
 #endif //__CINSTNATMSGINDICATOR_H